Skip to content

iw

100 commands

The modern nl80211 tool for configuring Linux wireless devices: scan, set channels, switch modes and inspect capabilities.

  • Wi-Fi
  • configuration
  • Linux

Install iw

sudo apt install iw

Basic Syntax & Help2

iw help

Displays the summary of all available iw commands and usage syntax

iw --version

Prints the installed version of the iw tool

Wireless Device Enumeration3

iw list

Lists all physical wireless devices and details their hardware capabilities

iw dev

Lists all logical wireless interfaces currently recognized by the kernel

iw phy

Lists all physical wireless hardware (WPHY) present on the system

Interface Information2

iw dev <devname> info

Shows detailed configuration information for a specific wireless interface

Link
iw dev <devname> link

Displays current link status including connected SSID, frequency, and signal strength

Link

Scanning & Discovery7

iw dev <devname> scan

Initiates a standard active scan for available wireless networks

Link
iw dev <devname> scan passive

Performs a passive scan without sending probe requests to remain stealthy

Link
iw dev <devname> scan -u

Scans for networks and prints results with human-readable formatting

Link
iw dev <devname> scan freq <freq>

Scans only a specific frequency to save time and reduce noise

Link
iw dev <devname> scan ssid <ssid>

Initiates an active directed scan specifically for a target SSID

Link
iw dev <devname> scan dump

Displays the results of the most recent scan buffer without scanning again

Link
iw dev <devname> scan trigger

Triggers a background scan without immediately waiting for or printing results

Link

Interface Mode Management5

iw dev <devname> set type managed

Sets the interface to managed mode for standard client station operations

Link
iw dev <devname> set type monitor

Sets the interface to monitor mode for packet sniffing and traffic analysis

Link
iw dev <devname> set type ibss

Sets the interface to Ad-Hoc (IBSS) mode for peer-to-peer networking

Link
iw dev <devname> set type ap

Sets the interface to Access Point mode to broadcast a network

Link
iw dev <devname> set type wds

Sets the interface to Wireless Distribution System mode for bridging

Link

Virtual Interface Management3

iw phy <phyname> interface add <name> type <type>

Creates a new virtual interface on the specified physical hardware

Link
iw dev <devname> del

Deletes a specific virtual wireless interface from the system

Link
iw dev <devname> set name <newname>

Renames a wireless interface to a new custom identifier

Link

Frequency & Channel Control6

iw dev <devname> set freq <freq>

Forces the interface to listen or transmit on a specific frequency in MHz

Link
iw dev <devname> set channel <channel>

Sets the interface to a specific channel number on the 2.4GHz band

Link
iw dev <devname> set freq <freq> <width_type>

Sets frequency with a specific channel width for high throughput testing

Link
iw dev <devname> set freq <freq> HT20

Sets the frequency enforcing a standard 20MHz High Throughput width

Link
iw dev <devname> set freq <freq> HT40+

Sets the frequency enforcing 40MHz width with the secondary channel above

Link
iw dev <devname> set freq <freq> HT40-

Sets the frequency enforcing 40MHz width with the secondary channel below

Link

TX Power Configuration3

iw dev <devname> set txpower fixed <mBm>

Sets a fixed transmit power in millibels (2000 mBm = 20 dBm)

Link
iw dev <devname> set txpower auto

Allows the hardware to automatically manage transmit power levels

Link
iw dev <devname> set txpower limit <mBm>

Sets a maximum upper limit for transmit power output

Link

Regulatory Management2

iw reg get

Displays the current regulatory domain and frequency constraints

Link
iw reg set <ISO>

Sets the regulatory domain to a specific country code like US or JP

Link

Connection Management5

iw dev <devname> connect <SSID>

Attempts to connect to an open wireless network with the specified SSID

Link
iw dev <devname> connect <SSID> <freq>

Connects to a specific SSID on a forced frequency channel

Link
iw dev <devname> connect <SSID> key 0:<key>

Connects to a legacy WEP network using a specific key index

Link
iw dev <devname> disconnect

Disconnects the interface from the current Access Point

Link
iw dev <devname> auth <SSID>

Initiates authentication sequence without full association

Link

Station & Peer Inspection3

iw dev <devname> station dump

Dumps statistics for all currently connected stations or peers

Link
iw dev <devname> station get <mac>

Retrieves detailed signal and throughput stats for a specific station MAC

Link
iw dev <devname> station del <mac>

Forcibly removes a station from the driver's internal table

Link

Power Save Configuration3

iw dev <devname> get power_save

Checks the current power save mode status of the interface

Link
iw dev <devname> set power_save on

Enables power saving mode to conserve energy during inactivity

Link
iw dev <devname> set power_save off

Disables power saving to ensure maximum performance and consistent Rx/Tx

Link

Bitrate Configuration2

iw dev <devname> set bitrates legacy-2.4 <rates>

Forces the interface to use specific legacy 802.11b bitrates

Link
iw dev <devname> set bitrates ht-mcs-2.4 <indexes>

Restricts the interface to use specific HT MCS indexes on 2.4GHz

Link

Advanced Monitor Config5

iw dev <devname> set monitor none

Disables all specific monitor mode flags for a raw capture state

Link
iw dev <devname> set monitor fcsfail

Configures monitor mode to pass packets with bad checksums (FCS errors)

Link
iw dev <devname> set monitor control

Configures monitor mode to capture 802.11 control frames like RTS/CTS

Link
iw dev <devname> set monitor otherbss

Configures monitor mode to capture traffic from other BSSIDs

Link
iw dev <devname> set monitor cook

Enables cooked monitor mode where the hardware handles some processing

Link

Event Monitoring3

iw event

Monitors and displays wireless kernel events in real-time

Link
iw event -t

Monitors wireless events and prepends a timestamp to each line

Link
iw event -f

Monitors wireless events and prints full details for each event

Link

Mesh Networking3

iw dev <devname> mesh join <meshid>

Joins an 802.11s mesh network with the specified ID

Link
iw dev <devname> mesh leave

Leaves the currently joined mesh network

Link
iw dev <devname> mpath dump

Dumps the current mesh path routing table

Link

Ad-Hoc Networking2

iw dev <devname> ibss join <ssid> <freq>

Joins or creates an IBSS Ad-Hoc network on a specific frequency

Link
iw dev <devname> ibss leave

Leaves the current IBSS Ad-Hoc network

Link

4-Address Mode2

iw dev <devname> set 4addr on

Enables 4-address mode usually required for WDS bridging or virtualization

Link
iw dev <devname> set 4addr off

Disables 4-address mode returning to standard 3-address addressing

Link

PHY Configuration4

iw phy <phyname> set distance <dist>

Sets the coverage class distance in meters to adjust ACK timeouts

Link
iw phy <phyname> set netns <pid>

Moves the entire physical wireless card into a different network namespace

Link
iw phy <phyname> set rts <threshold>

Sets the RTS threshold to control collision avoidance for packet sizes

Link
iw phy <phyname> set frag <threshold>

Sets the fragmentation threshold to split large packets

Link

Advanced Vendor Commands1

iw dev <devname> vendor recvbin <oui> <subcmd>

Sends a vendor-specific command and receives binary output data

Link

Red Team Workflow5

iw dev <devname> set noack_map <map>

Sets the NoACK map to disable acknowledgments for specific traffic classes

Link
iw phy <phyname> interface add mon0 type monitor flags none

Creates a clean monitor interface with no filtering flags for full capture

Link
iw dev <devname> scan passive dump

Dumps scan results collected passively to avoid revealing presence

Link
iw dev <devname> set channel <chan> <width>

Locks monitor interface to channel 1 with 20MHz width for targeted sniffing

Link
iw dev <devname> scan trigger freq <freq>

Triggers a probe request flood on a single frequency by scanning repeatedly

Link

Blue Team Workflow4

iw dev <devname> station dump

Periodically dumps station info to detect rogue devices or unauthorized connections

Link
iw dev <devname> link

Verifies that the defensive sensor is connected to the correct secure SSID

Link
iw list

Audits supported ciphers and interface combinations to ensure hardware compliance

Link
iw reg get

Checks if the regulatory domain has been tampered with or misconfigured

Link

Purple Team Workflow4

iw phy <phyname> wowlan show

Inspects Wake-on-WLAN capabilities to test power management attacks

Link
iw dev <devname> get mesh_param

Audits mesh parameters to validate routing security settings

Link
iw dev <devname> survey dump

Dumps channel survey data to analyze noise floor and channel interference

Link
iw dev <devname> set type managed

Reverts monitor interface to managed to test defense recovery time

Link

Automation & Cleanup3

iw dev <devname> del

Removes temporary monitor interfaces created during the testing session

Link
iw dev <devname> set txpower auto

Resets transmit power to default hardware control after testing

Link
iw reg set 00

Resets regulatory domain to the world regulatory domain

Link

Advanced PHY Info2

iw phy <phyname> channels

Shows detailed frequency and channel mapping for the hardware

Link
iw phy <phyname> info

Displays exhaustive capabilities including VHT/HE support and antenna chains

Link

Access Point Config1

iw dev <devname> set channel <chan> <width> <center1> <center2>

Sets complex channel width with center frequencies for VHT AP setup

Link

Debugging1

iw dev <devname> dump

Dumps internal interface state for debugging driver issues

Link

Packet Injection Prep1

iw dev <devname> set type monitor flags fcsfail

Sets monitor mode and allows bad FCS frames to improve injection analysis

Link

Off-Channel Operation1

iw dev <devname> roc <freq> <time>

Remains on channel (ROC) for a specific duration in milliseconds

Link

Antenna Configuration1

iw phy <phyname> set antenna <bitmap> <bitmap>

Configures active TX and RX antennas using bitmaps

Link

Coexistence1

iw phy <phyname> set sar_specs <specs>

Configures Specific Absorption Rate (SAR) limitations

Link

Power Management1

iw dev <devname> set power_save_scheme <scheme>

Sets the specific power save scheme (1=min, 2=max)

Link

FT Roaming1

iw dev <devname> ft_auth <bssid> <over_ds>

Triggers Fast Transition (802.11r) authentication

Link

VLAN Config1

iw dev <devname> set vlan <vlanid>

Assigns a VLAN ID to the wireless interface packets

Link

Scanning Config1

iw dev <devname> scan abort

Aborts an ongoing scan operation immediately

Link

Peer Management1

iw dev <devname> peer dump

Dumps information about mesh peers

Link

Wiphy Params2

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

Sets the hardware retry limit for short and long packets

Link
iw phy <phyname> set temp_threshold <val>

Sets the temperature threshold for the wireless card

Link

Device Cleanup1

iw phy <phyname> interface add <name> type managed

Restores a standard managed interface after deleting a monitor interface

Link

End of Workflow1

iw dev <devname> disconnect

Final disconnect command to ensure clean state at end of lab

Link