iwconfig command in Linux with Examples
Last Updated :
15 Jan, 2024
Wireless networking plays a crucial role in modern computing, enabling devices to connect and communicate without the need for physical cables. In the Linux ecosystem, the iwconfig
command stands as a powerful tool for configuring and managing wireless network interfaces. This article will delve into the details of the iwconfig
command, covering its features, usage, and practical applications.
Understanding `iwconfig`
The iwconfig
command is part of the wireless-tools package in Linux and is used to configure and display information about wireless network interfaces. It provides a convenient way to view and modify wireless interface settings, such as network name (SSID), encryption keys, and transmission power. iwconfig may also be used to display the parameters, and the wireless statistics which are extracted from /proc/net/wireless.
Basic Syntax of iwconfig Command
The iwconfig
command in Linux follows a straightforward syntax that allows users to configure and display information about wireless network interfaces. Here's an overview of the basic syntax:
iwconfig [INTERFACE] [OPTIONS]
Here,
interface
: This is the wireless network interface that you want to configure or query. It could be something like wlan0
or wlp2s0
, depending on your system. If no interface is specified, iwconfig
will display information for all wireless interfaces.options
: These are various parameters and configurations that you can set or query for the specified wireless interface. Some common options include:
How to Check Wireless Intereface in Linux
Before diving into configuration, it's essential to identify the available wireless interfaces on your system. Execute the following command:

This will display a list of wireless interfaces along with their current configuration details.
To view detailed Information:
To obtain more detailed information about a specific wireless interface (e.g., wlp0s20f3), use:
iwconfig wlp0s20f3
checking detailed information of wireless network Configuring Wireless Interface using iwconfig
1. Setting the ESSID (Network Name)
essid : Set the ESSID (or Network Name - in some products it may also be called Domain ID).
iwconfig [Interface] essid "Your Network name"
--help : Displays help regarding iwconfig command, such as the different modes in the options.
iwconfig --help
2. Network ID Configuration (nwid
):
The nwid
option in iwconfig
allows you to set or disable the network ID. This can be useful for network identification purposes. Here is an example:
iwconfig [Interface] nwid on/off
3. Setting Nickname (nick
):
The nick
option is used to set the nickname or station name for a wireless interface. This can be handy for personalizing the identification of your device. Example:
iwconfig [Interface] nickname "My Node"
4. Operating Mode Configuration (mode
):
The mode
option in iwconfig
sets the operating mode of the wireless device based on the network topology. Modes can include Ad-Hoc, Managed, Master, Repeater, Secondary, and Monitor. Example:
iwconfig [Interface] mode Managed
hh
5. Frequency and Channel Configuration (freq/channel
):
The freq
and channel
options allow you to set the operating frequency or channel for the wireless device. Example:
iwconfig [Interface] freq 2.46000000
iwconfig [Interface] channel 3
6. Access Point Registration (ap
):
The ap
option in iwconfig
forces the wireless card to register with the Access Point specified by the address. Example:
iwconfig [Interface] ap 00:60:1D:01:23:45
7. Bitrate Configuration (rate
):
The rate
option is used to set the bitrate in bits per second for wireless cards that support it. Example:
iwconfig [Interface] rate 11M
8. Transmit Power Adjustment (txpower
):
The txpower
option in iwconfig
allows you to set the transmit power in dBm for wireless cards supporting multiple power levels. Example:
iwconfig [Interface] txpower 15
9. Sensitivity Threshold Configuration (sens
):
The sens
option sets the sensitivity threshold, defining how sensitive the wireless card is to poor operating conditions such as low signal or interference. Example:
iwconfig [Interface] sens -80
10. Maximum Retries Configuration (retry
):
The retry
option in iwconfig
sets the maximum number of times the MAC can retry transmission. Example:
iwconfig [Interface] retry 16
11. RTS Handshake Configuration (rts
):
The rts
option adds a handshake before each packet transmission to ensure that the channel is clear. Example:
iwconfig [[Interface] rts 250
12. Fragment Size Configuration (frag
):
The frag
option sets the maximum fragment size, always lower than the maximum packet size. Example:
iwconfig [Interface] frag 512
13. Encryption Key and Security Configuration (key/enc
):
The key
or enc
option is used to manipulate encryption or scrambling keys and security mode. Example:
iwconfig [Interface] key 0123-4567-89
14. Power Management Configuration (power
):
The power
option is used to manipulate power management scheme parameters and mode. Example:
iwconfig [Interface] power off
15. Modulation Configuration (modu
):
modu : This option is used to force the card to use a specific set of modulations. Example:
iwconfig [Interface] modu auto
16. Applying Changes (commit
):
commit : This option forces the card to apply all pending changes. Example:
iwconfig [Interface] commit
Conclusion
In this article we discussed wireless connections which are crucial for devices to talk to each other without using physical cables. In Linux, there's a handy tool called iwconfig
that helps manage these wireless connections. This article explores how iwconfig
works, explaining its features like changing network names, adjusting transmission power, and more. It breaks down the basic syntax of using iwconfig
, making it easier for users to configure their wireless settings. Whether you're setting up a nickname for your device or tweaking sensitivity levels, iwconfig
is a versatile tool that makes wireless networking in Linux a lot simpler.
Similar Reads
import command in Linux with Examples import command in Linux system is used for capturing a screenshot for any of the active pages we have and it gives the output as an image file. You can capture a single window if you want or you can take the entire screen or you can take a screenshot of any rectangular portion of the screen. Here, w
4 min read
info command in Linux with Examples info command reads documentation in the info format. It will give detailed information for a command when compared with the man page. The pages are made using the Texinfo tools which can link with other pages, create menus, and easy navigation. Here, we will explore the functionality of the info com
3 min read
insmod command in Linux with examples insmod command in Linux systems is used to insert modules into the kernel. Linux is an Operating System that allows the user to load kernel modules on run time to extend the kernel functionalities. LKMs(Loadable Kernel Modules) are usually used to add support for new hardware (as device drivers) and
3 min read
install command in Linux with examples The 'install' command in Linux is a versatile tool used for copying files and setting their attributes, such as permissions, ownership, and group. Unlike commands like 'cp' that simply copy files, 'install' allows you to fine-tune these settings, making it ideal for installation scripts or manual fi
3 min read
iostat command in Linux with examples The iostat command in Linux is used for monitoring system input/output statistics for devices and partitions. It monitors system input/output by observing the time the devices are active in relation to their average transfer rates. The iostat produce reports may be used to change the system configur
8 min read
iotop Command in Linux with Examples The 'iotop' command is a powerful Linux tool designed for monitoring disk Input/Output (IO) usage in real-time. It provides a comprehensive view of the current disk IO activities by processes, making it invaluable for system administrators who need to track down processes that are causing high disk
3 min read
ip Command in Linux with Examples The ip command in Linux is a powerful utility for network configuration and management. It allows users to interact with various networking components such as network interfaces, routing tables, addresses, and more. Here, we will look into the 'ip' command, covering each aspect with examples, code,
7 min read
ipcrm command in Linux with examples ipcrm command in Linux is used to remove some IPC(Inter-Process Communication) resources. It eliminates the IPC objects and their associated data structure form the system. One must be a creator or superuser or the owner of the object in order to remove these objects. There are three types of System
2 min read
'IPCS' command in Linux with examples ipcs shows information on the inter-process communication facilities for which the calling process has read access. By default, it shows information about all three resources: shared memory segments, message queues, and semaphore arrays. Without options, the information shall be written in short for
3 min read
iptables command in Linux with Examples The iptables command in Linux is a powerful tool that is used for managing the firewall rules and network traffic. It facilitates allowing the administrators to configure rules that help how packets are filtered, translated, or forwarded. On using this iptables, you can set up security policies to c
7 min read