iwconfig

From RaySoft

iwconfig is similar to ifconfig, but is dedicated to the wireless interfaces. It is used to set the parameters of the network interface which are specific to the wireless operation (for example : the frequency). iwconfig may also be used to display those parameters, and the wireless statistics.[1]

Documentation

Syntax

iwconfig INTERFACE [SUBCOMMAND]

Subcommands

ap ADDRESS
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.
essid ESSID
Set the ESSID. The ESSID is used to identify cells which are part of the same virtual network.
frag[mentation_threshold] FRAGMENTATION
FRAGMENTATION allows to split an IP packet in a burst of smaller fragments transmitted on the medium. In most cases this adds overhead, but in a very noisy environment this reduces the error penalty and allow packets to get through interference bursts. This parameter sets the maximum fragment size which is always lower than the maximum packet size.
freq FREQUENCY, channel CHANNEL
Set the operating FREQUENCY or CHANNEL in the device. 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 add enough '0'.
Channels are usually numbered starting at 1, and you may use iwlist 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.
key/enc[ryption] KEY
Used to manipulate encryption or scrambling KEY and security mode.
To set the current encryption key, just enter the key in hex digits as XXXX-XXXX-XXXX-XXXX or XXXXXXXX. To set a key other than the current key, prepend or append to the key itself. You can also enter the key as an ASCII string by using the s: prefix. Passphrase is currently not supported.
mode MODE
Set the operating MODE of the device, which depends on the network topology.
Ad-Hoc
The mode can be Ad-Hoc (network composed of only one cell and without Access Point)
Managed
The 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
nick[name] NICKNAME
Set the NICKNAME, or the station name. Some 802.11 products do define it, but this is not used as far as the protocols (MAC, IP, TCP) are concerned and completely useless as far as configuration goes. Only some wireless diagnostic tools may use it.
power PARAMETERS
Used to manipulate power management scheme PARAMETERS.
[min|max] period PERIOD
To set the PERIOD between wake ups. You can also add the min and max modifiers.
[min|max] timeout TIMEOUT
To set the TIMEOUT before going back to sleep. 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 (number of beacon periods, dwell or similar).
off and on disable and reenable power management. 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).
rate BITRATE, bit[rate] BITRATE
For cards supporting multiple BITRATE, set the bit-rate in b/s. The bit-rate is the speed at which bits are transmitted over the medium, the user speed of the link is lower due to medium sharing and various overhead.
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.
retry AMOUNT
Most cards have MAC retransmissions, and some allow to set the behaviour of the retry mechanism.
rts[_threshold] AMOUNT
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.
txpower AMOUNT
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). If the value is postfixed by mW, it will be automatically converted to dBm.

Examples

Set ESSID for eth1
iwconfig 'eth1' essid 'raysoft-wlan'
Set mode for eth1
iwconfig 'eth1' mode 'Managed'
Set nickname for eth1
iwconfig 'eth1' nickname 'oxygen'

References

  1. man 8 'iwconfig'