当前位置:   article > 正文

wireless iwpriv

wireless iwpriv
  1. iwpriv
  2. =================
  3. This is detailed explanation of each parameters for iwpriv.
  4. Before reading this document, make sure you already read README.
  5. -------------------------------------------------------------------------------------------------------
  6. USAGE_1:
  7. iwpriv rausb0 set [parameters]=[val]
  8. NOTE:
  9. Execute one iwpriv/set command simultaneously.
  10. DESCRIPTION
  11. [parameters] [val] /{range}
  12. ----------------- -------------------------------------------------
  13. CountryRegion {0~7}
  14. ::Set country region
  15. 0: 1 ~ 11 ch
  16. 1: 1 ~ 13 ch
  17. 2: 10, 11 ch
  18. 3: 10 ~ 13 ch
  19. 4: 14 ch
  20. 5: 1 ~ 14 ch
  21. 6: 3 ~ 9 ch
  22. 7: 5 ~ 13 ch
  23. CountryRegionABand {0~10}
  24. ::Set country region for A band
  25. 0: 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165 ch
  26. 1: 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 ch
  27. 2: 36, 40, 44, 48, 52, 56, 60, 64 ch
  28. 3: 52, 56, 60, 64, 149, 153, 157, 161 ch
  29. 4: 149, 153, 157, 161, 165 ch
  30. 5: 149, 153, 157, 161 ch
  31. 6: 36, 40, 44, 48 ch
  32. 7: 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165 ch
  33. 8: 52, 56, 60, 64 ch
  34. 9: 34, 38, 42, 46 ch
  35. 10: 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64 ch
  36. SSID {0~z, 1~32 ascii characters}
  37. ::Set AP SSID
  38. WirelessMode {0~4}
  39. ::Set Wireless Mode
  40. 0:11b/g mixed,
  41. 1:11B only,
  42. 2:11A only
  43. 3:11a/b/g mixed,
  44. 4:11G only
  45. TxRate {0~12}
  46. ::Set TxRate of Infrastructure mode
  47. 0:Auto, 1:1Mbps,
  48. 2:2Mbps, 3:5.5Mbps,
  49. 4:11Mbps, 5:6Mbps,
  50. 6:9Mbps, 7:12Mbps,
  51. 8:18Mbps, 9:24Mbps,
  52. 10:36Mbps, 11:48Mbps,
  53. 12:54Mbps
  54. Channel depends on CountryRegion or CountryRegionABand
  55. ::Set Channel
  56. BGProtection {0~2}
  57. ::Set 11B/11G Protection
  58. 0:Auto,
  59. 1:Always on,
  60. 2:Always off
  61. TxPreamble {0~2}
  62. ::Set TxPreamble
  63. 0:Preamble Long,
  64. 1:Preamble Short,
  65. 2:Auto
  66. RTSThreshold {1~2347}
  67. ::Set RTS Threshold
  68. FragThreshold {256~2346}
  69. ::Set Fragment Threshold
  70. TxBurst {0,1}
  71. ::Set TxBurst Enable or Disable
  72. 0:Disable,
  73. 1:Enable
  74. NetworkType {Infra,Adhoc}
  75. ::Set Network type
  76. AdhocOfdm {0~3}
  77. ::Set Adhoc Wireless Mode
  78. 0: WIFI mode(11b rates only),
  79. 1: b/g mixed,
  80. 2: 11g only,
  81. 3: 11a only
  82. AuthMode {OPEN,SHARED,WEPAUTO,WPAPSK,WPA2PSK,WPANONE}
  83. ::Set Authentication Mode
  84. EncrypType {NONE,WEP,TKIP,AES}
  85. ::Set Encryption Type
  86. DefaultKeyID {1~4}
  87. ::Set Default Key ID
  88. Key1 {5 ascii characters or 10 hex number or
  89. 13 ascii characters or 26 hex numbers}
  90. ::Set Key1 String
  91. Key2 {5 ascii characters or 10 hex number or
  92. 13 ascii characters or 26 hex numbers}
  93. ::Set Key2 String
  94. Key3 {5 ascii characters or 10 hex number or
  95. 13 ascii characters or 26 hex numbers}
  96. ::Set Key3 String
  97. Key4 {5 ascii characters or 10 hex number or
  98. 13 ascii characters or 26 hex numbers}
  99. ::Set Key4 String
  100. WPAPSK {8~63 ascii or 64 hex characters}
  101. ::WPA Pre-Shared Key
  102. PSMode {CAM, MAX_PSP, FAST_PSP}
  103. ::Set Power Saving Mode
  104. IEEE80211H {0,1}
  105. ::Set IEEE80211H Enable or Disable
  106. 0: Disable
  107. 1: Enable spectrum management
  108. (This field can be enable only in A band)
  109. -------------------------------------------------------------------------------------------------------
  110. USAGE_2:
  111. iwpriv rausb0 [parameters] [val]
  112. DESCRIPTION
  113. [parameters] [val] range explaination
  114. ----------------- ----------------------- ------------------------------------------
  115. auth {1~5} 1:OPEN Authentication Mode
  116. 2:SHARED
  117. 3:WPAPSK
  118. 4:WPA2PSK
  119. 5:WPANONE
  120. enc {1~4} 1:NONE Encryption Type
  121. 2:WEP
  122. 3:TKIP
  123. 4:AES
  124. wpapsk {8~64 chars} WPAPSK/WPA2PSK Password
  125. psm {0~2} 0:constantly awake mode (CAM) Power Saving Mode
  126. 1:MAX_PSP
  127. 2:FAST_PSP
  128. -------------------------------------------------------------------------------------------------------
  129. Examples
  130. =================
  131. -------------------------------------------------------------------------------------------------------
  132. a> Config STA to link with AP which is OPEN/NONE(Authentication/Encryption)
  133. 1. iwpriv rausb0 set NetworkType=Infra
  134. 2. iwpriv rausb0 set AuthMode=OPEN
  135. 3. iwpriv rausb0 set EncrypType=NONE
  136. 4. iwpriv rausb0 set SSID="AP's SSID"
  137. b> Config STA to link with AP and OPEN/WEP(Authentication/Encryption).
  138. Default Key ID = 3
  139. 1. iwconfig rausb0 key [3]
  140. 2. iwconfig rausb0 key s:abcde
  141. 3. iwconfig rausb0 essid "AP's SSID"
  142. c> Config STA to link with AP which is SHARED/WEP(Authentication/Encryption).
  143. 1. iwpriv rausb0 set NetworkType=Infra
  144. 2. iwpriv rausb0 set AuthMode=SHARED
  145. 3. iwpriv rausb0 set EncrypType=WEP
  146. 4. iwpriv rausb0 set Key1="AP's wep key"
  147. 5. iwpriv rausb0 set DefaultKeyID=1
  148. 6. iwpriv rausb0 set SSID="AP's SSID"
  149. d> Config STA to link with AP which is WPAPSK/TKIP(Authentication/Encryption)
  150. 1. iwpriv rausb0 set NetworkType=Infra
  151. 2. iwpriv rausb0 set AuthMode=WPAPSK
  152. 3. iwpriv rausb0 set EncrypType=TKIP
  153. 4. iwpriv rausb0 set SSID="AP's SSID"
  154. 5. iwpriv rausb0 set WPAPSK="12345678"
  155. 6. iwpriv rausb0 set SSID="AP's SSID"
  156. p.s Step 4 is part of generating wpapsk password and is necessary.
  157. e> Config STA to link with AP which is WPAPSK/AES(Authentication/Encryption)
  158. 1. iwconfig rausb0 mode managed
  159. 2. iwpriv rausb0 auth 3
  160. 3. iwpriv rausb0 enc 4
  161. 4. iwconfig rausb0 essid "AP's SSID"
  162. 5. iwpriv rausb0 wpapsk 12345678
  163. 6. iwconfig rausb0 essid "AP's SSID"
  164. f> Config STA to link with AP which is WPA2PSK/TKIP(Authentication/Encryption)
  165. 1. iwpriv rausb0 set NetworkType=Infra
  166. 2. iwpriv rausb0 set AuthMode=WPA2PSK
  167. 3. iwpriv rausb0 set EncrypType=TKIP
  168. 4. iwpriv rausb0 set SSID="AP's SSID"
  169. 5. iwpriv rausb0 set WPAPSK="12345678"
  170. 6. iwpriv rausb0 set SSID="AP's SSID"
  171. g> Config STA to create/link as adhoc mode, which is OPEN/NONE(Authentication/Encryption)
  172. 1. iwpriv rausb0 set NetworkType=Adhoc
  173. 2. iwpriv rausb0 set AuthMode=OPEN
  174. 3. iwpriv rausb0 set EncrypType=NONE
  175. 4. iwpriv rausb0 set SSID="Adhoc's SSID"
  176. h> Config STA to create/link as adhoc mode, which is WPANONE/TKIP(Authentication/Encryption)
  177. 1. iwpriv rausb0 set NetworkType=Adhoc
  178. 2. iwpriv rausb0 set AuthMode=WPANONE
  179. 3. iwpriv rausb0 set EncrypType=TKIP
  180. 4. iwpriv rausb0 set SSID="AP's SSID"
  181. 5. iwpriv rausb0 set WPAPSK=12345678
  182. 6. iwpriv rausb0 set SSID="AP's SSID"
  183. i> Get site survey
  184. iwpriv rausb0 get_site_survey
  185. j> Get Statistics
  186. iwpriv rausb0 stat ; read statistic counter
  187. iwpriv rausb0 set ResetCounter=0 ; reset statistic counter
  188. k> Link with any AP without security ; set ANY SSID (ssidLen=0)
  189. usage: iwconfig ra0 essid ""
  190. or
  191. usage: iwpriv ra0 set SSID=""
  192. ===================================================================
  193. iwlist
  194. =================
  195. This is detailed explanation of each parameters for iwlist.
  196. -------------------------------------------------------------------------------------------------------
  197. iwlist rausb0 scanning ; list the results after scanning(manual rescan)
  198. =======================================================================================================
  199. iwconfig
  200. =================
  201. The following are our support in standard configuration - iwconfig
  202. -------------------------------------------------------------------------------------------------------
  203. iwconfig rausb0 essid {NN|on|off} ; set ssid
  204. iwconfig rausb0 mode {managed|ad-hoc|...} ; set wireless mode
  205. iwconfig rausb0 freq N.NNNN[k|M|G]] ; set frequency
  206. iwconfig rausb0 channel N ; set channel
  207. iwconfig rausb0 ap {N|off|auto} ; set ap address
  208. iwconfig rausb0 nick N ; set nickname
  209. iwconfig rausb0 rate {N|auto|fixed} ; set rate
  210. iwconfig rausb0 rts {N|auto|fixed|off} ; set rts threshold
  211. iwconfig rausb0 frag {N|auto|fixed|off} ; set fragment threshold
  212. iwconfig rausb0 enc {NNNN-NNNN|off} ; set encryption type
  213. iwconfig rausb0 power {period N|timeout N} ; set power management modes
  214. iwconfig rausb0 key {[id]|s:pswd|pswd} ; set wep key
  215. *** Please refer to man page of 'iwconfig', 'iwlist' and 'iwpriv'. ***
NOTE: NOT ALL CARDS/FIRMWARE SUPPORT ALL OF THE COMMANDS LISTED BELOW.

Note: To connect your Linux machine to a WLAN using WPA, WPA2 or 802.1X you will need to use WPA Supplicant

Connecting to an OPEN / WEP WLAN (DHCP)

Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc.)

iwconfig [interface] mode managed key [WEP key] (128 bit WEP use 26 hex characters, 64 bit WEP uses 10)


iwconfig essid "[ESSID]" (Specify ESSID for the WLAN)


dhclient [interface] (to receive an IP address, netmask, DNS server and default gateway from the Access Point)


ping www.bbc.co.uk  (if you receive a reply you have access)



Connecting to an OPEN / WEP WLAN (Manual IP Setup)

Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc.)

It may be necessary to run some packet capture software (e.g. Ethereal) to determine the IP addresses of both the Default Gateway and DNS servers.

iwconfig [interface] mode managed key [WEP key] (128 bit WEP use 26 hex characters, 64 bit WEP uses 10)


iwconfig essid "[ESSID]"


ifconfig [interface] [IP address] netmask [subnetmask]


route add default gw [IP of default gateway] (Configure your default gateway; usually the IP of the Access Point)


echo nameserver [IP address of DNS server]  >>  /etc/resolve.conf (Configure your DNS server)


ping www.bbc.co.uk (if you receive a reply you have access)



iwconfig Commands:

Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc.)

iwconfig [interface] mode master (set the card to act as an access point mode)


iwconfig [interface] mode managed (set card to client mode on a network with an access point)


iwconfig [interface] mode ad-hoc (set card to peer to peer networking or no access point mode)


iwconfig [interface] mode monitor (set card to RFMON mode our favourite)


iwconfig [interface] essid any (with some cards you may  disable the  ESSID  checking)


iwconfig [interface] essid ?/span>your ssid_here?(configure ESSID for network)


iwconfig [interface] key 1111-1111-1111-1111 (set 128 bit WEP key)


iwconfig [interface] key 11111111 (set 64 bit WEP key)


iwconfig [interface] key s:mykey (set key as an ASCII string)


iwconfig [interface] key off (disable WEP key)


iwconfig [interface] key open (sets open mode, no authentication is used and card may accept non-encrypted sessions)


iwconfig [interface] channel [channel no.] (set a channel 1-14)


iwconfig [interface] channel auto (automatic channel selection)


iwconfig [interface] freq 2.422G (channels can also be specified in GHz)


iwconfig [interface] ap 11:11:11:11:11:11 (Force card to register AP address)


iwconfig [interface] rate 11M (card will use the rate specified)


iwconfig [interface] rate auto (select automatic rate)


iwconfig [interface] rate auto 5.5M (card will use the rate specified and any rate below as required)



ifconfig Commands:

Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc.)

ifconfig [interface] up (bring up specified interface)


ifconfig [interface] down (take down specified interface)


ifconfig [interface] [IP address] netmask [subnet-mask] (manually set IP and subnet-mask details)


ifconfig [interface] hw ether [MAC] (Change the wireless cards MAC address, specify in format 11:11:11:11:11:11)



iwpriv Commands:

Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc.)

iwpriv [interface] hostapd 1 (used to set card mode to hostapd e.g. for void11)


When the monitor mode patch is installed as per the
Wireless Build HOWTO
the following commands may be used to set the card into monitor mode.


iwpriv [interface] monitor [A] [B]
[A]
0 = disable monitor mode
1 = enable monitor mode with Prism2 header

2 = enable monitor mode with no Prism2
[B]
Channel to monitor (1-14)

iwlist Commands:

Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc.)

iwlist is used to display some large chunk of information from a wireless network interface that is not displayed by iwconfig.


iwlist [interface] scan (Give the list of Access Points and Ad-Hoc cells in range (ESSID, Quality, Frequency, Mode etc.) Note: In tests only worked with Atheros cards).


iwlist [interface] channel (Give the list of available frequencies in the device and the number of channels).


iwlist [interface] rate (List the bit-rates supported by the device).


iwlist [interface] key (List the encryption key sizes supported and display all the encryption keys available in the device).


iwlist [interface] power (List the various Power Management attributes and modes of the device).


iwlist [interface] txpower (List the various Transmit Power available on the device).


iwlist [interface] retry (List the transmit retry limits and retry lifetime on the device).


iwlist [interface] ap (Give the list of Access Points in range, and optionally the quality of link to them.  Deprecated in favour of scan)


iwlist [interface] peers (Give the list of Peers associated/registered with this card).


iwlist [interface] event (List the wireless events supported by this card).


Madwifi-ng Commands:

MADWiFi supports virtual access points (VAPS), which means you can create more than one wireless device per wireless card (the host wireless card = wifi0).  

By default, a sta mode VAP is created by, which is MadWifi talk for a 'managed mode wireless interface'.


Note: replace athx with your interface name as required (e.g. ath0, ath1)


wlanconfig athx destroy (Destroy VAP, athx)


wlanconfig athx create wlandev wifi0 wlanmode sta (Create a managed mode VAP, athx)


wlanconfig athx create wlandev wifi0 wlanmode ap (Create an Access Point VAP, athx)


wlanconfig athx create wlandev wifi0 wlanmode adhoc (Create an Ad-Hoc VAP, athx)


wlanconfig athx create wlandev wifi0 wlanmode monitor (Create a Monitor mode VAP, athx)


Changing modes:

ifconfig athx down (Take the VAP down)


wlanconfig athx destroy
(Destroy the VAP, athx)


wlanconfig athx create wlandev wifi0 wlanmode [sta|adhoc|ap|monitor]
(Create a new sta, adhoc, ap or monitor VAP)


Scan for Access Points (requires both steps):

modprobe wlan_scan_sta (To insert the scanning module)


wlanconfig athx list scan (To list the APs)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/391804
推荐阅读
相关标签
  

闽ICP备14008679号