iwconfig用来操作VAP接口
radio层不支持iwconfig命令
命令帮助
~ # iwconfig --help
Usage: iwconfig [interface]
interface essid {NNN|any|on|off}
interface mode {managed|ad-hoc|master|...}
interface freq N.NNN[k|M|G]
interface channel N
interface bit {N[k|M|G]|auto|fixed}
interface rate {N[k|M|G]|auto|fixed}
interface enc {NNNN-NNNN|off}
interface key {NNNN-NNNN|off}
interface power {period N|timeout N|saving N|off}
interface nickname NNN
interface nwid {NN|on|off}
interface ap {N|off|auto}
interface txpower {NmW|NdBm|off|auto}
interface sens N
interface retry {limit N|lifetime N}
interface rts {N|auto|fixed|off}
interface frag {N|auto|fixed|off}
interface modulation {11g|11a|CCK|OFDMg|...}
interface commit
Check man pages for more details.
查看全部接口
~ # iwconfig
ath0 IEEE 802.11na ESSID:"ssidname"
Mode:Master Frequency:5.745 GHz Access Point: 00:03:0F:AA:EE:00
Bit Rate:144.4 Mb/s Tx-Power:23 dBm
RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=94/94 Signal level=-96 dBm Noise level=-95 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
查看指定接口
~ # iwconfig ath0
ath0 IEEE 802.11ng ESSID:"ssidname"
Mode:Master Frequency:2.412 GHz Access Point: 00:03:0F:AA:EE:00
Bit Rate:144.4 Mb/s Tx-Power:23 dBm
RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=94/94 Signal level=-96 dBm Noise level=-95 dBm
Rx invalid nwid:2 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
设置信道
iwconfig ath0 freq 1
iwconfig ath0 channel 1
iwconfig ath0 channel auto
设置传输功率
单位dBm
iwconfig ath0 txpower 20
设置WEP密钥
enc和key是同义词,索引从1到4
ascii格式
iwconfig ath0 key [1] s:passw
hex格式
iwconfig ath0 key [1] 0000-0000-00
关闭WEP
iwconfig ath0 key off
选择使用哪一个key
iwconfig ath0 key [1]
对于WEP64(40),密码长度5个字节
对于WEP128(108),密码长度13个字节
设置接口模式
iwconfig eth0 mode Ad-Hoc
iwconfig eth0 mode Managed
iwconfig eth0 mode Master
iwconfig eth0 mode Repeater
iwconfig eth0 mode Secondary
iwconfig eth0 mode Monitor
设置速率
iwconfig ath0 rate auto
关联到指定mac的AP
iwconfig ath0 ap 00:AA:BB:CC:DD:00
设置rts阈值
iwconfig ath0 rts 256
设置为2346关闭
iwconfig ath0 rts 2346
设置frag阈值
iwconfig ath0 frag 256
设置为2346关闭
iwconfig ath0 frag 2346