`
844604778
  • 浏览: 552020 次
文章分类
社区版块
存档分类
最新评论

linux iwpriv命令学习

 
阅读更多

iwpriv是linux下配置无线网络的工具。

1. 使用ifconfig查看无线网卡的名字,
sh-# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:E7:06:00:00
inet addr:192.168.0.162 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4108 errors:0 dropped:2269 overruns:0 frame:0
TX packets:548 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:577677 (564.1 Kb) TX bytes:89655 (87.5 Kb)
Interrupt:40 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:640 (640.0 b) TX bytes:640 (640.0 b)

wl0 Link encap:Ethernet HWaddr 00:6B:9E:1E:FF:12
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:11194 errors:1333 dropped:12 overruns:0 frame:0
TX packets:10344 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4413296 (4.2 Mb) TX bytes:4300092 (4.1 Mb)

sh-#

2. 查看当前无线网络的连接状况,
sh-# ./iwpriv wl0 connStatus
wl0 connStatus:Disconnected

sh-#

3. 使用iwlist命令扫描无线网络,
sh-# ./iwlist wl0 scanning
[ 4834.305660] ===>rt_ioctl_giwscan. 40(40) BSS returned, data->length = 6781
wl0 Scan completed :
Cell 01 - Address: 14:D6:4D:29:05:54
Protocol:11b/g/n BW40
ESSID:"V_Test"
Mode:Managed
Frequency:2.412 GHz (Channel 1)
Quality=78/100 Signal level=-59 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:300 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: Unknown: DD270050F204104A0001101044000102104700100000000000001000000014D64D290554103C000103
Cell 03 - Address: 40:16:9F:C4:C5:E4
Protocol:11b/g/n BW40
ESSID:""
Mode:Managed
Frequency:2.412 GHz (Channel 1)
Quality=78/100 Signal level=-59 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:150 Mb/s
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 06 - Address: 14:E6:E4:4A:29:56
Protocol:11b/g BW20
ESSID:"TP-LINK_4A2956"
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=73/100 Signal level=-61 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 07 - Address: 14:CF:92:73:C4:80
Protocol:11b/g/n BW40
ESSID:"TP-LINK_73C480"
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=100/100 Signal level=-49 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:150 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
Cell 13 - Address: 00:1A:1E:04:5B:A2
Protocol:11b/g BW20
ESSID:""
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality=57/100 Signal level=-67 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : 802.1x
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : 802.1x
Cell 15 - Address: B8:A3:86:AC:A2:5A
Protocol:11b/g/n BW40
ESSID:"XULIN"
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality=100/100 Signal level=-39 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:300 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD0E0050F204104A0001101044000102

sh-#

4. 设定无线网络,
sh-# ./iwpriv wl0 set NetworkType=Infra
sh-# ./iwpriv wl0 set AuthMode=WPA2PSK
sh-# ./iwpriv wl0 set EncrypType=TKIP
sh-# ./iwpriv wl0 set WPAPSK=11111111

5. 连接无线网络,
sh-# ./iwpriv wl0 set SSID=XULIN

6. 可以为什么没有连上呢?
sh-# ./iwpriv wl0 connStatus
wl0 connStatus:Disconnected

sh-#

很多时候可以通过控制台命令来确定无线网络问题是无线网络本身的问题
还是基于无线网络之上的应用软件问题。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics