IWCONFIG(8)

๐Ÿ’– iwconfig โ€” configure a wireless network interface ๐Ÿ’–

okay bestie, welcome to iwconfig(8) from the Linux Programmer's Manual โ€” yes it's section 8, yes it's a sysadmin thing, no it's not scary, sit down, I got you. ๐Ÿซถ


โœจ NAME โœจ

iwconfig โ€” configure a wireless network interface ๐Ÿฆ‹


โœจ SYNOPSIS โœจ

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]
iwconfig --help
iwconfig --version

literally just iwconfig with no args and it tells you about your wireless interfaces, that's the vibe. ๐ŸŒธ


โœจ DESCRIPTION โœจ

So. iwconfig is like ifconfig(8)'s wireless little sibling โ€” same energy, but it only cares about the wireless-specific stuff. ๐Ÿ’… It sets the parameters of a network interface that are specific to wireless operation (for example: the frequency). And it doesn't just set them โ€” it can also display those parameters, plus the wireless statistics (which it pulls straight out of /proc/net/wireless). ๐ŸŽ€

Now here's the important tea: all of these parameters and statistics are device dependent. Every driver only gives you some of them, depending on what the hardware actually supports, and the range of values can change too. So please, bestie, refer to the man page of each device for details. No cap. ๐Ÿ™ˆ


โœจ PARAMETERS โœจ

Alright, buckle up, here's every single one. ๐Ÿ‘‘


๐ŸŒธ essid

Set the ESSID (or Network Name โ€” some products call it Domain ID, same thing, don't let it confuse you). The ESSID is what identifies cells that are part of the same virtual network. ๐Ÿฆ‹

As opposed to the AP Address or NWID โ€” which define a single cell โ€” the ESSID defines a group of cells connected via repeaters or infrastructure, where the user may roam transparently. โœจ

With some cards, you may disable the ESSID checking (ESSID promiscuous) with off or any (and on to reenable it).

Heads up bestie: if the ESSID of your network is one of the special keywords (off, on or any), you should use -- to escape it. Otherwise the shell-adjacent parser situation gets messy. ๐Ÿ˜ญ

Examples:

iwconfig eth0 essid any
iwconfig eth0 essid "My Network"
iwconfig eth0 essid -- "ANY"

๐ŸŒธ nwid

Set the Network ID. Since all adjacent wireless networks share the same medium, this parameter is how you differentiate them (create logical colocated networks) and identify nodes belonging to the same cell. ๐Ÿ’ซ

Note: this parameter is only used for pre-802.11 hardware โ€” the 802.11 protocol uses the ESSID and AP Address for this function instead. So if you're on modern gear, this is giving vintage. ๐Ÿ‘‘

With some cards, you may disable the Network ID checking (NWID promiscuous) with off (and on to reenable it).

Examples:

iwconfig eth0 nwid AB34
iwconfig eth0 nwid off

๐ŸŒธ nick[name]

Set the nickname, or the station name. Some 802.11 products do define it, but honestly? As far as the protocols (MAC, IP, TCP) are concerned this is completely useless as far as configuration goes. Only some wireless diagnostic tools may use it. ๐ŸŽ€

It's decorative. It's a vibe. It's not doing anything. ๐Ÿ’…

Example:

iwconfig eth0 nickname "My Linux Node"

๐ŸŒธ mode

Set the operating mode of the device, which depends on the network topology. The mode can be: ๐Ÿฆ‹

  • Ad-Hoc โ€” network composed of only one cell and without Access Point
  • Managed โ€” node connects to a network composed of many Access Points, with roaming
  • Master โ€” the node is the synchronisation master or acts as an Access Point
  • Repeater โ€” the node forwards packets between other wireless nodes
  • Secondary โ€” the node acts as a backup master/repeater
  • Monitor โ€” the node is not associated with any cell and passively monitor all packets on the frequency
  • Auto

Example:

iwconfig eth0 mode Managed
iwconfig eth0 mode Ad-Hoc

๐ŸŒธ freq/channel

Set the operating frequency or channel in the device. Here's the decoder ring, bestie: ๐Ÿ”‘

  • A value below 1000 indicates a channel number
  • A value greater than 1000 is a frequency in Hz

You may append the suffix k, M or G to the value (for example, "2.46G" for 2.46 GHz frequency), or just add enough '0'. โœจ

Channels are usually numbered starting at 1, and you may use iwlist(8) to get the total number of channels, list the available frequencies, and display the current frequency as a channel. ๐ŸŒˆ

Depending on regulations, some frequencies/channels may not be available. Blame your local regulator, not me. ๐Ÿ’€

When using Managed mode, most often the Access Point dictates the channel and the driver may refuse the setting of the frequency. In Ad-Hoc mode, the frequency setting may only be used at initial cell creation, and may be ignored when joining an existing cell. ๐Ÿ˜ญ

You may also use off or auto to let the card pick up the best channel (when supported).

Examples:

iwconfig eth0 freq 2422000000
iwconfig eth0 freq 2.422G
iwconfig eth0 channel 3
iwconfig eth0 channel auto

๐ŸŒธ ap

Force the card to register to the Access Point given by the address, if it is possible. This address is the cell identity of the Access Point, as reported by wireless scanning, which may be different from its network 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). It's doing its own thing, respectfully. ๐Ÿ’…

You may also use off to re-enable automatic mode without changing the current Access Point, or you may use any or auto to force the card to reassociate with the currently best Access Point. ๐Ÿ”ฅ

Example:

iwconfig eth0 ap 00:60:1D:01:23:45
iwconfig eth0 ap any
iwconfig eth0 ap off

๐ŸŒธ rate/bit[rate]

For cards supporting multiple bit rates, set the bit-rate in b/s. The bit-rate is the speed at which bits are transmitted over the medium โ€” and bestie, the user speed of the link is lower, due to medium sharing and various overhead. That's just how it is. ๐ŸŽ€

You may append the suffix k, M or G to the value (decimal multiplier: 10^3, 10^6 and 10^9 b/s), or add enough '0'. Values below 1000 are card specific, usually an index in the bit-rate list. ๐Ÿ“‹

Use auto to select automatic bit-rate mode (fallback to lower rate on noisy channels), which is the default for most cards, and fixed to revert back to fixed setting. If you specify a bit-rate value and append auto, the driver will use all bit-rates lower and equal than this value. โœจ

Examples:

iwconfig eth0 rate 11M
iwconfig eth0 rate auto
iwconfig eth0 rate 5.5M auto

๐ŸŒธ txpower

For cards supporting multiple transmit powers, sets the transmit power in dBm. If W is the power in Watt, the power in dBm is:

P = 30 + 10.log(W)

math girlies rise up ๐Ÿงš If the value is postfixed by mW, it will be automatically converted to dBm. โœจ

In addition, on and off enable and disable the radio, and auto and fixed enable and disable power control (if those features are available). ๐Ÿ”ฅ

Examples:

iwconfig eth0 txpower 15
iwconfig eth0 txpower 30mW
iwconfig eth0 txpower auto
iwconfig eth0 txpower off

๐ŸŒธ sens

Set the sensitivity threshold. This defines how sensitive the card is to poor operating conditions (low signal, interference). ๐Ÿฆ‹

  • Positive values are assumed to be the raw value used by the hardware or a percentage
  • Negative values are assumed to be dBm

Depending on the hardware implementation, this parameter may control various functions. ๐Ÿ‘‘

On modern cards, this parameter usually controls the handover/roaming threshold โ€” the lowest signal level for which the hardware remains associated with the current Access Point. When the signal level goes below this threshold the card starts looking for a new/better Access Point. Some cards may use the number of missed beacons to trigger this. For high density of Access Points, a higher threshold makes sure the card is always associated with the best AP; for low density of APs, a lower threshold minimises the number of failed handoffs. ๐ŸŒˆ

On more ancient cards, this parameter usually controls the defer threshold โ€” the lowest signal level for which the hardware considers the channel busy. Signal levels above this threshold make the hardware inhibit its own transmission, whereas signals weaker than this are ignored and the hardware is free to transmit. This is usually strongly linked to the receive threshold, the lowest signal level for which the hardware attempts packet reception. Proper setting of these thresholds prevents the card from wasting time on background noise while still receiving weak transmissions. Modern designs seem to control those thresholds automatically. โœจ

Example:

iwconfig eth0 sens -80
iwconfig eth0 sens 2

๐ŸŒธ retry

Most cards have MAC retransmissions, and some allow you to set the behaviour of the retry mechanism. ๐ŸŽ€

  • To set the maximum number of retries, enter limit value. This is an absolute value (without unit), and the default (when nothing is specified).
  • To set the maximum length of time the MAC should retry, enter lifetime value. By default, this value is in seconds โ€” append the suffix m or u to specify values in milliseconds or microseconds.

You can also add the short, long, min and max modifiers. If the card supports automatic mode, they define the bounds of the limit or lifetime. Some other cards define different values depending on packet size โ€” for example in 802.11, min limit is the short retry limit (non RTS/CTS packets). ๐Ÿ‘€

Examples:

iwconfig eth0 retry 16
iwconfig eth0 retry lifetime 300m
iwconfig eth0 retry short 12
iwconfig eth0 retry min limit 8

๐ŸŒธ rts[_threshold]

RTS/CTS adds a handshake before each packet transmission to make sure that the channel is clear. ๐Ÿ’… This adds overhead, but increases performance in case of hidden nodes or a large number of active nodes. This parameter sets the size of the smallest packet for which the node sends RTS; a value equal to the maximum packet size disables the mechanism. You may also set this parameter to auto, fixed or off. ๐Ÿ”ฅ

Examples:

iwconfig eth0 rts 250
iwconfig eth0 rts off

okay that's part one bestie, and we are literally not even done โ€” there's more coming. stay tuned. ๐Ÿ’–

  • frag[mentation_threshold] โ€” okay so this one is about fragmentation, which is where an IP packet gets split into a burst of smaller fragments and yeeted onto the medium one at a time. Normally that's just extra overhead, ngl, but in a very noisy environment it lowkey saves you: it reduces the error penalty and lets packets sneak through interference bursts. This parameter sets the maximum fragment size, which is always lower than the maximum packet size. โœจ

This parameter can also control Frame Bursting on some cards โ€” that's the ability to send multiple IP packets together. That mechanism would be enabled if the fragment size is larger than the maximum packet size. ๐Ÿฆ‹

You may also set this parameter to auto, fixed or off.

Examples, bestie:

     iwconfig eth0 frag 512
     iwconfig eth0 frag off
  • key/enc[ryption] โ€” the one for manipulating encryption/scrambling keys and the security mode. ๐Ÿ”

To set the current encryption key, just type the key in hex digits as XXXX-XXXX-XXXX-XXXX or XXXXXXXX. To set a key other than the current one, prepend or append [index] to the key itself โ€” and heads up, this won't change which key is the active one. You can also enter the key as an ASCII string by using the s: prefix. Passphrase is currently not supported, periodt.

Wanna change which key is the currently active one? Just enter [index] with no key value at all.

off and on disable and reenable encryption.

The security mode may be open or restricted, and what it means depends on your card. With most cards, in open mode no authentication is used and the card may also accept non-encrypted sessions โ€” whereas in restricted mode only encrypted sessions are accepted and the card will use authentication if available.

If you need to set multiple keys, or set a key and change the active key, you need to use multiple key directives. Arguments can go in any order โ€” the last one takes precedence. ๐Ÿ‘‘

Examples:

     iwconfig eth0 key 0123-4567-89
     iwconfig eth0 key [3] 0123-4567-89
     iwconfig eth0 key s:password [2]
     iwconfig eth0 key [2]
     iwconfig eth0 key open
     iwconfig eth0 key off
     iwconfig eth0 key restricted [3] 0123456789
     iwconfig eth0 key 01-23 key 45-67 [4] key [4]
  • power โ€” for manipulating power management scheme parameters and mode. ๐Ÿ’ค

To set the period between wake ups, enter period value. To set the timeout before going back to sleep, enter timeout value. To set the generic level of power saving, enter saving value. You can also add the min and max modifiers. By default those values are in seconds โ€” append the suffix m or u to specify values in milliseconds or microseconds. Sometimes those values are without units at all (number of beacon periods, dwell, percentage or similar).

off and on disable and reenable power management. And finally, you may set the power management mode to all (receive all packets), unicast (receive unicast packets only, discard multicast and broadcast) and multicast (receive multicast and broadcast only, discard unicast packets).

Examples:

     iwconfig eth0 power period 2
     iwconfig eth0 power 500m unicast
     iwconfig eth0 power timeout 300u all
     iwconfig eth0 power saving 3
     iwconfig eth0 power off
     iwconfig eth0 power min period 2 power max period 4
  • modu[l]ation โ€” forces the card to use a specific set of modulations. ๐Ÿ“ก Modern cards support all kinds of modulations, some standard (like 802.11b or 802.11g) and some proprietary. This command forces the card to only use the specific set of modulations listed on the command line. It can be used to fix interoperability issues, fr fr.

The list of available modulations depends on the card/driver and can be displayed using iwlist modulation. Note that some card/driver may not be able to select each modulation listed independently โ€” some may come as a group. You may also set this parameter to auto and let the card/driver do its best. ๐Ÿซถ

Examples:

     iwconfig eth0 modu 11g
     iwconfig eth0 modu CCK OFDMa
     iwconfig eth0 modu auto
  • commit โ€” some cards may not apply changes done through Wireless Extensions immediately (they may wait to aggregate the changes, or apply them only when the card is brought up via ifconfig). This command (when available) forces the card to apply all pending changes. This is normally not needed, because the card will eventually apply the changes anyway, but it can be useful for debugging. ๐Ÿ›

๐ŸŒˆ DISPLAY ๐ŸŒˆ

For each device that 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, obviously ๐Ÿ’…).

The parameters displayed have the same meaning and values as the parameters you can set โ€” please refer to the previous part for a detailed explanation of them. (iykyk ๐Ÿ˜Œ)

Some parameters are only displayed in short/abbreviated form (such as encryption). You may use iwlist(8) to get all the details. โœจ

Some parameters have two modes (such as bitrate). If the value is prefixed by =, it means 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 equal to 00:00:00:00:00:00 means that the card failed to associate with an Access Point (most likely a configuration issue ๐Ÿ˜ญ). The Access Point parameter will be shown as Cell in ad-hoc mode (for obvious reasons), but otherwise works the same.


If /proc/net/wireless exists, iwconfig will also display its content. Note that those values will depend on the driver and the hardware specifics, so you need to refer to your driver documentation for proper interpretation of those values. ๐Ÿ“–

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, and depends totally on the driver and hardware.

Signal level

Received signal strength (RSSI โ€” how strong the received signal is). May be arbitrary units or dBm; iwconfig uses driver meta information to interpret the raw value given by /proc/net/wireless and display the proper unit or maximum value (using 8 bit arithmetic). In Ad-Hoc mode, this may be undefined and you should use iwspy. โš ๏ธ

Noise level

Background noise level (when no packet is transmitted). Similar comments as for Signal level. ๐ŸŒซ๏ธ

Rx invalid nwid

Number of packets received with a different NWID or ESSID. Used to detect configuration problems or adjacent network existence (on the same frequency).

Rx invalid crypt

Number of packets that the hardware was unable to decrypt. This can be used to detect invalid encryption settings. ๐Ÿ”

Rx invalid frag

Number of packets for which the hardware was not able to properly re-assemble the link layer fragments (most likely one was missing).

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. ๐Ÿ“ถ


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Jean Tourrilhes - jt@hpl.hp.com


๐ŸŽ€ FILES ๐ŸŽ€

/proc/net/wireless


๐ŸŒธ SEE ALSO ๐ŸŒธ

ifconfig(8), iwspy(8), iwlist(8), iwevent(8), iwpriv(8), wireless(7).


okay bestie that's the whole page ๐Ÿ’– this was wireless-tools, dated 30 March 2006, and you're reading IWCONFIG(8) โ€” go forth and configure those wireless extensions, you absolute icon ๐Ÿซถโœจ