qca wifi相关操作命令

  1. 创建VAP
root@OpenWrt:~# wlanconfig ath0 create wlandev wifi0 wlanmode ap
[ 1044.840000] wlan_vap_create : enter. devhandle=0x867f0380, opmode=IEEE80211_M_HOSTAP, flags=0x1
[ 1044.850000] ieee80211_mbo_vattach:MBO Initialized 
[ 1044.850000] ieee80211_oce_vattach: OCE Initialized 
[ 1044.860000] wlan_vap_create : exit. devhandle=0x867f0380, vap=0x83948000, opmode=IEEE80211_M_HOSTAP, flags=0x1.
[ 1044.870000] __ieee80211_smart_ant_init: Smart Antenna is not supported 
[ 1044.880000] VAP device ath0 created osifp: (838cdb80) os_if: (83948000)
ath0
  1. 设置SSID
    “`
    root@OpenWrt:~# iwconfig ath0 essid “HELLO”
    [ 1145.690000] [DEBUG] vap-0(ath0):set SIOC80211NWID, 5 characters
    [ 1145.700000]
    [ 1145.700000] DES SSID SET=HELLO
3. 查看VAP连接列表

root@OpenWrt:~# wlanconfig ath0 list
ADDR AID CHAN TXRATE RXRATE RSSI MINRSSI MAXRSSI IDLE TXSEQ RXSEQ CAPS ACAPS ERP STATE MAXRATE(DOT11) HTCAPS ASSOCTIME IEs MODE PSMODE
11:2f:00:c7:ab:11 1 1 0M 24M 62 66 66 15 0 65535 ESs 0 f 0 AP 00:00:06 WME IEEE80211_MODE_11NG_HT20 0

4.查看VAP支持的信道和当前设置的信道

root@OpenWrt:~# iwlist ath0 channel
ath0 47 channels in total; available frequencies :
Channel 01 : 2.412 GHz
Channel 02 : 2.417 GHz
Channel 03 : 2.422 GHz
Channel 04 : 2.427 GHz
Channel 05 : 2.432 GHz
Channel 06 : 2.437 GHz
Channel 07 : 2.442 GHz
Channel 08 : 2.447 GHz
Channel 09 : 2.452 GHz
Channel 10 : 2.457 GHz
Channel 11 : 2.462 GHz
Current Frequency:2.412 GHz (Channel 1)

5. 设置信道

root@OpenWrt:~# iwconfig ath0 channel 6
[ 1572.470000] siwfreq
[ 1572.470000] Set freq vap 0 stop send + 83948000
[ 1572.490000] Set freq vap 0 stop send -83948000
[ 1572.520000] Set wait done –83948000
[ 1572.600000] __ieee80211_smart_ant_init: Smart Antenna is not supported

6.设置信道宽度与查看

root@OpenWrt:~# iwpriv ath0 chwidth 0
root@OpenWrt:~# iwpriv ath0 get_chwidth
ath0 get_chwidth:0
数字含义:
0 (HT)20 MHz
1 40 MHz
2 80 MHz
3 80_80/160 MHz
<3 Invalid

7.查看当前无线模式

root@OpenWrt:~# iwpriv ath0 get_mode
ath0 get_mode:AUTO

7.设置无线模式

root@OpenWrt:~# iwpriv ath0 mode 11NGHT40PLUS
root@OpenWrt:~# iwpriv ath0 get_mode
ath0 get_mode:11NGHT40PLUS

**当设置模式之后通过iwconfig查看是否改变,需要对接口进行down up**

root@OpenWrt:~# iwconfig ath0
ath0 IEEE 802.11g ESSID:”HELLO”
Mode:Master Frequency:2.437 GHz Access Point: 00:03:7F:55:88:88
Bit Rate:54 Mb/s Tx-Power=11 dBm
RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=0/94 Signal level=-95 dBm Noise level=-95 dBm
Rx invalid nwid:2362 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

root@OpenWrt:~#
root@OpenWrt:~#
root@OpenWrt:~# iwpriv ath0 mode 11NGHT40PLUS

root@OpenWrt:~# iwpriv ath0 get_mode
ath0 get_mode:11NGHT40PLUS
root@OpenWrt:~#
root@OpenWrt:~#
root@OpenWrt:~# iwconfig ath0
ath0 IEEE 802.11g ESSID:”HELLO”
Mode:Master Frequency:2.437 GHz Access Point: 00:03:7F:55:88:88
Bit Rate:54 Mb/s Tx-Power=11 dBm
RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=0/94 Signal level=-95 dBm Noise level=-95 dBm
Rx invalid nwid:2458 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

root@OpenWrt:~# ifconfig ath0 down
root@OpenWrt:~# ifconfig ath0 up
[ 3715.580000] 8021q: adding VLAN 0 to HW filter on device ath0
root@OpenWrt:~# ifconfig ath0 down[ 3717.910000] mlme_create_infra_bss : Overriding HT40 channel with HT20 channel
[ 3717.970000] __ieee80211_smart_ant_init: Smart Antenna is not supported
root@OpenWrt:~# iwconfig ath0
ath0 IEEE 802.11ng ESSID:”HELLO”
Mode:Master Frequency:2.437 GHz Access Point: 00:03:7F:55:88:88
Bit Rate:144.4 Mb/s Tx-Power=11 dBm
RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=0/94 Signal level=-95 dBm Noise level=-95 dBm
Rx invalid nwid:2464 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

8.设置tx power

root@OpenWrt:~# iwconfig ath0
ath0 IEEE 802.11ng ESSID:”HELLO”
Mode:Master Frequency:2.437 GHz Access Point: 00:03:7F:55:88:88
Bit Rate:130 Mb/s Tx-Power=11 dBm
RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=0/94 Signal level=-95 dBm Noise level=-95 dBm
Rx invalid nwid:573 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
“`

你可能感兴趣的:(WLAN)