WPA CLI
来自Ubuntu中文
检查无线网卡信息
qii@ubuntu:~$ iwconfig wlan0 wlan0 IEEE 802.11bgn ESSID:"Ubuntu-wiki-wpa-cli" Mode:Managed Frequency:2.412 GHz Access Point: D3:1D:3C:11:A2:A1 Bit Rate=11 Mb/s Tx-Power=20 dBm Retry long limit:7 RTS thr:off Fragment thr:off Power Management:on Link Quality=58/70 Signal level=-52 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0
重启无线网卡
sudo ifconfig wlan0 down sudo ifconfig wlan0 up
搜索接入点
sudo iwlist wlan0 scanning
返回接入点列表,类似这样的
wlan0 Scan completed : Cell 01 - Address: D4:3D:1C:53:A3:A4 Channel:1 Frequency:2.412 GHz (Channel 1) Quality=54/70 Signal level=-56 dBm Encryption key:on ''' ESSID:"Ubuntu-wiki-wpa-cli"''' Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s Mode:Master Extra:tsf=0000002d049a7181 Extra: Last beacon: 232ms ago IE: Unknown: 000954506C2D4D61676963 IE: Unknown: 010482848B96 IE: Unknown: 030101 IE: IEEE 802.11i/WPA2 Version 1 Group Cipher : CCMP Pairwise Ciphers (1) : CCMP Authentication Suites (1) : PSK Preauthentication Supported IE: WPA Version 1 Group Cipher : CCMP Pairwise Ciphers (1) : CCMP Authentication Suites (1) : PSK
设定要连接的接入点
sudo iwconfig wlan0 essid SSID
密码
sudo iwconfig wlan0 key s:passphrase
然后是自动获取 IP
sudo dhclient wlan0