Linux下WiFi使用也比较多,即可作为局域组网,也可通过路由/移动网络连接外网使用。
常用软件命令:wpa_passphrase hostapd
一般WiFi模组为sdio接口传输数据(802.11帧),驱动由厂商提供
流程:
insmod xxx.ko ifconfig wlan0 upSta模式(wpa_passphrase)
wpa_passphrase ssid password > /etc/wpa_supplicant/ssid.conf #生成连接路由器配置文件 wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/w1.conf -B #连接路由器 udhcpc -i wlan0 -s default.script & #动态获取IPAP模式(hostap) 配置文件
/etc/hostapd/hostapd.conf
interface=wlan0 #接口名 ssid=My_wifi #wifi名 channel=6 hw_mode=g #指定协议 ignore_broadcast_ssid=0 auth_algs=1 wpa=3 wpa_passphrase=11111111 #wifi密码 wpa_key_mgmt=WPA-PSK #NONE时不需要密码 wpa_pairwise=TKIP CCMP rsn_pairwise=CCMP TKIP country_code=CN #国家码
/etc/udhcpd/udhcpd.conf
start 192.168.1.100 end 192.168.1.199 interface wlan0 #opt dns 168.95.1.1 168.95.192.1 option subnet 255.255.255.0 opt router 192.168.1.1 #opt wins 192.168.10.10 #option dns 129.219.13.81 #option domain local option lease 864000运行
hostapd /etc/hostapd/hostapd.conf -B udhcpd /etc/udhcpd/udhcpd.conf



