Compile the Raspberry Pi 2 generation B OpenWrt firmware to implement the wireless router and nodogsplash authentication function. openwrtnodogsplash

Source: Internet
Author: User

Compile the Raspberry Pi 2 generation B OpenWrt firmware to implement the wireless router and nodogsplash authentication function. openwrtnodogsplash

Final function:

The main features of the wireless router, network port WAN Access, USB wireless Nic AP hotspot output, connected to wifi, jump to the authentication page, click the authentication to access the Internet, the effective time is 10 minutes, after successful authentication, the system automatically accesses the specified URL.

Compiled refresh downloads are available at the end of the article.

Hardware preparation:

1. Raspberry Pi 2 model B

2. USB wireless network card, I am using a TL-WN722N 150 Mbps chip is AR9271

3. Operating System: CentOS 7

4. SD card 8 GB

It is best to configure the proxy before you start, because all dependencies in the compilation process will be automatically downloaded online, and most of the time will be spent here ......

Configure the compiling environment (must be a non-root Account ):

#Upgrade components
sudo yum update
#Install the compilation component
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

Download openwrt source code (it is not recommended for beginners to download trunk, which is not very stable)

#Log in with a non-root user and create an openwrt directory
mkdir openwrt
#Enter the openwrt directory
cd openwrt
#Download openwrt's source code
git clone git: //git.openwrt.org/15.05/openwrt.git

Integrate nodogsplash and add it to/openwrt/feeds. conf. default.

src-git nodogsplash https://github.com/nodogsplash/nodogsplash.git

Set permissions

sudo chmod -R 777 trunk
cd trunk

Update and install

./scripts/feeds update -a
./scripts/feeds install -a

Change the default system settings as needed. I will not elaborate on them here.

#Backup files of previous openwrt can be placed in this directory, which is equivalent to the / etc / directory of openwrt
/ home / rophie / openwrt / openwrt / package / base-files / files / etc

#Default wifi settings
package / kernel / mac80211 / files / lib / wifi / mac80211.sh

Network Settings

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 Settings

config wifi-device 'radio0'
option type 'mac80211'
option channel '11'
         #Depending on the U port of your USB wireless network card
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 settings

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.

Compile configuration

#Update version number
svn up
#Enter the compilation menu
make menuconfig
Y: Select Y, the software will be compiled and added to your target firmware;
M: Select M, the package will be compiled, but will not be put into the firmware. When you need it, you can install it with the OPKG package manager;
N: Select N. The package will not be compiled or installed into the firmware.
Arrow keys are to move the cursor
Enter to confirm
The space bar is optional and can be used instead of the Y / M / N keys
/:search for 

Target System select brcm2708-bcm2709 selected by Y
Software to be integrated

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-fs-vfat kmod-nls-utf8 wireless-tools hostapd

Compile

make V=99

After a long time you have been able to find the openwrt-brcm2708-bcm2709-sdcard-vfat-ext4.img flashing firmware under/bin/brcm2708

 

 

 


 


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.