What are your wi-fi adapter capabilities?

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
3,230
Reaction score
2,977
Credits
28,392
This article is pet friendly, plant friendly and Ai free.

If Linux recognizes your wireless adapter, you can run a command called ...

Code:
iw list

But this can give out over 900 lines of information, most of which doesn't help very much.

So you can create this bash shell script. Maybe name it "get_wifi_info.sh

Code:
#!/bin/bash

# Extract and print supported ciphers
echo "Supported Encryption Ciphers:"
iw list | awk '/Supported Ciphers:/, /Supported interface modes:/' | grep -E '^\s+\*'

# Extract and print supported frequencies for 2.4GHz
echo "Supported Frequencies (2.4GHz):"
iw list | awk '/Frequencies:/,/Supported interface modes:/' | grep -E '^\s+\* [0-9]+\.[0-9]+ MHz' | awk '$2 < 5955'

# Extract and print supported frequencies for 5GHz
echo "Supported Frequencies (5GHz):"
iw list | awk '/Frequencies:/,/Supported interface modes:/' | grep -E '^\s+\* [0-9]+\.[0-9]+ MHz' | awk '$2 >= 5955'

# Extract and print supported bit rates for 2.4GHz
echo "Supported Bitrates (2.4GHz):"
iw list | awk '/Bitrates \(non-HT\):/, /Frequencies:/' | grep -E '^\s+\* [0-9]+\.[0-9]+ Mbps' | awk 'NR<=12'

# Extract and print supported bit rates for 5GHz
echo "Supported Bitrates (5GHz):"
iw list | awk '/Bitrates \(non-HT\):/, /Frequencies:/' | grep -E '^\s+\* [0-9]+\.[0-9]+ Mbps' | awk 'NR>12'

and run this instead, it will narrow down the information to something more useful.
(You have no idea how long it took me to figure that out).
Remember to make this file executable.

This will show you the encryption cipher types your wi-fi interface will support, the speeds (bitrates) it will support,
and the channels (frequencies) your adapter supports.

Note that any frequency lines that say "disabled" i.e.

Code:
                        * 5340.0 MHz [68] (disabled)
                        * 5360.0 MHz [72] (disabled)
                        * 5380.0 MHz [76] (disabled)
                        * 5400.0 MHz [80] (disabled)
                        * 5420.0 MHz [84] (disabled)

Means you can't use that frequency ( channel ) with your adapter, it doesn't support it.

Well, ok that's great, but what wi-fi networks are around me that I can connect to?

There are some ways to do this from the command line. But you'll need to know your interface name for one of them.

Code:
ip link show | grep "wl"

This will work about 95% of the time. If it returns nothing, leave the "grep wl" out of the command.
Ok, now that you know the interface name you can run this.

Code:
iw dev wlp39s0 scan | grep -E 'SSID|signal'

Just change the "wlp39s0" to whatever your interface name is.

This next command might be a little easier, because you don't need to know the interface name.

Code:
nmcli dev wifi list

These are good commands to know to find out what the capabilities of your wi-fi adapter are,
and what the capabilities of the wi-fi networks (SSID's) close to you are.
 
Last edited:



Members online


Top