Skip to content

iwconfig

72 commands

The legacy wireless-extensions tool for viewing and setting interface parameters like mode, channel and power. Prefer iw on modern systems.

  • Wi-Fi
  • configuration
  • legacy

Install iwconfig

sudo apt install wireless-tools

Basic Syntax2

iwconfig --help

Displays the help message listing all available command line parameters and arguments

iwconfig --version

Outputs the version of the wireless tools and the recommended kernel configuration

Interface Status2

iwconfig

Lists all network interfaces and displays wireless extension information for those that support it

iwconfig wlan0

Displays detailed wireless configuration and current status specifically for interface wlan0

ESSID Configuration3

iwconfig wlan0 essid "LabNetwork"

Configures the interface to connect to a network with the specific name LabNetwork

iwconfig wlan0 essid off

Disables the ESSID configuration allowing the driver to attempt association with any available network

iwconfig wlan0 essid any

Configures the interface to accept any ESSID which is useful for roaming or initial site surveys

Mode Management6

iwconfig wlan0 mode managed

Sets the interface to managed mode for standard client connection to an Access Point

iwconfig wlan0 mode monitor

Sets the interface to monitor mode for passive packet capture and security assessment

iwconfig wlan0 mode ad-hoc

Configures the interface for peer-to-peer communication without a central Access Point

Link
iwconfig wlan0 mode master

Attempts to set the interface to Master mode to act as an Access Point (driver dependent)

Link
iwconfig wlan0 mode repeater

Sets the interface to repeater mode to forward packets between other wireless nodes

Link
iwconfig wlan0 mode secondary

Configures the interface as a secondary backup master/repeater if supported by hardware

Link

Frequency Management4

iwconfig wlan0 channel 6

Forces the wireless interface to operate specifically on channel 6

Link
iwconfig wlan0 channel auto

Allows the driver to automatically select the best available channel

Link
iwconfig wlan0 freq 2.412G

Sets the operating frequency explicitly to 2.412 GHz (Channel 1)

Link
iwconfig wlan0 freq 5.220G

Sets the operating frequency explicitly to 5.220 GHz for 5GHz band operation

Link

Access Point Targeting3

iwconfig wlan0 ap 00:11:22:33:44:55

Forces the client to associate only with the Access Point matching the specified MAC address

Link
iwconfig wlan0 ap any

Removes specific AP locks and allows association with any AP responding to the ESSID

Link
iwconfig wlan0 ap off

Prevents the interface from associating with any Access Point

Link

Bitrate Configuration4

iwconfig wlan0 rate 54M

Sets the transmission bitrate to a fixed speed of 54 Megabits per second

Link
iwconfig wlan0 rate auto

Enables automatic rate scaling to adjust speed based on signal quality

Link
iwconfig wlan0 rate 11M fixed

Forces the card to use 11Mbps and prevents it from dropping to lower speeds

Link
iwconfig wlan0 rate 5.5M auto

Sets the maximum bitrate to 5.5Mbps but allows the driver to lower it if interference occurs

Link

Power Control4

iwconfig wlan0 txpower 30mW

Sets the transmission power output to exactly 30 milliwatts

Link
iwconfig wlan0 txpower 15

Sets the transmission power output to 15 dBm

Link
iwconfig wlan0 txpower auto

Allows the radio hardware to manage its own power output levels

Link
iwconfig wlan0 txpower off

Disables the radio transmitter completely effectively turning on airplane mode for that interface

Link

Power Management4

iwconfig wlan0 power on

Enables power management features allowing the card to sleep when idle to save battery

Link
iwconfig wlan0 power off

Disables power management forcing the card to stay awake for maximum performance

Link
iwconfig wlan0 power timeout 500ms

Sets the time the card waits before entering sleep mode to 500 milliseconds

Link
iwconfig wlan0 power period 2s

Sets the cycle period between wake-ups to 2 seconds

Link

Packet Handling4

iwconfig wlan0 rts 250

Sets the RTS/CTS handshake threshold to 250 bytes to reduce collisions in hidden node scenarios

Link
iwconfig wlan0 rts off

Disables the RTS/CTS mechanism entirely

Link
iwconfig wlan0 frag 512

Sets the fragmentation threshold to 512 bytes causing larger packets to be split

Link
iwconfig wlan0 frag off

Disables packet fragmentation ensuring packets are sent whole regardless of size

Link

Encryption Setup6

iwconfig wlan0 key off

Disables all WEP encryption keys on the interface

Link
iwconfig wlan0 key 0123-4567-89

Sets the WEP encryption key using hex digits

Link
iwconfig wlan0 key s:password

Sets the WEP encryption key using an ASCII string

Link
iwconfig wlan0 key open

Sets the authentication mode to Open System

Link
iwconfig wlan0 key restricted

Sets the authentication mode to Restricted (Shared Key) requiring a valid key to associate

Link
iwconfig wlan0 key [1] 0123456789

Sets the WEP key specifically for index slot 1

Link

Identity Configuration1

iwconfig wlan0 nick "MyNode"

Sets the station nickname used in some legacy diagnostics and protocols

Link

Retry Configuration3

iwconfig wlan0 retry 7

Sets the maximum number of retransmissions for a failed packet to 7

Link
iwconfig wlan0 retry short 4

Sets the retry limit specifically for packets smaller than the RTS threshold

Link
iwconfig wlan0 retry long 7

Sets the retry limit specifically for packets larger than the RTS threshold

Link

Sensitivity Tuning2

iwconfig wlan0 sens -80

Sets the signal sensitivity threshold to -80 dBm so signals weaker than this are ignored

Link
iwconfig wlan0 sens 2

Sets the sensitivity range to 2 which usually correlates to a percentage or hardware specific scale

Link

Modulation Control2

iwconfig wlan0 modu 11g

Forces the interface to use 802.11g modulation schemes

Link
iwconfig wlan0 modu auto

Allows the hardware to automatically select the best modulation modulation scheme

Link

Commit Changes1

iwconfig wlan0 commit

Forces the driver to apply pending configuration changes immediately

Link

Legacy NWID2

iwconfig wlan0 nwid 100

Sets the Network ID (Domain ID) for legacy pre-802.11 hardware grouping

Link
iwconfig wlan0 nwid off

Disables NWID checking allowing reception of packets from any domain

Link

Red Team Workflow3

iwconfig wlan0 mode monitor channel 6

Quickly sets the interface to monitor mode on a specific channel for targeted sniffing

Link
iwconfig wlan0 txpower 30mW key off

Boosts transmission power and clears encryption keys to prepare for injection attacks

Link
iwconfig wlan0 essid "FakeAP" mode master

Configures the interface to act as a rogue Access Point with a specific ESSID

Link

Blue Team Defense2

iwconfig wlan0 mode managed ap 00:11:22:33:44:55

Locks the defensive sensor to a specific AP BSSID to prevent unauthorized roaming

Link
iwconfig wlan0 rate 1M fixed

Forces a low fixed bitrate to maintain connectivity in high interference environments

Link

Purple Team Validation2

iwconfig wlan0 txpower 1mW

Lowers transmission power to the minimum to simulate a weak signal client at the edge of the cell

Link
iwconfig wlan0 rts 100 frag 256

Sets aggressive fragmentation thresholds to test how the AP handles fragmented packet reassembly

Link

Incident Response1

iwconfig wlan0 essid off key off mode managed

Rapidly neutralizes the interface configuration to disconnect from any potentially compromised network

Link

Automation Workflow1

iwconfig wlan0 channel 1 && iwconfig wlan0 channel 6

Chains commands to hop channels sequentially for manual coverage testing

Link

Troubleshooting1

iwconfig wlan0 power off retry 10

Disables power saving and increases retries to troubleshoot intermittent connection drops

Link

Diagnostics1

iwconfig wlan0 | grep "Link Quality"

Extracts just the link quality and signal level statistics from the status output

Link

Advanced Config2

iwconfig wlan0 enc 0123456789 [2]

Sets a WEP key specifically in slot 2 using the enc alias for key

Link
iwconfig wlan0 sens -60 retry short 2

Configures strict sensitivity and low retry counts for high-speed low-latency environment tuning

Link

Clean Up1

iwconfig wlan0 txpower auto rate auto

Resets power and rate settings to hardware defaults after testing

Link

Red Team Prep1

iwconfig wlan0 mode monitor frag off rts off

Prepares interface for raw packet injection by disabling packet modifying thresholds

Link

Ad-Hoc Setup1

iwconfig wlan0 mode ad-hoc essid "Mesh" channel 11

One-line configuration to establish a specific Ad-Hoc mesh cell on channel 11

Link

Signal Testing1

watch -n 1 iwconfig wlan0

Continuously updates the iwconfig status to monitor signal strength changes in real time

Link

Driver Reset1

iwconfig wlan0 essid ""

Clears the ESSID string to blank which forces some drivers to reset their association state

Link

Encryption Security1

iwconfig wlan0 key off enc off

Explicitly disables encryption using both key and enc aliases to ensure open mode

Link