The wireless command line

From JoatWiki
Jump to: navigation, search

Contents

Intro

Please pardon the mess. This is a work in progress and may lack proper formatting. Also please remember that the following information may be based on inaccurate research (my own or someone else's) and may not apply to the specific version of wl that you have.

My goal is to eventually make this a compendium of the commands available to control wireless connectivity via a terminal. Eventually, I'll make PDF or PS versions of the document available.


wl command listing

a_mrate

Manipulates the 802.11a radio's multicast rate. Applicable values include: 6, 9, 12, 18, 24, 36, 48, and 54. A -1 (the default) means "automatically determine the best rate". Examples:

wl a_mrate 54
wl a_mrate -1

a_rate

Manipulates the 802.11a radio's rate. Applicable values include: 6, 9, 12, 18, 24, 36, 48, and 54. A -1 (the default) means "automatically determine the best rate". Examples:

wl a_rate 54
wl a_rate -1

abbfl

This is an undocumented command and I do not as yet know what it is. Example:

root@OpenWrt:~# wl abbfl
0

Adding anything after abbfl causes the command to error.

abminrate

This is an undocumented command. I do not yet know what it is or does. By itself, the command returns a numeric value:

root@OpenWrt:~# wl abminrate
0

Adding a digit to the end of the command changes the returned value:

root@OpenWrt:~# wl abminrate 5
root@OpenWrt:~# wl abminrate
5

aciargs

Still researching the info behind this one. ACI is short for "adjacent channel interference". The 802.11t document defines the methodology for measuring ACI.

ACI appears to be associated with mesh networks and QoS.

Source: http://rfdesign.com/next_generation_wireless/short_range_wireless/radio_challenges_importance_testing/

http://www.mpirical.com/companion/Multi_Tech/ACI.htm

http://whitepapers.zdnet.co.uk/0,39025945,60070499p-39000680q,00.htm

add_ie

This is used to add an Information Element (IE) to 802.11 management frames. The syntax for the command is:

wl add_ie pktflag length OUI hexdata

where "pktflg" is a mask (3210) =

bit 0 for beacon
bit 1 for probe response
bit 2 for association/re-association response
bit 3 for authentication response

Math example:

3 --> 0011 --> beacon and probe response

I still need to capture an example of this command in action.

addwep

Sets an encryption key. The key must be 5, 13 or 16 bytes long, or 10, 26, 32, or 64 hex digits long. The encryption algorithm is automatically selected based on the key size. keytype is accepted only when key length is 16 bytes/32 hex digits and specifies whether AES-OCB or AES-CCM encryption is used. Default is ccm.

 addwep <keyindex> <keydata> [ocb | ccm] [notx] [xx:xx:xx:xx:xx:xx]

where

 keyindex = a name for the key declaration?
 keydata = the data for the key
 ocb = use the AES OCB algorithm (exclusive of "ccm")
 ccm = use the AES CCM algorithm (default) (exclusive of "ocm")
 notx =
 

See also "wl rmwep"

need to research the above as it is not explained well anywhere

aes

"wl aes" returns the current status of hardware encryption:

 root@OpenWrt:~# wl aes
 Algorithms (hardware):
 WEP disabled
 TKIP disabled
 AES disabled

"wl aes on", "wl aes enable" or "wl aes 1" enables the AES hardware encryption

"wl aes off", "wl aes disable" or "wl aes 0" disables the AES hardware encryption

"wl aes sw" or "wl aes software" signals that AES encryption is done in software

"wl aes hw" or "wl aes hardware" signals that AES encryption is done in hardware

The above needs verification and reorganization

antdiv

Selects the receive antenna.

"wl antdiv 0" = use the antenna nearest the power jack
"wl antdiv 1" = use the antenna nearest the reset button
"wl antdiv 3" = antenna diversity (use which ever one has the best signal)
"wl antdiv" returns the current selection

For some reason, "wl antdiv -1" and "wl antdiv 2" produces the same setting as "wl antdiv 3"

ap

Sets the station mode. "wl ap" by itself returns the current device status

0 = station
1 = access point

Examples:

# Set the device as a client
root@OpenWrt:~# wl ap 0
root@OpenWrt:~# 

# Set the device as an access point
root@OpenWrt:~# wl ap 1
root@OpenWrt:~# 
# Test the current status
root@OpenWrt:~# wl ap
ap is 1 (on)

ap_isolate

This is an undocumented command. It determines whether or not STAs can "see" each other.

0 = STAs can "see" each other
1 = STAs cannot "see" each other

Examples:

root@OpenWrt:~# wl ap_isolate
0
root@OpenWrt:~# wl ap_isolate 1
root@OpenWrt:~# wl ap_isolate
1

assoc

Dumps information about the current network association (I'm assuming this applies to client mode)

Example:

root@OpenWrt:~# wl assoc
SSID: "joats"
Mode: Managed   RSSI: 0 dBm     noise: 0 dBm    Channel: 6
BSSID: 00:0C:43:E3:28:92        Capability: ESS ShortSlot 
Supported Rates: [ 1(b) 2(b) 5.5(b) 6 9 11(b) 12 18 24 36 48 54 ]

assoclist

Dumps a list of stations associated with the AP (AP mode only)

Example:

root@OpenWrt:~# wl assoclist
assoclist 02:04:C2:6A:F1:C6
assoclist 02:19:00:00:00:00

atten

Relates to the transmit attentuation in 802.11b and 802.11g.

Example:

root@OpenWrt:~# wl atten
Current 11b/g tx atten is (auto) bb/radio/ctl1 = 3/3/48

Needs enumeration

authe_sta_list

autho_sta_list

authorize

band

Returns or sets the current band setting(s).

Example:

root@OpenWrt:~# wl band
auto

bands

Returns the list of available 802.11 bands. (Note: b can include g)

Example:

root@OpenWrt:~# wl bands
b

bg_mrate

bg_rate

bi

bssid

cap

Dumps the capabilities of the device.

Example:

root@OpenWrt:~# wl cap
ap sta wet led wme pio 802.11d 802.11h rm cqa

chan_info

chanlist

channel

channel_qa

channel_qa_start

channels

channels_in_country

clk

cmds

Dumps the list of available commands.

Example:

root@OpenWrt:~# wl cmds
a_rate            del_ie            powerindex        scan_channel_time 
a_mrate           eap               phyreg            scan_unassoc_time 
ap                evm               plcphdr           scan_home_time    
atten             frag              phytype           scan_passive_time 
antdiv            fqacurcy          primary_key       scan_nprobes      
addwep            fasttimer         passive           ssid              
aes               frameburst        prb_resp_timeout  shortslot         
authorize         gmode             phylist           shortslot_override 
assoc             gmode_protection  pktcnt            shortslot_restrict 
assoclist         gmode_protection_control pwr_percent scb_timeout      
aciargs           gmode_protection_cts quiet          slowtimer         
authe_sta_list    gmode_protection_override restart   sta_info          
autho_sta_list    glacialtimer      reboot            tssi              
add_ie            infra             radio             txpwr             
bg_rate           int               revinfo           txpwr1            
bg_mrate          ignore_bcns       rts               txpathpwr         
bssid             isup              rate              txpwrlimit        
band              interference      radioreg          txant             
bands             join              ratedump          tkip              
bi                keys              rateparam         tsc               
cmds              lodump            rmwep             tkip_countermeasures 
clk               lrl               regulatory        up                
cwmin             locale            rateset           ucflags           
cwmax             lazywds           roam_trigger      upgrade           
channel           longtrain         roam_delta        ver               
chanlist          lbt               roam_scan_period  wake              
channels          legacy_erp        rssi              wepstatus         
channels_in_country list_ie         radar             wep               
curpower          msglevel          rssidump          wsec_test         
channel_qa        monitor           rm_req            wsec_restrict     
channel_qa_start  mrate             rm_rep            wsec              
country           macreg            rand              wpa_auth          
crsuprs           mac               srdump            wds               
csa               macmode           srl               wet               
constraint        measure_req       shmem             wds_remote_mac    
cap               malloc_dump       scbdump           wds_wpa_role_old  
chan_info         nvdump            set_pmk           wds_wpa_role      
down              nvset             scan              wme               
dump              nvget             spect             wme-ac            
deauthorize       noise             scanresults       
deauthenticate    out               status            
disassoc          PM                scansuppress      
dtim              promisc           suprates

constraint

country

This command has a number of formats and functions.

"wl country" returns the current country value. Example:

root@OpenWrt:~# wl country
ALL/<unknown>

"wl country list" returns a listing of supported countries with their associated ISO 3166 abbreviation. (Example to long to list here.)

"wl country XX" (where XX is a country name or code). Note: you must bring the radio down before changing the country code.

Example:

root@OpenWrt:~# wl country
ALL/<unknown>
root@OpenWrt:~# wl down
root@OpenWrt:~# wl country us
Setting country code "us"
root@OpenWrt:~# wl up
root@OpenWrt:~# wl country
US/UNITED STATES
root@OpenWrt:~# wl down
root@OpenWrt:~# wl country all
Setting country code "all"
root@OpenWrt:~# wl up
root@OpenWrt:~# wl country
ALL/<unknown>
root@OpenWrt:~# wl down
root@OpenWrt:~# wl country "united states"
Setting country code "US"
root@OpenWrt:~# wl up      
root@OpenWrt:~# wl country
US/UNITED STATES

cram

crsuprs

csa

curpower

cwmax

cwmin

deauthenticate

deauthorize

del_ie

This is used to remove an Information Element (IE) from 802.11 management frames (see "add_ie"). The syntax for the command is:

wl del_ie pktflag length OUI hexdata

where "pktflg" is a mask (3210) =

bit 0 for beacon
bit 1 for probe response
bit 2 for association/re-association response
bit 3 for authentication response

Math example:

3 --> 0011 --> beacon and probe responses

I still need to capture an example of this command in action.

disassoc

down

Disables the radio. Example:

wl down

dtim

dump

eap

eirp

evm

fasttimer

fqacurcy

frag

frameburst

glacialtimer

gmode

gmode_protection

gmode_protection_control

gmode_protection_cts

gmode_protection_override

ignore_bcns

infra

int

interference

isup

join

keys

lazywds

lbt

legacy_erp

list_ie

locale

lodump

longtrain

lrl

mac

wl mac - Set or get the list of source MAC address matches.

  wl mac
  wl mac xx:xx:xx:xx:xx:xx [xx:xx:xx:xx:xx:xx ...]

To Clear the list:

  wl mac none

macmode

wl macmode - Set the mode of the MAC list.

  0 - Disable MAC address matching.
  1 - Deny association to stations on the MAC list.
  2 - Allow association to stations on the MAC list.

macreg

malloc_dump

maxassoc

This is an undocumented command. It sets the maximum number of associations available for use (Note: absolute maximum for the device is 128.) Examples:

root@OpenWrt:~# wl maxassoc
128 (0x80)
root@OpenWrt:~# wl maxassoc 6
root@OpenWrt:~# wl maxassoc
6

measure_req

monitor

mrate

msglevel

noise

nvdump

nvget

nvset

out

passive

phylist

phyreg

phytype

pktcnt

plcphdr

PM

powerindex

prb_resp_timeout

primary_key

promisc

pwr_percent

quiet

radar

radio

Without any numbers appended, returns the status of the radio. Example:

root@OpenWrt:~# wl radio
radio is on (WL_RADIO_SW_DISABLE 0 WL_RADIO_HW_DISABLE 0)

Appending a "0" or a "1" will change the DISABLE variable and change the status of the radio. Example:

root@OpenWrt:~# wl radio 1
root@OpenWrt:~# wl radio
radio is off (WL_RADIO_SW_DISABLE 1 WL_RADIO_HW_DISABLE 0)
root@OpenWrt:~# wl radio 0
root@OpenWrt:~# wl radio
radio is on (WL_RADIO_SW_DISABLE 0 WL_RADIO_HW_DISABLE 0)

Note that the relationship between the number and the radio status is counterintuitive.

radioreg

rand

rate

ratedump

rateparam

rateset

reboot

regulatory

restart

Reinitializes the radio. Note: the radio must be down and this command does not enable the radio.

revinfo

rm_rep

rm_req

rmwep

roam_delta

roam_scan_period

roam_trigger

rssi

rssidump

rts

scan

scan_channel_time

scan_home_time

scan_nprobes

scan_passive_time

scan_unassoc_time

scanresults

scansuppress

scb_activity_time

scb_timeout

scbdump

set_pmk

shmem

shortslot

shortslot_override

shortslot_restrict

slowtimer

spect

srdump

srl

ssid

sta_info

status

"wl status" Show some status

Example:

root@OpenWrt:~# wl status
SSID: "Test_231"
Mode: Managed   RSSI: 0 dBm     noise: 0 dBm    Channel: 6
BSSID: 00:1B:FC:9D:30:D2        Capability: ESS ShortSlot
Supported Rates: [ 1(b) 2(b) 5.5(b) 6 9 11(b) 12 18 24 36 48 54 ]

sup_auth_status

sup_wpa

This is an undocumented command. With no number, returns the status of the built-in WPA supplicant (0=off, 1=0n). With a number, sets turns the built-in supplicant on or off.

root@OpenWrt:~# wl sup_wpa
0
root@OpenWrt:~# wl sup_wpa 1
root@OpenWrt:~# wl sup_wpa
1

suprates

tkip

tkip_countermeasures

tsc

tssi

txant

Selects the transmit antenna.

"wl txant 0" = force use of antenna 0
"wl txant 1" = force use of antenna 1
"wl txant 3" = use the RX antenna selection that was in force during the most
               recently received good PLCP header
"wl txant"   = returns the current selection

txc_policy

txpathpwr

txpwr

txpwr1

"wl txpwr1" Set tx power in in various units. Choose one of (default: dbm):

       -d dbm units
       -q quarter dbm units
       -m milliwatt units

Can be combined with:

       -o turn on override to disable regulatory and other limitations
       

Use wl txpwr -1 to restore defaults


Example:

root@OpenWrt:~# wl txpwr1
TxPower is 64 qdbm,  16.00 dbm, 40 mW  Override is Off

txpwrlimit

ucflags

up

Enables wireless. Example:

wl up

upgrade

ver

"wl ver" prints the version information. Example:

root@OpenWrt:~# wl ver
wl:     3.90 RC37.0
        wl0: Feb 15 2005 14:08:17 version 3.90.37.0

wake

wds

wds_remote_mac

This is an undocumented command. It returns the BSSID of the remote endpoint. I do not have an example for this yet.

wdstimeout

wds_wpa_role

This is an undocumented command. It sets whether the AP is a WPA authenticator or a supplicant. I do not have an example for this yet.

wds_wpa_role_old

wep

wepstatus

wet

wme

wme-ac

wpa_auth

wpa_msgs

wsec

wsec_restrict

wsec_test

Sources:

  1. command line "help"
  2. http://www.dd-wrt.com/wiki/index.php/Wl_command
  3. http://forum.openwrt.org/viewtopic.php?id=2327
  4. http://www.dd-wrt.com/wiki/index.php/Script_Examples
  5. http://www.dd-wrt.com/wiki/index.php/Useful_Scripts
  6. http://www.devicescape.com/docs/uwp/package_guide/pkg_broadcom-wl.php
  7. older version of wl commands http://pwp.net.ipl.pt/isel/pribeiro/LinksysWRT54G.html
  8. http://www.hautespot.net/technology/Reference/Prism%20Developers%20Manual.pdf
  9. http://cyberforat.squat.net/openwrt/OpenWrt-HOWTO/x402.html
  10. http://wifi-portal.elevate.nl/docs/wl.txt

Leads to other research:

1) According to the following, you can set broadcom-based AP's to use channels 12, 13 and 14. http://forum.openwrt.org/viewtopic.php?pid=9916




Comments:

Leave a Comment

Personal tools