1. Introduction
Having a clear understanding of the frequencies supported by a local wireless device can be essential for optimizing network performance and troubleshooting connectivity issues.
In this tutorial, we’ll learn how to find out a wireless card’s frequency in Linux. We’ll also explore the usage of various commands to obtain accurate information about the supported frequencies of the wireless interfaces.
2. Understanding Wireless Basics
Wireless standards refer to the specific protocols and technologies used for wireless communication between devices. These standards define how data is transmitted over the airwaves and include various features such as data rates, frequency bands, and modulation techniques.
Different wireless standards operate on different frequency bands, and the choice of frequency can significantly impact the performance and range of the wireless network.
2.1. Wireless Standards
Wireless standards are essential guidelines that determine how wireless technologies should operate. They ensure compatibility and efficiency in wireless networks.
Let’s take a look at the list of wireless standards and their respective supported frequency bands:
- IEEE 802.11b supports only the 2.4 GHz band
- IEEE 802.11g supports only the 2.4 GHz band
- IEEE 802.11n supports both the 2.4 GHz and 5 GHz bands, but it isn’t required by the specification to support 5 GHz
- IEEE 802.11a supports only the 5 GHz band
- IEEE 802.11ac supports the 5 GHz band and provides higher throughput compared to 802.11n
- IEEE 802.11ax Wi-Fi 6 supports both the 2.4 GHz and 5 GHz bands
Let’s explore what frequencies are.
2.2. Wireless Frequencies
Wireless communication takes place over radio frequencies, i.e., portions of the electromagnetic spectrum allocated for wireless devices. These frequencies are measured in Hertz (Hz) and are commonly expressed in Gigahertz (GHz) or Megahertz (MHz).
There are three common wireless frequencies for consumer wireless cards:
- 2.4 GHz is popular for both home and enterprise networks
- 5 GHz is newer and offers faster data rates than the 2.4 GHz band
- 6 GHz is a recently released band that offers even faster data rates than the 5 GHz band
At this point, 2.4 GHz can be a bit overcrowded, so there’s a risk of interference from other devices.
2.3. Wireless Channels
In wireless networks, the concept of channels is crucial in ensuring efficient communication and reducing interference. A wireless channel represents a specific range of frequencies within a frequency band that a wireless device uses to transmit and receive data.
By dividing the available frequency spectrum into multiple channels, it allows multiple devices to communicate simultaneously without causing interference between them.
For the 2.4 GHz band, there are typically 14 channels available, but not all regions allow the use of all channels due to regulatory restrictions.
On the other hand, the 5 GHz band offers a broader range of non-overlapping channels, making it better suited for high-density environments with multiple Wi-Fi networks. Depending on the regulatory domain and specific hardware capabilities, there can be up to 24 non-overlapping channels available in the 5 GHz band.
3. Using iw
iw is a command-line tool in Linux used to manage and configure wireless network interfaces. Moreover, iw provides information about wireless devices, their capabilities, and supported frequencies.
First, let’s install iw via apt-get:
$ sudo apt-get install iw
Then, we’ll check the wireless device list:
$ iw dev
phy#0
Interface wlxc4e98410a8de
ifindex 3
wdev 0x1
addr c4:e9:84:10:a8:de
type managed
txpower 20.00 dBm
The output shows details about the wireless interface including its identifier, MAC address, operating mode, and the transmission power level.
Here, phy#0 is an assigned name to the wireless device. Now, we’ll check the supported frequencies via that name:
$ sudo iw phy#0 info
Wiphy phy0
max # match sets: 0
Retry short limit: 7
Retry long limit: 4
Coverage class: 0 (up to 0m)
Device supports RSN-IBSS.
Device supports T-DLS.
...
Frequencies:
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
...
* 2472 MHz [13] (disabled)
* 2484 MHz [14] (disabled)
...
Unlike the previous example, we used sudo to make sure the output is complete and accurate. The output provides information about the specific wireless interface. Moreover, we can see a list of the supported frequencies and corresponding channel numbers for this interface.
4. Using iwconfig
iwconfig is a Linux utility for configuring and displaying information about wireless interfaces, their connection status, and associated settings such as frequency, signal level, and power management.
First, we’ll install iwconfig:
$ sudo apt-get install wireless-tools
iwconfig is part of the wireless-tools package.
Then, we can use iwconfig to list all wireless interfaces:
$ iwconfig
lo no wireless extensions.
ens33 no wireless extensions.
wlxc4e98410a8de IEEE 802.11 ESSID:"netbsd"
Mode:Managed Frequency:2.462 GHz Access Point: 14:91:82:C2:77:4B
Bit Rate=72.2 Mb/s Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=50/70 Signal level=-60 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:32 Missed beacon:0
wlxe46f13a77bff IEEE 802.11bgn ESSID:"netbsd" Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency:2.462 GHz Access Point: 14:91:82:C2:77:4B
Bit Rate:72.2 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality=3/100 Signal level=-72 dBm Noise level=0 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
As we can see, the wireless interface wlxe46f13a77bff is connected to a network with the ESSID network2020. Furthermore, we see the interface is operating on the 2.4 GHz frequency. The signal level is -60 dBm, indicating a good signal strength for the connection.
5. Using iwlist
Similar to iw, iwlist provides information about wireless interfaces and their properties, including the available frequencies of wireless networks. Moreover, iwlist enables users to scan and gather details about nearby Wi-Fi networks.
First, let’s install iwlist:
$ sudo apt-get install wireless-tools
Like iw, iwlist is also part of the wireless-tools package.
Then, we can use iwlist to list available frequencies of the specific wireless card by using the chan subcommand:
$ iwlist chan
lo no frequency information.
enp0s5 no frequency information.
wlxc4e98410a8de 11 channels in total; available frequencies :
Channel 01 : 2.412 GHz
Channel 02 : 2.417 GHz
Channel 03 : 2.422 GHz
...
Channel 11 : 2.462 GHz
Current Frequency:2.457 GHz (Channel 10)
wlxe46f13a77bff 13 channels in total; available frequencies :
Channel 01 : 2.412 GHz
Channel 02 : 2.417 GHz
Channel 03 : 2.422 GHz
...
Channel 11 : 2.462 GHz
Channel 12 : 2.467 GHz
Channel 13 : 2.472 GHz
Current Frequency:2.412 GHz (Channel 1)
The output shows the channels and frequencies of wireless interfaces. The available channels on a wireless interface depend on the supported wireless hardware and specific standards. Based on this information, we can deduce the frequency, even if it is not explicitly provided.
6. Using lshw
lshw is a command-line utility for displaying information about hardware components on a Linux system, including information about the CPU, memory, storage devices, and network interfaces. Moreover, we use lshw can check the wireless card information.
First, let’s install lshw:
$ sudo apt-get install lshw
Then, we’ll check detailed information about the network interfaces:
$ sudo lshw -c network
...
*-network:0
description: Wireless interface
physical id: 6
bus info: usb@1:1
logical name: wlxc4e98410a8de
serial: c4:e9:84:10:a8:de
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=ath9k_htc driverversion=5.15.0-76-generic firmware=1.4 ip=192.168.1.123 link=yes multicast=yes wireless=IEEE 802.11
*-network:1
description: Wireless interface
physical id: 7
bus info: usb@1:2
logical name: wlxe46f13a77bff
serial: e4:6f:13:a7:7b:ff
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=r8188eu driverversion=5.15.0-76-generic ip=192.168.1.103 multicast=yes wireless=IEEE 802.11bgn
Here, we again utilized sudo to ensure the output doesn’t omit important data. The output provides information about the wireless standards supported by each interface.
In particular, the first wireless interface wlxc4e98410a8de supports the general IEEE 802.11 standard, which doesn’t specify a particular letter code for the supported standard. On the other hand, the second wireless interface wlxe46f13a77bff supports the IEEE 802.11bgn standard, which includes support for 802.11n and, consequently, operates on both the 2.4GHz and 5GHz frequency bands.
Notably, the accuracy of lshw isn’t always guaranteed due to potential issues detecting the correct driver or reflecting the latest changes in the wireless card.
7. Conclusion
In this article, we explored several commands in Linux that provide insights into the supported frequencies of the wireless interfaces.
Firstly, we used iw to check the wireless list and find the supported frequencies and corresponding channel numbers for a specific interface.
Secondly, iwconfig provided detailed information about wireless cards, including frequency, signal level, and power management.
Thirdly, we utilized iwlist to gather the available frequency information.
Lastly, lshw offered a comprehensive overview of network interfaces, highlighting the supported wireless standards.