wpa_supplicant 与iwpriv工具配置WIFI的命令

=====================================================
安卓相关的网络配置
=====================================================
=====================================================
hostapd 配置命令
=====================================================
/system/bin/hostapd -e/data/misc/wifi/entropy.bin /data/misc/wifi/hostapd.conf &
=====================================================
wpa_supplicant -iwlan0 -Dwext -c/system/etc/wifi/wpa_supplicant.conf -dd -B
wpa_supplicant -iwlan0 -Dnl80211 -c/system/etc/wifi/wpa_supplicant.conf  -B


wpa_supplicant -iwlan0 -Dwext -c/data/misc/wifi/wpa_supplicant.conf -dd -B
wpa_supplicant -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -dd -B
=====================================================
=====================================================
wpa_cli -iwlan0 scan
wpa_cli -iwlan0 scan_results
wpa_cli -iwlan0 remove_network 0
wpa_cli -iwlan0 add_network
wpa_cli -iwlan0 set_network 0 ssid '"henryking"'
wpa_cli -iwlan0 set_network 0 key_mgmt WPA-PSK
wpa_cli -iwlan0 set_network 0 key_mgmt NONE
wpa_cli -iwlan0 set_network 0 psk '"12345678"'
wpa_cli -iwlan0 set_network 0 wep_key0 123456
wpa_cli -iwlan0 set_network 0 wep_tx_keyidx 0
wpa_cli -iwlan0 select_network 0
wpa_cli -iwlan0 save_config
wpa_cli -iwlan0 list_networks
wpa_cli -iwlan0 add_network;wpa_cli -iwlan0 set_network 0 ssid '"82883008"';wpa_cli -iwlan0 set_network 0 psk '"12345678"';wpa_cli -iwlan0 select_network 0
=====================================================
wpa_cli -irausb0 scan
wpa_cli -irausb0 scan_results
wpa_cli -irausb0 add_network
wpa_cli -irausb0 set_network 0 ssid '"henry"'
wpa_cli -irausb0 set_network 0 psk '"12345678"'
wpa_cli -irausb0 set_network 0 key_mgmt WPA-PSK
wpa_cli -irausb0 set_network 0 key_mgmt NONE
wpa_cli -irausb0 select_network 0
wpa_cli -irausb0 enable_network 0
wpa_cli -irausb0 ap_scan '"1"'
wpa_cli -irausb0 save_config
=====================================================
=====================================================


=====================================================
=====================================================
iwpriv 配置网络
=====================================================
WPA/WPA2
=====================================================
iwpriv rausb0 set NetworkType=Infra
iwpriv rausb0 set AuthMode=WPA2PSK
iwpriv rausb0 set EncrypType=AES
iwpriv rausb0 set SSID="sabre"
iwpriv rausb0 set WPAPSK="12345678"
iwpriv rausb0 set NetworkType=Infra;iwpriv rausb0 set AuthMode=WPA2PSK;iwpriv rausb0 set EncrypType=AES;iwpriv rausb0 set WPAPSK="12345678";iwpriv rausb0 set SSID="henryking";
iwpriv rausb0 set NetworkType=Infra;iwpriv rausb0 set AuthMode=WPAPSK;iwpriv rausb0 set EncrypType=AES;iwpriv rausb0 set SSID="82883008";iwpriv rausb0 set WPAPSK="12345678"
iwpriv rausb0 set NetworkType=Infra;iwpriv wlan0 set AuthMode=WPAPSK;iwpriv wlan0 set EncrypType=AES;iwpriv wlan0 set WPAPSK="12345678";iwpriv wlan0 set SSID="henryking";
=====================================================
WEP
=====================================================
iwpriv rausb0 set AuthMode=SHARED
iwpriv rausb0 set EncrypType=WEP
iwpriv rausb0 set DefaultKeyID=1
iwpriv rausb0 set Key1="1111222233"
iwpriv rausb0 set SSID="sabre"
=====================================================
iwconfig wlan0 essid "sabre"
iwconfig wlan0 key 1111222233
=====================================================


=====================================================
mstar wifi配置
=====================================================
wpa_supplicant -Dwext -iwlan0 -c /usr/bin/wpa_0_8.conf -B
ifconfig wlan0 up
wpa_cli -iwlan0 -p/var/run/wpa_supplicant scan
wpa_cli -iwlan0 -p/var/run/wpa_supplicant scan_results
wpa_cli -iwlan0 -p/var/run/wpa_supplicant ap_scan 1
wpa_cli -iwlan0 -p/var/run/wpa_supplicant add_network 
wpa_cli -iwlan0 -p/var/run/wpa_supplicant set_network 0 ssid '"henryking"' 
wpa_cli -iwlan0 -p/var/run/wpa_supplicant set_network 0 key_mgmt WPA-PSK
wpa_cli -iwlan0 -p/var/run/wpa_supplicant set_network 0 proto WPA2
wpa_cli -iwlan0 -p/var/run/wpa_supplicant set_network 0 pairwise CCMP
wpa_cli -iwlan0 -p/var/run/wpa_supplicant set_network 0 group CCMP
wpa_cli -iwlan0 -p/var/run/wpa_supplicant set_network 0 psk '"12345678"' 
wpa_cli -iwlan0 -p/var/run/wpa_supplicant select_network 0
=====================================================
=====================================================


=====================================================
wpa_supplicant.conf
=====================================================
linux下格式:
=====================================================
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
        ssid="henry"
        psk="12345678"
        key_mgmt=WPA-PSK
}
=====================================================
Android下格式:
=====================================================
update_config=1
ctrl_interface=DIR=/data/system/wpa_supplicant GROUP=wifi
eapol_version=1
ap_scan=1
fast_reauth=1
=====================================================

你可能感兴趣的:(wpa_supplicant 与iwpriv工具配置WIFI的命令)