僅個人記錄,不建議參考
用apt下載hostapd,dnsmasq
插入網卡,不需要開啟監聽模式
創建一個open.conf文件,寫入
interface=wlan0
ssid=FreeWiFi
driver=nl80211
channel=1
hw_mode=g
其中,interface是無線網卡接口名稱,ssid是熱點名稱,driver是無線驅動,channel是信道(1-13)。hw_mode是值無線模式,g表示IEEE 802.11g,視情況修改
然后配置DHCP和DNS服務,這里我使用dnsmasq
在/etc/dnsmasq.conf 中修改
dhcp-range=192.168.229.100,192.168.229.250,12h
interface=wlan0
interface是無線網卡接口名稱
dhcp-range這個值來源於eth0的inet。
但是目前是什么意思還沒搞清楚,有可能就是這個值導致熱點無法上網
然后就是重啟服務,
systemctl restart dnsmasq
如果出現這種報錯
Job for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xe" for details.
就按提示輸入systemctl status networking.service
一步一步排查,有可能是文件什么地方寫錯了
正常情況下重啟服務后,
再執行
nmcli radio wifi off
rfkill unblock wlan
ifconfig wlan0 192.168.229.134
hostapd open.conf
不出意外就是這個樣子
然后就可以用手機連上這個wifi了。
但是我這個樣子配置,目前該wifi可以連上,但是沒有網絡
待解決