一个简单的配置文件:
interface=wlan0
bridge=br0
driver=nl80211
ssid=ssa
hw_mode=g
channel=11
dtim_period=1
rts_threshold=2347
fragm_threshold=2346
auth_algs=3
wpa=1
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
- sudo apt-get install bridge-utils
- sudo brctl addbr br0
- sudo ifconfig br0 192.168.2.236 netmask 255.255.255.0
- #not tested : sudo route add default gw 192.168.2.254
Note: my eth0 ip=192.168.2.110
连接网桥两端:- sudo brctl addif br0 eth0
- sudo brctl addif br0 wlan0
hostapd -d /etc/hostapd/hostapd.conf
安装配置dhcp,此处直接使用dnsmasq进行
/usr/sbin/dnsmasq --conf-file --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo --clear-on-reload --strict-order --listen-address=10.10.10.1 --dhcp-range=10.10.10.10,10.10.10.100,60m --dhcp-option=option:router,10.10.10.1 --dhcp-lease-max=50 --pid-file=/var/run/nm-dnsmasq-wlan0.pid
remain problems:
PC can't use network anymore, reason not clear.
当开机连接到无线网络时,可能连接失败,
解决:开一下共享wifi再关闭共享wifi,再连接无线wifi可以连上。
这篇博客介绍了如何在Ubuntu 12.04系统中利用hostapd创建并共享WiFi网络。通过配置hostapd.conf文件,设置接口、桥接、SSID、频道等参数,并安装bridge-utils和dnsmasq来实现无线热点功能。然而,配置后可能出现主机无法上网的问题,以及开机连接无线网络时的连接失败问题,这些问题需要通过手动操作共享WiFi后再关闭来解决。

2958

被折叠的 条评论
为什么被折叠?



