Skip to content

iw

iw is the modern CLI for configuring wireless devices via nl80211 (replacement for most legacy iwconfig workflows).


Quick Basics

Show information about a Wi-Fi interface

iw dev wlp0s20f0u9u3 info

Show all wireless interfaces

iw dev

Show PHYs (radios) on the system

iw phy

Show supported features and commands

iw features
iw commands

Get help (global or per-command)

iw help
iw help dev
iw help phy

Scanning & Finding Channels

Scan and list SSID + channel (2.⅘ GHz)

iw dev wlp0s20f0u9u3 scan | awk '
/freq:/ {
    freq=$2
    if (freq >= 2412 && freq <= 2484)
        chan = int((freq - 2407) / 5)
    else if (freq >= 5000)
        chan = int((freq - 5000) / 5)
}
/SSID:/ {
    print $2 " | Channel: " chan
}
' | column -t

Dump last scan results (no active scan)

iw dev wlp0s20f0u9u3 scan dump

Trigger a scan (useful when dump is stale)

iw dev wlp0s20f0u9u3 scan trigger

Connect to an SSID

iw dev wlp0s20f0u9u3 connect -w <SSID>

Authenticate (low-level)

iw dev wlp0s20f0u9u3 auth <SSID> <bssid> <type:open|shared> <freq_mhz>

Disconnect from the Wi-Fi interface

iw dev wlp0s20f0u9u3 disconnect

Show current link status (connected BSSID, bitrate, signal, etc.)

iw dev wlp0s20f0u9u3 link

Dump station stats (signal, tx/rx rates, retries, etc.)

iw dev wlp0s20f0u9u3 station dump

CQM RSSI threshold notifications

iw dev wlp0s20f0u9u3 cqm rssi <threshold|off> [<hysteresis>]

Regulatory (Country) & Channel Lists

Show current regulatory domain

iw reg get

Set regulatory domain (ISO 3166-1 alpha2), e.g. Sweden = SE

iw reg set SE

Show allowed channels for a PHY

iw phy <phyname> channels

Change Channel / Frequency (No AP)

Switch interface to a channel

iw dev wlp0s20f0u9u3 switch channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons <count>] [block-tx]

Switch interface to a frequency (MHz)

iw dev wlp0s20f0u9u3 switch freq <freq_mhz> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons <count>] [block-tx]

Power / Bitrates / QoS-ish Knobs

Show / set power save

iw dev wlp0s20f0u9u3 get power_save
iw dev wlp0s20f0u9u3 set power_save <on|off>

Set TX power (device or PHY)

iw dev wlp0s20f0u9u3 set txpower <auto|fixed|limit> [<tx_power_mBm>]
iw phy <phyname> set txpower <auto|fixed|limit> [<tx_power_mBm>]

Set legacy/HT/VHT/HE rates (advanced)

iw dev wlp0s20f0u9u3 set bitrates legacy-2.4 1 2 5.5 11

AP Mode (SoftAP)

Start AP (syntax varies by kernel/iw; see iw help dev ap)

iw dev wlp0s20f0u9u3 ap start <SSID> <control_freq> <beacon_interval_TU> <DTIM_period> head <beacon_head_hex> [tail <beacon_tail_hex>]

Stop AP

iw dev wlp0s20f0u9u3 ap stop

Tip: iw can start/stop AP mode, but most real SoftAP setups also need hostapd + DHCP/NAT depending on your use-case.


Mesh / IBSS (Ad-hoc) / OCB

Join and leave a mesh

iw dev wlp0s20f0u9u3 mesh join <mesh_id> freq <freq_mhz>
iw dev wlp0s20f0u9u3 mesh leave

IBSS (ad-hoc) join/leave

iw dev wlp0s20f0u9u3 ibss join <SSID> <freq_mhz>
iw dev wlp0s20f0u9u3 ibss leave

Monitoring Events

Listen to nl80211 events (connect/disconnect/scan/etc.)

iw event -t


Channel Availability Check (DFS / CAC)

Trigger CAC on channel

iw dev wlp0s20f0u9u3 cac channel <channel> \
[NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz] \
[punct <bitmap>]

Trigger CAC on frequency

iw dev wlp0s20f0u9u3 cac freq <freq_MHz> \
[NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz] \
[punct <bitmap>]

Trigger CAC (control frequency + center freqs)

iw dev wlp0s20f0u9u3 cac freq <control_freq> \
[5|10|20|40|80|80+80|160|320] \
[<center1_freq> [<center2_freq>]] \
[punct <bitmap>]

Background CAC (non-blocking)

iw dev wlp0s20f0u9u3 cac background channel <channel>


Remain-On-Channel (ROC)

Remain on channel temporarily

iw dev wlp0s20f0u9u3 roc start <freq_MHz> <duration_ms>


Scheduled Scanning

Start scheduled scan

iw dev wlp0s20f0u9u3 scan sched_start \
interval <milliseconds> \
freqs <freq1> <freq2>

Stop scheduled scan

iw dev wlp0s20f0u9u3 scan sched_stop

Abort running scan

iw dev wlp0s20f0u9u3 scan abort


Mesh Path (MPATH) Management

Dump mesh paths

iw dev wlp0s20f0u9u3 mpath dump

Add mesh path

iw dev wlp0s20f0u9u3 mpath new <dest_MAC> next_hop <next_hop_MAC>

Delete mesh path

iw dev wlp0s20f0u9u3 mpath del <MAC>


Station Control

Show stations

iw dev wlp0s20f0u9u3 station dump

Get specific station

iw dev wlp0s20f0u9u3 station get <MAC>

Remove station

iw dev wlp0s20f0u9u3 station del <MAC>

Set station TX power

iw dev wlp0s20f0u9u3 station set <MAC> txpwr <auto|limit> [<dBm>]


Survey / Channel Utilization

Dump channel survey data

iw dev wlp0s20f0u9u3 survey dump


Vendor Commands

Send vendor command

iw dev wlp0s20f0u9u3 vendor send <oui> <subcmd> <file|-|hex>

Receive vendor command

iw dev wlp0s20f0u9u3 vendor recv <oui> <subcmd> <file|-|hex>


WoWLAN (Wake on WLAN)

Show WoWLAN capabilities

iw phy <phyname> wowlan show

Disable WoWLAN

iw phy <phyname> wowlan disable

Enable WoWLAN (basic magic packet)

iw phy <phyname> wowlan enable magic-packet


PHY-Level Tuning

Set antenna bitmap

iw phy <phyname> set antenna <tx_bitmap> <rx_bitmap>

Set RTS threshold

iw phy <phyname> set rts <threshold|off>

Set fragmentation threshold

iw phy <phyname> set frag <threshold|off>

Set retry limits

iw phy <phyname> set retry short <limit> long <limit>


Monitoring & Debugging

Listen for wireless events

iw event -t

List all PHY information

iw phy <phyname> info

List supported features

iw features

List supported commands

iw commands

General Help

Show help

iw help

Show help for specific command

iw help dev
iw help phy