It is estimated that the impact of the typhoon yesterday, the home of the slag route strike, can only link but not the Internet. Originally intended to surf the internet to come back, the results of last night to pick up things when the university bought a face recognition of the Raspberry Pi in the corner to eat ash for a long time, so intends to transform it.
Too long did not move the Raspberry Pi, power does not run normally, simply directly from the first step of the brush system to start operation.
First, system settings
Brush system operation has been introduced a lot, here reference @ Wang Dengko: HTTP://WWW.TUICOOL.COM/ARTICLES/RBVNFEF Implementation Putty Remote Connection Raspberry Pi
Second, HOSTAPD
1, installation HOSTAPD
sudo Install HOSTAPD
2. Use the following statement to open HOSTAPD
sudo NANO/ETC/DEFAULT/HOSTAPD
3, find #daemon_conf= "" This line, first uncomment (remove the previous #), and then modify it to:
daemon_conf="/etc/hostapd/hostapd.conf"
4. Open hostapd.conf
sudo nano/etc/hostapd/hostapd.conf
5, add the configuration information (PS: Because I did not find the specific type of equipment I bought, which is used in the following way to configure)
# Wlan0 The wireless card as an access point interface=Wlan0 # Use the corresponding driver driver=XXXX #共享网络的SSID是RaspberryPi SSID=Raspberrypi # NIC works in 802.11G mode Hw_mode=G #无线网卡选用11信道 Channel= One# WPA2 Configuring WPA=2#wpa密码是raspberry wpa_passphrase=Raspberry #认证方式为WPA-PSK Encryption mode is CCMP WPA_KEY_MGMT=wpa-PSK wpa_pairwise=CCMP rsn_pairwise=CCMP Beacon_int= -Auth_algs=3wmm_enabled=1
6, install Autoremove HOSTAPD
sudo apt-get autoremove HOSTAPD
7. Download and install third-party drivers:
wget https://tar -zxvf v1. 1. Tar . GZ cd RTL8188-hostapd-1.1/sudomakesudomake Install
8. Start HOSTAPD Service:
Sudo
The following text indicates that the start was successful
802.11802.11 MANAGEMENT:HOSTAPD.
Open the hostapd.conf query to my configuration as follows
# Basic Configurationinterface=Wlan0ssid=Wifichannel=6#bridge=br0# WPA and WPA2 configurationmacaddr_acl=0Auth_algs=1Ignore_broadcast_ssid=0WPA=3Wpa_passphrase=Yourpasswordwpa_key_mgmt=wpa-pskwpa_pairwise=tkiprsn_pairwise=ccmp# Hardware configurationdriver=rtl871xdrvieee80211n=1Hw_mode=Gdevice_name=Rtl8192cumanufacturer=realtek
Third, DHCP
1. Install the DHCP service to assign IP to each access device
sudo Install Isc-dhcp-server
2. Edit the configuration file
sudo nano/etc/dhcp/dhcpd.conf
3, set the gateway and other information, here is the use of 10.38.10.1
default-lease- Time -; Max-lease- Time 7200; log-facility LOCAL7; subnet10.38.10.0Netmask255.255.255.0{Range10.38.10.10 10.38.10.100; option Routers10.38.10.1; option broadcast-address10.38.10.127; option Domain-name-servers8.8.8.8,8.8.4.4; default-lease- Time -; Max-lease- Time 7200; }
4. Start the DHCP service
sudo service isc-dhcp-server restart
Four, forwarding configuration
1. Configure route forwarding
sudo iptables-sudo iptables-sudo iptables-t nat-a postrouting-o eth0-
sudo
bash iptables-save >/etc/
iptables.up.rules exit
2. Open iptables File
sudo nano/etc/network/if-pre-up.d/iptables
Add the following code
#!/bin//sbin/iptables-restore </etc/iptables.up.rules
3. Modify Iptables Permissions
sudo chmod 755 /etc/network/if-pre-up.d/iptables
4, set the kernel forwarding, open the sysctl.conf file
sudo nano/etc/sysctl.conf
Place the following two lines within the file
for IPv4 #net. Ipv4.ip_forward=1
Modify to (that is, remove the net.ipv4.ip_forward=1 comment)
for IPv4 Net.ipv4.ip_forward=1
5. After modifying the kernel, make it effective
sudo sysctl-p
At this point, the wireless router Setup function has been completed.
V. Self-starter settings
1, installation Chkconfig
sudo Install Chkconfig
2, set HOSTAPD, DHCP self-start
sudo chkconfig--sudo chkconfig--add isc-dhcp-server
Reconstruction of wireless router based on Raspberry Pi