|
1.安装hostapd:
[pre]
apt-get install hostapd
[/pre]
2.配置hostapd.conf
这个文件里有大量配置信息,幸好我们一般能用到的就那几个(其中多数去掉注释,配置保持默认):
[pre]
interface=wlan0 #分享WiFi的无线网卡
bridge=br0
driver=nl80211 #网卡驱动
ssid=priess #热点ssid
hw_mode=g
channel=1
dtim_period=1
rts_threshold=2347
fragm_threshold=2346
auth_algs=3
wpa=1 #加密类型wpa2
wpa_passphrase=12345678 #热点密钥
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
[/pre]
3.安装bridge-utils搭建网桥
[pre]
apt-get install bridge-utils
brctl adbr br0
ifconfig br0 192.168.2.236 netmask 255.255.255.0
route add default gw 192.168.2.254
brctl addif br0 eth0
brctl addif br0 wlan0
[/pre]
4.开启热点
[pre]
hostapd /file/hostapd.conf
[/pre]
|
|