ifconfig wlan0 down ifconfig wlan0 up iwlist wlan0 scan|grep ESSID|cut -d\":\" -f2" //获取可用WIFI列表 wpa_supplicant -B -Dnl80211 -iwlan0 -c /etc/wpa_supplicant.conf wpa_cli -i wlan0 add_network //增加一个网络,返回网络id wpa_cli -i wlan0 set_network [网络编号] ssid '"wifi名称"' wpa_cli -i wlan0 set_network [网络编号] psk '"密码"' udhcpc -i wlan0 //动态获取IP wpa_cli -i wlan0 select_network [网络编号] //选择网络
ifconfig wlan0 down ifconfig wlan0 up iwlist wlan0 scan|grep ESSID wpa_supplicant -D wext -c /etc/wpa_supplicant.conf -i wlan0 & wpa_cli -i wlan0 add_network wpa_cli -i wlan0 set_network 0 ssid '"@PHICOMM_48"' wpa_cli -i wlan0 set_network 0 psk '"ruanjianzu"' wpa_cli -i wlan0 select_network 0 udhcpc -b -i wlan0
wpa_cli -i wlan0 list_network //查看网络列表 wpa_cli -i wlan0 status //查看wifi状态 wpa_cli -i wlan0 save_config //保存WIFI热点信息
wpa_cli -i wlan0 remove_network 网络编号 //删除网络
udhcpc -b -i wlan0 //动态获取IP
-b,切换到后台
-q,获取之后直接退出