iwconfig, iwlist and iwgetid
iwconfig is to Wi-Fi what ifconfig is to Ethernet: the classic Linux tool, still in a thousand tutorials, no longer installed by default and unable to handle anything newer than WEP. This page explains its output, then shows what to type instead.
Status
wireless-tools (iwconfig, iwlist, iwgetid, iwspy, iwpriv, iwevent) was written by Jean Tourrilhes at HP for the Wireless Extensions kernel API of the late 1990s. That API was frozen around 2008 and replaced by nl80211/cfg80211, driven by the iw command. Modern drivers still emulate the old API for compatibility, which is why iwconfig mostly works when installed, but:
- It cannot configure WPA or WPA2/WPA3 at all; only open networks and WEP. Connecting to any real network needs
wpa_supplicant,nmclioriwctl. - It knows nothing about 802.11n/ac/ax features, 6 GHz, mesh, P2P or multiple virtual interfaces.
- Some drivers report zeros or nonsense through the compatibility layer.
- Ubuntu, Debian, Fedora and Arch no longer install it by default; the package is
wireless-tools.
For seeing what you are connected to and how strong the signal is, it still works and is quick to read.
Reading iwconfig output
iwconfig
iwconfig wlan0wlan0 IEEE 802.11 ESSID:"HomeWiFi"
Mode:Managed Frequency:5.22 GHz Access Point: D4:6E:0E:11:22:34
Bit Rate=866.7 Mb/s Tx-Power=22 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=60/70 Signal level=-50 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:12 Missed beacon:0
eth0 no wireless extensions.
lo no wireless extensions.- IEEE 802.11
- The protocol family. Older output shows the letter (802.11abgn); newer drivers just say 802.11.
- ESSID:"HomeWiFi"
- The network name you are associated with.
ESSID:off/anymeans not associated. - Mode:Managed
- A normal client. Other modes: Master (access point), Ad-Hoc, Monitor (packet capture), Repeater, Secondary, Auto.
- Frequency:5.22 GHz
- The channel's centre frequency. 5.22 GHz is channel 44; 2.437 GHz is channel 6. Formula: 5 GHz channel = (MHz − 5000) / 5; 2.4 GHz channel = (MHz − 2407) / 5.
- Access Point: D4:6E:0E:11:22:34
- The BSSID, the MAC of the access point you are on.
Not-Associatedwhen disconnected. - Bit Rate=866.7 Mb/s
- Current negotiated PHY rate, not throughput. Expect real transfers at roughly half.
- Tx-Power=22 dBm
- Transmit power. 20 dBm is the usual EU limit on 2.4 GHz; 23 dBm on some 5 GHz bands.
- Power Management:on
- The card sleeps between beacons. Saves battery, adds latency; a common cause of laggy SSH sessions over Wi-Fi.
- Link Quality=60/70
- A driver-specific figure; for most Intel and Atheros drivers it is derived from signal level and 70 is the maximum.
- Signal level=-50 dBm
- Received signal strength. −30 to −50 excellent, −50 to −67 good, −67 to −75 fair, below −75 poor. Some drivers show a percentage or an arbitrary scale instead.
- Rx invalid nwid / crypt / frag
- Frames received from other networks on the same channel, frames the card could not decrypt, and fragments it could not reassemble. Counting up steadily with poor throughput suggests channel congestion.
- Tx excessive retries / Missed beacon
- Retries indicate interference or weak signal; missed beacons mean the AP's periodic announcements are not being heard, which precedes a disconnect.
- no wireless extensions.
- Not a wireless interface. Normal for eth0 and lo.
iwconfig settings (rarely appropriate today)
sudo iwconfig wlan0 essid "OpenCafe" # associate with an OPEN network (no WPA support)
sudo iwconfig wlan0 essid any
sudo iwconfig wlan0 mode Managed
sudo iwconfig wlan0 mode Monitor # capture mode; use 'iw dev wlan0 set type monitor' instead
sudo iwconfig wlan0 channel 6
sudo iwconfig wlan0 freq 5.22G
sudo iwconfig wlan0 ap D4:6E:0E:11:22:34 # pin to one BSSID
sudo iwconfig wlan0 rate 54M
sudo iwconfig wlan0 rate auto
sudo iwconfig wlan0 txpower 15
sudo iwconfig wlan0 power off # disable power saving
sudo iwconfig wlan0 power on
sudo iwconfig wlan0 key s:abcde # WEP only; obsolete and insecure
sudo iwconfig wlan0 key off
sudo iwconfig wlan0 rts 2347
sudo iwconfig wlan0 frag 2346
sudo iwconfig wlan0 nick "laptop"On a machine running NetworkManager, most of these are undone within seconds when NM reasserts its profile. Use the NetworkManager or iw equivalents below.
iwlist
sudo iwlist wlan0 scan # every network in range (root for a fresh scan)
sudo iwlist wlan0 scan | grep -E 'ESSID|Quality|Channel|Encryption'
iwlist wlan0 scan last # cached results without rescanning
iwlist wlan0 channel # channels/frequencies the card supports
iwlist wlan0 rate # supported bit rates
iwlist wlan0 txpower
iwlist wlan0 power
iwlist wlan0 encryption # WEP key sizes only
iwlist wlan0 event # wireless events the driver can reportwlan0 Scan completed :
Cell 01 - Address: D4:6E:0E:11:22:34
Channel:44
Frequency:5.22 GHz (Channel 44)
Quality=60/70 Signal level=-50 dBm
Encryption key:on
ESSID:"HomeWiFi"
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=0000004a2b1c3d4e
Extra: Last beacon: 120ms ago
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Cell 02 - Address: 3C:22:FB:AA:BB:CC
Channel:1
...Encryption key:on with an IE: IEEE 802.11i/WPA2 block means WPA2; Encryption key:on with no IE means WEP; Encryption key:off is an open network. iwlist shows WPA3 as WPA2 with an unfamiliar authentication suite, because it predates it.
iwgetid
The script-friendly one: prints just one value with no decoration.
iwgetid # wlan0 ESSID:"HomeWiFi"
iwgetid -r # HomeWiFi (raw: just the name)
iwgetid -a -r # D4:6E:0E:11:22:34 (access point MAC)
iwgetid -c -r # 44 (channel)
iwgetid -f -r # 5.22e+09 (frequency in Hz)
iwgetid -m -r # Managed (mode)
iwgetid -p -r # 1 (protocol)The rest of the family
| Tool | Purpose | Today |
|---|---|---|
iwevent | Print wireless events (associate, disassociate, scan complete) as they happen | iw event |
iwspy | Track signal from specific MAC addresses | iw dev wlan0 station dump |
iwpriv | Driver-private ioctls; each driver had its own | Driver-specific sysfs, iw vendor commands, or ethtool |
ifrename | Rename interfaces by MAC at boot | systemd .link files |
wpa_supplicant / wpa_cli | Not part of wireless-tools, but the thing that does WPA | Still current; used underneath NetworkManager |
iwconfig to iw and nmcli
| Task | wireless-tools | iw | NetworkManager |
|---|---|---|---|
| Current SSID, AP, signal, rate | iwconfig wlan0 | iw dev wlan0 link | nmcli dev wifi (the * row) |
| Just the SSID | iwgetid -r | iw dev wlan0 link | awk '/SSID/{print $2}' | nmcli -t -f active,ssid dev wifi | grep '^yes' |
| Scan | iwlist wlan0 scan | sudo iw dev wlan0 scan | nmcli dev wifi list --rescan yes |
| Channel / frequency | iwgetid -c | iw dev wlan0 info | nmcli -f CHAN dev wifi |
| Set channel (unassociated) | iwconfig wlan0 channel 6 | iw dev wlan0 set channel 6 | n/a (AP mode: wifi.channel) |
| Monitor mode | iwconfig wlan0 mode monitor | iw dev wlan0 set type monitor or iw phy phy0 interface add mon0 type monitor | nmcli dev set wlan0 managed no first |
| Tx power | iwconfig wlan0 txpower 15 | iw dev wlan0 set txpower fixed 1500 (mBm) | n/a |
| Power saving | iwconfig wlan0 power off | iw dev wlan0 set power_save off | nmcli con mod "X" wifi.powersave 2 |
| Connect (WPA2) | impossible | wpa_supplicant + dhclient | nmcli dev wifi connect "X" password "pw" |
| Card capabilities | iwlist wlan0 channel | iw list | nmcli -f WIFI-PROPERTIES dev show wlan0 |
| Regulatory domain | n/a | iw reg get / iw reg set GB | n/a |
| Interfaces | iwconfig | iw dev | nmcli dev status |
The full modern reference is on the Wi-Fi from the command line page.
Installing
sudo apt install wireless-tools # Debian, Ubuntu
sudo dnf install wireless-tools # Fedora
sudo pacman -S wireless_tools # Arch (note the underscore)
sudo apk add wireless-tools # Alpine
# iw (recommended instead)
sudo apt install iw / sudo dnf install iw / sudo pacman -S iwCommon errors
| Message | Meaning |
|---|---|
| iwconfig: command not found | wireless-tools not installed; use iw or install it |
| wlan0 no wireless extensions. | Not a wireless interface, or the driver does not implement the legacy API (some newer drivers). Try iw dev |
| Error for wireless request "Set ESSID" (8B1A): SET failed on device wlan0; Operation not permitted. | Not root, or NetworkManager owns the interface |
| Error for wireless request "Set Mode" (8B06): SET failed on device wlan0; Device or resource busy. | Interface is up; bring it down first (ip link set wlan0 down) and stop NetworkManager managing it |
| Interface doesn't support scanning : Network is down | Bring the interface up: sudo ip link set wlan0 up; check rfkill list |
| ESSID:off/any Access Point: Not-Associated | Not connected. Without WPA support iwconfig cannot connect you; use nmcli |
Related pages
- Wi-Fi from the command line (iw, nmcli, netsh wlan, wdutil)
- ifconfig, its wired sibling
- iw on the Linux tools page