编译树莓派2代B型OpenWrt固件实现无线路由器及nodogsplash认证功能
最终功能:
无线路由器的主要功能,网口WAN接入,USB无线网卡AP热点输出,连上wifi之后跳转到认证页面,点击认证方可上网,有效时间10分钟,认证成功之后自动访问指定网址。
文章结尾有编译好的刷机包下载
硬件准备:
1.Raspberry Pi 2 model B
2.USB无线网卡,我使用的是TL-WN722N 150Mbps 芯片是AR9271
3.操作系统:CentOS 7
4.SD卡8GB
开始之前最好配置好代理,因为编译过程中所有的依赖会联网自动下载,会有大部分时间耗在这里,如果速度慢或者被墙……
配置编译环境(一定要非root账户):
#升级组件
sudo yum update
#安装编译组件
sudo yum install libtool autoconf automake gcc-multilib bison screen gcc g++ binutils patch bzip2 flex make gettext unzip libc6 git-core git build-essential libncurses5-dev zlib1g-dev gawk quilt asciidoc libz-dev subversion
下载openwrt源码(新手不建议下载trunk,不是很稳定)
#使用非root用户登录,建立openwrt目录
mkdir openwrt
#进入openwrt目录
cd openwrt
#下载openwrt的源码
git clone git://git.openwrt.org/15.05/openwrt.git
集成nodogsplash 在/openwrt/feeds.conf.default中添加
src-git nodogsplash https://github.com/nodogsplash/nodogsplash.git
设置权限
sudo chmod -R 777 trunk
cd trunk
更新并安装
./scripts/feeds update -a
./scripts/feeds install -a
根据自己的需要更改系统默认设置,就不细说了,这里列举几个我的设置
#这个目录下可以放置之前openwrt的备份文件,也就是说相当于openwrt的/etc/目录
/home/rophie/openwrt/openwrt/package/base-files/files/etc #默认wifi设置
package/kernel/mac80211/files/lib/wifi/mac80211.sh
network设置
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0' config interface 'lan'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.88.1'
option netmask '255.255.255.0'
option _orig_bridge 'true'
option gateway '192.168.88.1' config globals 'globals'
option ula_prefix 'fda9:3639:b1e9::/48' config interface 'wan'
option ifname 'eth0'
option _orig_ifname 'eth0'
option _orig_bridge 'false'
option proto 'dhcp'
wireless设置
config wifi-device 'radio0'
option type 'mac80211'
option channel '11'
#这里根据你的USB无线网卡的U口来定
option path 'platform/bcm2708_usb/usb1/1-1/1-1.5/1-1.5:1.0'
option noscan '1'
option country 'CN'
option hwmode '11n'
option htmode 'HT40'
option txpower '40' config wifi-iface
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'APK-YFKJ'
option encryption psk-mixed
option key 88888888
nodogsplash设置
config instance
# Set to 1 to enable nodogsplash
option enabled 1 # Use plain configuration file as well
#option config '/etc/nodogsplash/nodogsplash.conf'
option network 'lan'
option gatewayname 'OpenWrt Nodogsplash'
option maxclients '250'
option idletimeout '10'
option clientforcetimeout '10'
option redirecturl 'http://192.168.88.1:8080' # Your router may have several interfaces, and you
# probably want to keep them private from the network/gatewayinterface.
# If so, you should block the entire subnets on those interfaces, e.g.:
#list authenticated_users 'block to 192.168.0.0/16'
list authenticated_users 'block to 10.0.0.0/8' # Typical ports you will probably want to open up.
list authenticated_users 'allow tcp port 22'
list authenticated_users 'allow tcp port 53'
list authenticated_users 'allow udp port 53'
list authenticated_users 'allow tcp port 80'
list authenticated_users 'allow tcp port 443'
list authenticated_users 'allow tcp port 8080' # For preauthenticated users to resolve IP addresses in their
# initial request not using the router itself as a DNS server,
list preauthenticated_users 'allow tcp port 53'
list preauthenticated_users 'allow udp port 53'
#list preauthenticated_users 'allow tcp port 8080' # Allow ports for SSH/Telnet/DNS/DHCP/HTTP/HTTPS
list users_to_router 'allow tcp port 22'
list users_to_router 'allow tcp port 23'
list users_to_router 'allow tcp port 53'
list users_to_router 'allow udp port 53'
list users_to_router 'allow udp port 67'
list users_to_router 'allow tcp port 80'
list users_to_router 'allow tcp port 8080'
list users_to_router 'allow tcp port 443' # See https://github.com/nodogsplash for a full list of available options.
编译配置
#更新版本号
svn up
#进入编译菜单
make menuconfig
Y:选择Y,该软件将被编译,并且加入到你的目标固件里;
M:选择M,该软件包将会被编译,但不会被放入固件里。在需要它的时候,可以用OPKG软件包管理器进行安装;
N:选择N,该软件包将不会被编译,也不会被安装进固件。
方向键是移动光标
回车键是确认
空格键是选择,可以代替Y/M/N键的使用
/:搜索
Target System 选择 brcm2708-bcm2709 按Y选中
需要集成的软件
kmod-usb-core kmod-usb-ohci kmod-usb-uhci kmod-usb2 usbutils kmod-ath kmod-ath9k kmod-ath9k-common kmod-ath9k-htc luci-i18n-base-zh-cn kmod-nls-cp437 kmod-nls-utf8 kmod-fs-vfat kmod-nls-iso8859-1 wireless-tools hostapd
编译
make V=99
很久之后你已经能够在/bin/brcm2708下找到openwrt-brcm2708-bcm2709-sdcard-vfat-ext4.img刷机固件了
编译树莓派2代B型OpenWrt固件实现无线路由器及nodogsplash认证功能的更多相关文章
- 在树莓派2代B型/3代 上安装Fedora23 - Installing Fedora 23 on Raspberry Pi 2 model B or Raspberry Pi 3
本文主要用于记录安装过程,以便日后查阅回顾. 之前在自己的树莓派上运行的一直是通过NOOB安装的Raspbian,但是本人平时更喜欢用Fedora作为开发和使用环境,而且Raspbian上的软件包通常 ...
- 树莓派3代B型 Raspberry Pi Model 3 B 安装 centos7系统
板子类型: Raspberry Pi Model 3 B 搭配 32G的SD卡: 下载支持树莓派版本的centos7系统 https://buildlogs.centos.org/centos/7/i ...
- 树莓派2代 B型 4核 1G内存 raspberry pi 2 model B
树莓派技术交流群:318799602 期盼已久的PI2 已经到货,Element14版,非RS版本.诚信卖家如期发货,不会像某些淘宝卖家一样,没有货还标注现货,发货时间一拖再拖. 树莓派的最新力作!! ...
- 为TL-WR720N编译带mentohust和njit-client的openwrt固件
openwrt的trunk版已经支持720N了.简单好多. 首先下载openwrt源码,我下的是trunk版 svn co svn://svn.openwrt.org/openwrt/trunk/ 然 ...
- 树莓派3代b型静态IP设置,和ssh的wlan配置
https://blog.csdn.net/qq_36305492/article/details/78607557
- 转:小白编译openwrt固件教程
原文地址 编译openwrt固件并没有想象的那么复杂,我也是个小白,以下内容是我将网络上的编译教程稍微进行了一下整合.因为我发现很多编译教程没有说明如何更改flash相关配置. 安装ubuntu, ...
- 编译个性化的openwrt固件
基本流程是:下载openwrt源码(推荐attitude adjustment版本).执行feeds更新.make menuconfig(通过配置feed.conf.default和menuconfi ...
- 编译适用于TP-Link WR703N的OpenWRT固件
编译适用于TP-Link WR703N TP-Link MR11U 以及使用AR9331芯片组的单WAN/LAN复用口的路由. 注:刷机有风险,刷机需谨慎.一般情况下是不会失败的,若无法通过捅Rese ...
- debian下编译openwrt固件
参考文章:Ubuntu下编译OpenWRT固件 我买的路由器是RG100A-AA,采用了bcm63xx系列的芯片. 下载openwrt源码: svn co svn://svn.openwrt.org/ ...
随机推荐
- css之图片下方定位遮掩层
需要的效果如图,图片下方加个遮掩层: html: <div class="listContent"> <div><img src="imag ...
- Net包管理NuGet(2)nuget包的生成方法
1,下载NuGetPackageExplorer,可以下载运行源码,也可以直接下载安装包安装安装之后打开 设置好内容之后点击绿色的打钩保存然后操作右边空白处 然后点击File>Save;保存之后 ...
- ansible 模块 分享
A a10_server 管理A10 Networks AX / SoftAX / Thunder / vThunder设备 a10_service_group 管理A10网络设备的服务组 a10_v ...
- vue.js实战——props数据验证(自定义构造器检测)
Vue.component('my-component',{ props:{ //必须是数字类型 propA:Number, //必须是字符串或数字类型 propB:[String,Number], ...
- MyBatis 3
MyBatis 3 学习笔记 一.Mybatis 基础知识 1.MyBatis 3编写步骤: 根据mybatis-config.xml配置文件创建一个SqlSessionFactory对象. sql映 ...
- Kafka分区分配策略(Partition Assignment Strategy
问题 用过 Kafka 的同学用过都知道,每个 Topic 一般会有很多个 partitions.为了使得我们能够及时消费消息,我们也可能会启动多个 Consumer 去消费,而每个 Consumer ...
- 微信公众号开发之access_token的全局共用
最近做微信公众号开发,涉及到access_token的缓存问题(避免各自的应用都去取access_token,同时解决微信 appid和appsecret的安全问题),在通用权限管理系统底层增加了实现 ...
- 2019年最大的Flag
2019年最大的Flag 今天是2019/1/15 我要立一个2019年的Flag:刻意的追求优秀>>>>>>>>>>>>勿以善 ...
- Python基础和原反补码及表达式
基础语法 1.注释 “#”标注的文件 2.数字 整数,不区分long和int 进制0xa.0o10.0b10 bool,2个值True.False 浮点数 1.2.3.1314.-0.12.1.46e ...
- .net core引用错误的Entity Framework而导致不能正常迁移数据的解决办法
本人刚学.net core,因此在学习过程中会遇上许许多多的坑.每一位初学者最大的问题在于资料的查看不仔细或是没有正确理解里面的内容,导致在后面自己在不知道错误的情况下做了一个小动作.对于完全没有理解 ...