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
9 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
8 min read
iptables-save command in Linux with examples
The information transfer from a remote computer to your local computer and the vice-versa are viewed as the transfer of data packets by the firewall. The firewall has the control of data packets that are both incoming and outgoing.iptables is a utility to create a rule-based firewall that is pre-ins
3 min read
iwconfig command in Linux with Examples
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 int
5 min read
join Command in Linux
The 'join' command in UNIX is a powerful command-line utility that allows you to merge lines from two files based on a common field, effectively combining related data into a more meaningful format. For instance, if you have one file with names and another with IDs, the join command can combine thes
7 min read
journalctl Command in Linux with Examples
The `journalctl` command is part of the systemd suite of utilities and is used to query and display log messages from the systemd journal. The systemd journal is a centralized logging system that collects and stores log data from various sources, including system services, kernel events, and user ap
7 min read
How to Kill a Process in Linux | Kill Command
kill command in Linux (located in /bin/kill), is a built-in command which is used to terminate processes manually. kill command sends a signal to a process that terminates the process. If the user doesn't specify any signal that is to be sent along with the kill command, then a default TERM signal i
6 min read
last command in Linux with Examples
The 'last' command in Linux is a powerful utility used to display a list of all users who have logged in and out since the creation of the '/var/log/wtmp' file. It provides a chronological view of user sessions, allowing administrators to monitor user activity, troubleshoot issues, and manage system
5 min read
less command in Linux with Examples
The 'less' command in Linux is an indispensable utility for browsing the contents of text files interactively. Unlike traditional text editors, 'less' allows you to view text files page by page without loading the entire file into memory. This approach not only speeds up the file loading process, es
5 min read
let command in Linux with Examples
The `let` command in Linux is a powerful tool used for evaluating arithmetic expressions on shell variables. It supports various operators and functionalities to perform calculations and manipulate values. Syntax of `let` command in Linux The basic syntax of the `let` is as follows. let [expression]
3 min read
ln command in Linux with Examples
The 'ln' command in Linux is a powerful utility that allows you to create links between files. These links can either be hard links or soft (symbolic) links. If you're unfamiliar with these concepts, check out our detailed guide on Hard and Soft Links in Linux to understand their differences, use ca
3 min read
locate command in Linux with Examples
locate command in Linux is used to find the files by name. There are two most widely used file-searching utilities accessible to users called to find and locate. The locate utility works better and faster than the find command counterpart because instead of searching the file system when a file sear
7 min read
look command in Linux with Examples
The look command in Linux is used to display lines that begin with a specified string. It is especially useful for searching through large files or lists, as it helps you locate entries efficiently. By default, the look command performs case-insensitive matches and searches for exact prefixes. The l
3 min read
How to List All Block Devices in Linux | lsblk Command
Understanding the storage devices connected to your Linux system is crucial for efficient system management. The 'lsblk' command, short for "list block devices," is a powerful tool that provides detailed information about block devices such as hard drives, solid-state drives, and other storage-relat
7 min read
lshw command in Linux with Examples
The 'lshw' (List Hardware) command in Linux/Unix is a powerful tool for extracting detailed information about the system's hardware configuration. This tool retrieves data from files in the '/proc' directory and is capable of reporting on a wide array of components, including memory configuration, C
3 min read
lsmod command in Linux with Examples
lsmod command is used to display the status of modules in the Linux kernel. It results in a list of loaded modules. lsmod is a trivial program which nicely formats the contents of the /proc/modules, showing what kernel modules are currently loaded. Syntax: lsmod Example: Run lsmod at the command lin
1 min read
How to List Open Files in Linux | lsof Command
In the world of Linux, understanding and managing open files is crucial for system administrators and users alike. The Linux operating system provides a powerful utility called lsof (List Open Files) that allows users to gain insights into the files currently open on their system. In this article, w
7 min read