Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Rock2/wireless

< Rock2
Revision as of 12:38, 9 July 2015 by Jack (Talk | contribs)

1 change user to root

 sudo su

2 install and config hostapd

 #apt-get install hostapd
 #vim.tiny /etc/hostapd/hostapd.conf
 interface=wlan0
 ctrl_interface=/var/run/hostapd
 ssid=squareAP
 channel=6
 wpa=2
 wpa_passphrase=12345678
 #bridge=br0

3 install and config dnsmasq

 #apt-get install dnsmasq
 #vim.tiny /etc/dnsmasq.conf 
 interface=wlan0 
 bind-interfaces 
 except-interface=lo 
 dhcp-range=192.168.2.150,192.168.2.254,12h #configure the range of available ip
 dhcp-option=3,192.168.2.1 #configure the server

4 edit /etc/network/interfaces

 #vim.tiny /etc/network/interfaces
 # interfaces(5) file used by ifup(8) and ifdown(8)
 auto wlan0
 iface wlan0 inet static
 address 192.168.2.1
 netmask 255.255.255.0

5 install haveged

 #apt-get install haveged

6 start ap

 #sudo su
 #echo 2 > /sys/module/bcmdhd/parameters/op_mode
 #hostapd -B /etc/hostapd/hostapd.conf 
 #ip addr add 192.168.2.1/24 dev wlan0
 #service dnsmasq start 
 #echo 1 > /proc/sys/net/ipv4/ip_forward 
 #iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
 #/etc/init.d/haveged start

7 change from AP mode to normal mode

 #sudo su
 #echo 0 > /sys/module/bcmdhd/parameters/op_mode
 #reboot