iwconfig command in Linux with Examples

iwconfig command in Linux is like ifconfig command, in the sense it works with kernel-resident network interface but it is dedicated to wireless networking interfaces only. It is used to set the parameters of the network interface that are particular to the wireless operation like SSID, frequency etc. iwconfig may also be used to display the parameters, and the wireless statistics which are extracted from /proc/net/wireless.

Syntax:

iwconfig [INTERFACE] [OPTIONS]

Example: Below command is used to display all the wireless interfaces.

Options:

  • essid : Set the ESSID (or Network Name – in some products it may also be called Domain ID).
    iwconfig [Interface] essid "Network name"

  • –help : Displays help regarding iwconfig command, such as the different modes in the options.
    iwconfig --help

  • nwid : This option sets the network ID, you may disable or enable the Network ID.

    Example:

    iwconfig [Interface] nwid on/off
  • nick : This option sets the nickname or the station name.

    Example:

    iwconfig [Interface] nickname "My Node"
  • mode : Set the operating mode of the device, which depends on the network topology. The modes can be Ad-Hoc, Managed, Master, Repeater, Secondary, and Monitor.

    Example:

    iwconfig [Interface] mode Managed
  • freq/channel: This option sets the operating frequency or channel in the device.

    Example:

    iwconfig [Interface] freq 2.46000000
    iwconfig [Interface] channel 3
  • ap : This option forces the card to register to the Access Point given by the address if it is possible.

    Example:

    iwconfig [Interface] ap 00:60:1D:01:23:45
  • rate : This option sets bitrate in b/s in supporting cards.

    Example:

    iwconfig [Interface] rate 11M
  • txpower : This option sets the transmit power in dBm for cards supporting multiple transmit powers.

    Example:

    iwconfig [Interface] txpower 15
  • sens : This option sets the sensitivity threshold. This defines how sensitive is the card to poor operating conditions (low signal, interference).

    Example:

    iwconfig [Interface] sens -80
  • retry : This option sets the maximum number of times the MAC can retry transmission.

    Example:

    iwconfig [Interface] retry 16
  • rts : This option adds a handshake before each packet transmission to make sure that the channel is clear.

    Example:

    iwconfig [[Interface] rts 250
  • frag : This option sets the maximum fragment size, which is always lower than the maximum packet size.

    Example:

    iwconfig [Interface] frag 512
  • key/enc : This option is used to manipulate encryption or scrambling keys and security mode.

    Example:

    iwconfig [Interface] key 0123-4567-89
  • power : This option is used to manipulate power management scheme parameters and mode.

    Example:

    iwconfig [Interface] power off
  • modu : This option is used to force the card to use a specific set of modulations.

    Example:

    iwconfig [Interface] modu auto
  • commit : This option forces the card to apply all pending changes.

    Example:

    iwconfig [Interface] commit


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.