iwlist

Get detailed wireless information

iwlist interface [ scan| frequency| rate| keys| power| txpower| retry| event| auth| wpakeys| genie| modulation]

Options are NOT prefixed with a -

Information not displayed by iwconfig

Values shown here were taken 9/10/19 on ETG

scan [essid NNN] [last]Access Points and Ad-Hoc cells in range, and optionally (ESSID, Quality, Frequency, Mode...).
Privileged operation (root ), Normal users read left-over scan results.
essid a scan on a specific ESSID.
May enable hidden networks.
last does not trigger a scan and read left-over scan results.
freq[uency]/channel driver returns the total number of channels and frequencies available in the present locale.
wlan0     11 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.462 GHz (Channel 11)
rate/bit[rate]
wlan0     unknown bit-rate information.
          Current Bit Rate=21.6 Mb/s
keys/enc[ryption]
wlan0     2 key sizes : 40, 104bits
          4 keys available :
        [1]: off
        [2]: off
        [3]: off
        [4]: off
          Current Transmit Key: [1]
power
wlan0     Current mode:on
txpower
wlan0     unknown transmit-power information.
retry transmit retry limits and retry lifetime
wlan0     Fixed limit    ;  min limit:0
                            max limit:255
          Current mode:on
                  short limit:7
                   long limit:4
event
wlan0     Wireless Events supported :
          0x8B04 : Set Frequency/Channel (kernel generated)
          0x8B06 : Set Mode (kernel generated)
          0x8B15 : New Access Point/Cell address - roaming
          0x8B19 : Scan request completed
          0x8B1A : Set ESSID (kernel generated)
          0x8B2A : Set Encoding (kernel generated)

wlan0     Scanning capabilities :
        - ESSID
auth WPA authentication parameters
wlan0     Authentication capabilities :
        WPA
        WPA2
        CIPHER-TKIP
        CIPHER-CCMP
wpa[keys] List all the WPA encryption keys set in the device.
wlan0     2 key sizes : 40, 104bits
          4 keys available :
Error reading wpa keys (SIOCGIWENCODEEXT): Operation not supported
genie Generic Information Elements
wlan0     no generic IE (Operation not supported).
modu[lation]
--version as well as the recommended and current Wireless Extensions version for the tool and the various wireless interfaces.
--help

Version on Raspberry pi buster takes longer between scan outoputs than stretch

Files

/proc/net/wireless
cat /proc/net/wireless
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
 wlan0: 0000   53.  -57.  -256        0      0      0      4      0        0 

Errors

Some times reports wlan0 Interface doesn't support scanning : Device or resource busy i
several times in a row and then continues

See

iwspy. iwevent, iwpriv, wireless


iwconfig

configure a wireless network interface

iwconfig [interface]
iwconfig interface [essid X] [nwid N] [mode M] [freq F]
               [channel C][sens S ][ap A ][nick NN ]
               [rate R] [rts RT] [frag FT] [txpower T]
               [enc E] [key K] [power P] [retry R]
               [modu M] [commit]

Options are NOT prefixed with a -

Similar to ifconfig, dedicated for wireless.

sudo iwconfig wlan0
wlan0     IEEE 802.11  ESSID:"disabled"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: 20:C0:47:C2:A8:A6   
          Bit Rate=65 Mb/s   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
          Link Quality=55/70  Signal level=-55 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:2  Invalid misc:0   Missed beacon:0

essid off|any|name ESSID or Network Name Domain ID to identify cells which are part of the same virtual network.
As opposed to the AP Address or NWID which define a single cell,
ESSID defines a group of cells connected via repeaters or infrastructure, where the user may roam transparently.
off Disable the ESSID checking (ESSID promiscuous) or
any enable.
Examples :
 iwconfig wlan0 essid any
 iwconfig wlan0 essid "My Network"
 iwconfig wlan0 essid -- "ANY"
mode mode Ad-Hoc network composed of only one cell without Access Point
Managed to a network composed of many Access Points, with roaming
Master synchronisation master or acts as an Access Point
Secondary acts as a backup master/repeater
Repeater forwards packets between other wireless nodes
Monitor not associated with any cell and passively monitor all packets on the frequency) or
Auto.
freq|channel nnn|auto Append M or G (example, "2.46G" for 2.46 GHz ),
Use iwlist to get the total number of channels, list the available frequencies, and display the current frequency as a channel.
In Ad-Hoc mode, only be used at initial cell creation
In Managed mode, the Access Point dictates the channel
Examples :
 iwconfig wlan0 freq 2422000000
 iwconfig wlan0 freq 2.422G
 iwconfig wlan0 channel 3
 iwconfig wlan0 channel auto 
ap any|auto|off|addressregister to the address Access Point, as reported by wireless scanning which may be different from its MAC address.
If the wireless link is point to point, set the address of the other end of the link.
If the link is ad-hoc, set the cell identity of the ad-hoc network.
When the quality of the connection goes too low, the driver may revert back to automatic mode (the card selects the best Access Point in range).
any or auto : reassociate with the current best Access Point.
off : enable automatic mode without changing the current Access Point.
Example :
 iwconfig wlan0 ap 00:60:1D:01:23:45I
 iwconfig wlan0 ap any
 iwconfig wlan0 ap off
rate/bit[rate] auto|nnn Append M or G
auto selects automatic
Examples :
                   iwconfig wlan0 rate 11M
                   iwconfig wlan0 rate auto
                   iwconfig wlan0 rate 5.5M auto
txpower auto|off| nn[mW transmit power in dBm. With mW is the power in milliWatts
Examples :
                   iwconfig wlan0 txpower 15
                   iwconfig wlan0 txpower 30mW
                   iwconfig wlan0 txpower off
sens [-]nn Sensitivity threshold. The lowest signal level for which the hardware remains associated with the current Access Point.
For high density of Access Points, a higher threshold make sure the card is always associated with the best AP, for low density of APs, a lower threshold minimise the number of failed handoffs.
Positive values are value used by the hardware or a percentage, negative values are dBm.

Example :
                   iwconfig wlan0 sens -80
                   iwconfig wlan0 sens 2
RaspberryPi Zero w :
Error for wireless request "Set Sensitivity" (8B08) :
    SET failed on device wlan0 ; Operation not supported.
retry [lifetime] short|long|min|max nnn maximum seconds for retry, Append m to specify milliseconds
The short, long, min and max modifiers. define the bounds of the limit or lifetime.
Examples :
                   iwconfig wlan0 retry 16
                   iwconfig wlan0 retry lifetime 300m
                   iwconfig wlan0 retry short 12
                   iwconfig wlan0 retry min limit 8
rts[_threshold] auto|fixed|off| bbb Size of the smallest packet for which the node sends RTS ; if equal to the maximum packet size disables the mechanism.
RTS/CTS adds a handshake before each packet to make sure that the channel is clear. adds overhead, but increases performance in case of hidden nodes or a large number of active nodes.
Examples :
                   iwconfig wlan0 rts 250
                   iwconfig wlan0 rts off
frag[mentation_threshold] auto|off| fixed| bbb maximum fragment size
Examples :
                   iwconfig wlan0 frag 512
                   iwconfig wlan0 frag off
key/enc[ryption] on|off|
restricted | open
[ix] key
manage encryption keys and security mode.
To set the current encryption key, enter the key in hex digits as XXXX-XXXX-XXXX-XXXX or XXXXXXXX.
To set a key other than the current key, prepend or append [index] to the key (this won't change which is the active key).
Enter the key as an ASCII string with s: prefix. Passphrase is currently not supported.
To change the currently active key, enter [index] (without entering any key value).
off and on disable and reenable encryption.
The security mode may be open or restricted, and its meaning depends on the card used. With most cards, in open mode no authentication is used and the card may also accept non-encrypted sessions,
In restricted mode only encrypted sessions are accepted and the card will use authentication if available.
To set multiple keys, or set a key and change the active key, use directives.
Arguments can be in any order, the last one takes precedence. Examples :
                   iwconfig wlan0 key 0123-4567-89
                   iwconfig wlan0 key [3] 0123-4567-89
                   iwconfig wlan0 key s:password [2]
                   iwconfig wlan0 key [2]
                   iwconfig wlan0 key open
                   iwconfig wlan0 key off
                   iwconfig wlan0 key restricted [3] 0123456789
                   iwconfig wlan0 key 01-23 key 45-67 [4] key [4]
power period|timeout|saving sss[m] |
     
all|unicast
manipulate power management scheme parameters and mode. Append m for values in milliseconds
period between wake ups, timeout before going back to sleep, saving the generic level of power; min and max modifiers.
times, those values are without units (number of beacon periods, dwell, percentage or similar). off and on disable and reenable power management.
set the power management mode to all (receive all packets), unicast (receive unicast packets only, discard multicast and broadcast) and multicast (receive multicast and broad- cast only, discard unicast packets). Examples :
                   iwconfig wlan0 power period 2
                   iwconfig wlan0 power 500m unicast
                   iwconfig wlan0 power timeout 300u all
                   iwconfig wlan0 power saving 3
                   iwconfig wlan0 power off
                   iwconfig wlan0 power min period 2 power max period 4
modu[lation] auto| modula Force the card to use a specific set of modulations.
Examples :
                   iwconfig wlan0 modu 11g
                   iwconfig wlan0 modu CCK OFDMa
                   iwconfig wlan0 modu auto

Display

For each device which supports wireless extensions, iwconfig will display the name of the MAC protocol used (name of device for proprietary protocols), the ESSID (Network Name), the NWID, the frequency (or channel), the sensitivity, the mode of operation, the Access Point address, the bit-rate, the RTS threshold, the fragmentation threshold, the encryption key and the power management settings (depending on availability).
See
cat /proc/net/wireless
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
 wlan0: 0000   53.  -57.  -256        0      0      0      4      0        0
Some parameters have two modes (such as bitrate).
If the value is prefixed by `=', it means that the parameter is fixed and forced to that value,
if it is prefixed by `:', the parameter is in automatic mode and the current value is shown (and may change).

Access Point/Cell An address of 00:..:00 means that the card failed to associate with an Access Point
Access Point parameter will be shown as Cell in ad-hoc mode If /proc/net/wireless hardware specifics, so you need to refer to your driver documentation for proper interpretation of those values.
Link quality Overall quality of the link. May be based on the level of contention or interference, the bit or frame error rate, how good the received signal is, some timing synchronisation, or other hardware metric. This is an aggregate value,
Signal level Received signal strength (RSSI - how strong the received signal is). (see iwspy
Noise level Background noise level (when no packet is transmitted).
Rx invalid nwid packets received with a different NWID or ESSID.
Used to detect configuration problems or adjacent network existence (on the same frequency).
Rx invalid crypt packets that the hardware was unable to decrypt.
Rx invalid frag packets for which the hardware was not able to properly re-assemble the link layer fragments
Tx excessive retries Number of packets that the hardware failed to deliver. Most MAC protocols will retry the packet a number of times before giving up.
Invalid misc Other packets lost in relation with specific wireless operations.
Missed beacon Number of periodic beacons from the Cell or the Access Point we have missed. Beacons are sent at regular intervals to maintain the cell coordination, failure to receive them usually indicates that the card is out of range.
hostname
pi93graf:

sudo iwlist wlan0 scan   reformatted
wlan0     Scan completed :
 Cell 01 - Address: 20:C0:47:C2:A8:A6
                    Channel:11   Frequency:2.462 GHz (Channel 11)
                    Quality=45/70  Signal level=-65 dBm  
                    Encryption key:on
  ESSID:"disabled"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s 24 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master Extra:tsf=0000000000000000
                    Extra: Last beacon: 10ms ago
                    IE: Unknown: 000864697361626C6564 IE: Unknown: 010882848B962430486C
                    IE: Unknown: 03010B               IE: Unknown: 050400010000
                    IE: Unknown: 0706555320010B1E     IE: Unknown: 2A0100
                    IE: Unknown: 32040C121860
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 0B0505003F0000      IE: Unknown: 46050300000000
                    IE: Unknown: 2D1AAD091BFFFFFF0000000000000000000000000000000000000000
                    IE: Unknown: 3D160B080400000000000000000000000000000000000000
                    IE: Unknown: 7F080400080000000040
                    IE: Unknown: DD310050F204104A000110104400010210470010FF8AB30B943BEBD7CD
                                 1E40346192D2BD103C0001031049000600372A000120
                    IE: Unknown: DD090010180205001C0000
                    IE: Unknown: DD180050F2020101840003A4000027A4000042435E0062322F00
 Cell 02 - Address: B0:4E:26:48:C5:F9
                    Channel:2 Frequency:2.417 GHz (Channel 2)
                    Quality=19/70  Signal level=-91 dBm  
                    Encryption key:off
  ESSID:"TP-Link_Extender"          --- Halls  ugly i.e. now encrypt
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 9 Mb/s 18 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 12 Mb/s; 24 Mb/s; 48 Mb/s
                    Mode:Master Extra:tsf=0000000000000000
                    Extra: Last beacon: 10ms ago
                    IE: Unknown: 001054502D4C696E6B5F457874656E646572 IE: Unknown: 010882848B961224486C
                    IE: Unknown: 030102                              IE: Unknown: 32040C183060
                    IE: Unknown: 33082001020304050607
                    IE: Unknown: 33082105060708090A0B                IE: Unknown: 050400010000
                    IE: Unknown: 2A0104
                    IE: Unknown: 2D1AEE1117FFFF000001000000000000000000000000000000000000
                    IE: Unknown: 3D1602050600000000000000000000000000000000000000
                    IE: Unknown: 4A0E14000A002C01C800140005001900
                    IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
                    IE: Unknown: 0B05010000127A IE: Unknown: DD07000C4303000000
 Cell 03 - Address: F4:F2:6D:A5:20:16
                    Channel:6 Frequency:2.437 GHz (Channel 6)
                    Quality=70/70  Signal level=-28 dBm  
                    Encryption key:on
  ESSID:"TP-LINK_A52016"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s 9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master Extra:tsf=0000000000000000
                    Extra: Last beacon: 10ms ago
                    IE: Unknown: 000E54502D4C494E4B5F413532303136        IE: Unknown: 010882848B960C121824
                    IE: Unknown: 030106                                  IE: Unknown: 2A0101
                    IE: Unknown: 32043048606C
                    IE: Unknown: 2D1A6E101EFFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D1606050300000000000000000000000000000000000000
                    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: DD180050F2020101000003A4000027A4000042435E0062322F00
                    IE: Unknown: DD1E00904C336E101EFFFF000000000000000000000000000000000000000000
                    IE: Unknown: DD1A00904C3406050300000000000000000000000000000000000000
                    IE: Unknown: DD0600E04C0201E0
 Cell 04 - Address: FC:3F:DB:DF:5E:5C
                    Channel:11 Frequency:2.462 GHz (Channel 11)
                    Quality=16/70  Signal level=-94 dBm  
                    Encryption key:on
  ESSID:"DIRECT-5A-HP ENVY 7640 series"
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master Extra:tsf=0000000000000000
                    Extra: Last beacon: 10ms ago
                    IE: Unknown: 001D4449524543542D35412D485020454E5659203736343020736572696573
                    IE: Unknown: 01088C129824B048606C
                    IE: Unknown: 03010B                                      IE: Unknown: 200100
                    IE: Unknown: 23021400
                    IE: Unknown: 2A0100
                    IE: Unknown: 2F0100
                    IE: IEEE 802.11i/WPA2 Version 1 Group Cipher : CCMP Pairwise Ciphers (1) : CCMP Authentication Suites (1) : PSK
                    IE: Unknown: 2D1A20001AFF00000000000000000000000000000000000000000000
                    IE: Unknown: 3D160B080000000000000000000000000000000000000000
                    IE: Unknown: DD090010180200000C0000
                    IE: Unknown: DD180050F202010188000364000027A4000041435E0061322F00
                    IE: Unknown: DD9E0050F204104A000110104400010210570001011041000100103B00010
                                    3104700101C852A4DB8001F08ABCDFC3FDBDF5E5910210002485010230001
                                    30102400013010420001301054000800030050F20400051011001D4449524
                                    543542D35412D485020454E56592037363430207365726965731008000200
                                    001049000600372A00012010490017000137100600101C852A4DB8001F08ABCDFC3FDBDF5E59
                    IE: Unknown: DD5F080009000400000007010201000311454E56592037363430207365726
                                    96573000405373634350005105448363235335330394D3036353100000610
                                    1C852A4DB8001F08ABCDFC3FDBDF5E590704C0A80113080200D4090200080A0400000001 
wlan0     IEEE 802.11  ESSID:"disabled"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: 20:C0:47:C2:A8:A6   
          Bit Rate=65 Mb/s   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=44/70  Signal level=-66 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:307  Invalid misc:0   Missed beacon:0

lo        no wireless extensions.


iwspy

Get wireless statistics from specific nodes

Not on raspberry Pi Zero or 3B+ iwspy [interface]
iwspy interface [+] dnsname | ipaddr | MAC [
iwspy interface off
iwspy interface setthr low high
iwspy interface getthr
set a list of addresses to monitor in a wireless network interface and to read back quality of link information from /proc/net/wireless : quality of the link, signal strength… up to 8 addresses .
dnsname | ipaddr|MAC translation of ip addr is through ARP. If not present ping and retry.
+ Add
off
setthr Set the low and high signal strength threshold for the iwspy event
When time the signal strength a Wireless Event will be generated.
getthr Retrieve the current low and high signal strength threshold for the iwspy event.


iwgetid

Report ESSID, NWID or AP/Cell Address

iwgetid [--raw] [--scheme] [--ap] [--freq] [--mode] [--protocol] [--channel] [interface]

Output NWID, ESSID or AP/Cell Address of the wireless network that is currently used. The information is the as shown by iwconfig, but is easier to integrate in scripts.
Default, outputs the ESSID or NWID.
Default formatting is pretty-print.

wlan0     ESSID:"home-wifi"
--raw disables pretty-printing
--schemedisables pretty-printing and removes characters that are not alphanumerics.
 
--ap Display MAC address of the Access Point or the Cell.
--freq
iwgetid --freq                    iwgetid --freq --raw      iwgetid --freq --scheme
wlan0     Frequency:2.462 GHz     2.462e+09                freq2.462e+09
--channel
iwgetid -c                        iwgetid -c -r            iwgetid -c -s    
wlan0     Channel:11              11                      channel11
       
--mode
iwgetid --mode                     iwgetid --mode --raw    iwgetid --mode --scheme
wlan0     Mode:Managed             2                        Managed 
--protocol
iwgetid -p                               iwgetid -p -r    iwgetid -p -s
wlan0     Protocol Name:"IEEE 802.11"   IEEE 802.11       IEEE80211


iwpriv

configure optionals (private) parameters of a wireless network interface

iwpriv [interface]
iwpriv interface private-command [private-parameters]
iwpriv interface private-command [I] [private-parameters]
iwpriv interface --all
Not available on raspberry Pi Zero W

companion to iwconfig, deals with parameters and setting specific to each driver (iwconfig deals with generic ones).

Without arguments, list the available private commands available

private-command [private-parameters] Execute the specified private-command on the interface. The command may optionally take or require arguments, and may display information. Therefore, the command line parameters may or may not be needed and should match the command expectations. The list of commands that iwpriv displays (when called without argument) should give you some hints about those parameters. However you should refer to the device driver documentation for information on how to properly use the command and the ef- fect.
private-command [I] [private-parameters] I passed to the command as a Token Index.
-a/--all Execute and display all the private commands that don't take arguments
Example:
 wlan0      Available private ioctl :
  setqualthr (89F0) : set   1 byte & get   0
  gethisto   (89F7) : set   0      & get  16 int
This indicate that you may set the quality threshold and display an histogram of up to 16 values with :
iwpriv wlan0 setqualthr 20
iwpriv wlan0 gethisto

Files

 /proc/net/wireless 
See rfkill