Top 3 Commands to check Wifi Information on Ubuntu / Linux – iwconfig, iwlist, nmcli

By | May 27, 2021

Getting detailed information about the wifi adapter on a linux system is not straight forward using gui tools.

However there are simple commands that can do the trick.

In this article we shall take a look at commands like iwconfig, iwlist, iw and nmcli which can be used to probe details about the wifi adapter and connection.

1. iwconfig

The iwconfig command is quite similar to the old ifconfig command, but works for wireless connections. Simply running the command without any arguments would show the details of the current wifi connections on the system.

Whether its your system wifi on a laptop or a usb wifi adapter, this command will list them all.

The following is the output on a desktop machine using a usb wifi adapter.

The details include the transfer bit rate, frequency, access point mac address and some other details.

$ iwconfig
lo        no wireless extensions.
enp1s0    no wireless extensions.
wlxc025e9177832  IEEE 802.11bgn  ESSID:"BsnlDeck"  Nickname:"<[email protected]>"
          Mode:Managed  Frequency:2.412 GHz  Access Point: 80:26:89:C3:6A:CA
          Bit Rate:150 Mb/s   Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=68/100  Signal level=52/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Note down the interface name. here it is wlxc025e9177832

The ESSID field tells us the name of the wifi network (here its BsnlDeck) to which the adapter is connected.

Now you can configure the wireless radio transmission power using the iwconfig command like shown below:

$ iwconfig wlxc025e9177832 txpower 30

Here is the output from my Acer Swift 3 laptop showing wifi connection details:

$ iwconfig
lo        no wireless extensions.
wlp0s20f3  IEEE 802.11  ESSID:"AirtelFiber_5GHz"
          Mode:Managed  Frequency:5.745 GHz  Access Point: 98:35:ED:D4:E1:4C
          Bit Rate=390 Mb/s   Tx-Power=19 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=52/70  Signal level=-58 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:10   Missed beacon:0
$

2. iwlist

The next command is iwlist. It lists various supported parameter values by the wifi adapter. For example supported bit rates and supported transmission powers.

Check supported bitrates - This will show the data transfer bitrates supported by the wifi adapter.

$ iwlist wlxc025e9177832 bitrate
wlxc025e9177832  4 available bit-rates :
          1 Mb/s
          2 Mb/s
          5.5 Mb/s
          11 Mb/s
          Current Bit Rate:150 Mb/s

3. nmcli

Check status of all network devices - nmcli device status or nmcli dev

$ nmcli device status
DEVICE           TYPE      STATE         CONNECTION
wlxc025e9177832  wifi      connected     BsnlDeck
enp1s0           ethernet  disconnected  --
lo               loopback  unmanaged     --

Check details of available wifi networks that can be joined.

$ nmcli dev wifi
IN-USE  BSSID              SSID              MODE   CHAN  RATE        SIGNAL  BARS  SECURITY
        98:35:ED:D4:E1:48  AirtelFiber       Infra  5     130 Mbit/s  75      ▂▄▆_  WPA1 WPA2
*       98:35:ED:D4:E1:4C  AirtelFiber_5GHz  Infra  149   270 Mbit/s  63      ▂▄▆_  WPA1 WPA2
        60:63:4C:84:15:AA  dlink-15A3        Infra  4     270 Mbit/s  47      ▂▄__  WPA1 WPA2
        0C:80:63:76:5F:90  Krishna           Infra  9     405 Mbit/s  40      ▂▄__  WPA2
        14:CC:20:A5:70:48  Camp Nou          Infra  9     54 Mbit/s   35      ▂▄__  WPA2
        84:D8:1B:00:7A:7C  subash            Infra  10    270 Mbit/s  35      ▂▄__  WPA2
        AC:84:C6:F4:60:18  TP-Link_6018      Infra  11    270 Mbit/s  34      ▂▄__  WPA2
        18:A6:F7:3C:F8:1C  Risha             Infra  6     135 Mbit/s  27      ▂___  WPA2
        34:0A:33:68:5C:E6  neymarjr          Infra  13    270 Mbit/s  15      ▂___  WPA2
$

Other examples

1. Change transmission power of wifi adapter

Use the iwlist command to check the transmission power of the wifi adapter.

$ iwlist wlx74da38e88bd7 txpower
wlx74da38e88bd7  unknown transmit-power information.
          Current Tx-Power=20 dBm       (100 mW)

Now use the iwconfig command to change the radio transmission power

$ sudo iwconfig wlx74da38e88bd7 txpower 10
[email protected]:~$ iwlist wlx74da38e88bd7 txpower
wlx74da38e88bd7  unknown transmit-power information.
          Current Tx-Power=10 dBm       (10 mW)
$

Here is another example

$ sudo iwconfig wlx74da38e88bd7 txpower 3
$ iwlist wlx74da38e88bd7 txpower
wlx74da38e88bd7  unknown transmit-power information.
          Current Tx-Power=3 dBm        (1 mW)

2. Get details of usb wifi adapter

The lsusb command will show all usb devices including the wifi adapter

$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 045e:00cb Microsoft Corp. Basic Optical Mouse v2.0
Bus 001 Device 003: ID 22b8:2e82 Motorola PCS
Bus 001 Device 002: ID 413c:2107 Dell Computer Corp.
Bus 001 Device 006: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

In the above output the line "Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]" is the usb wifi adapter.

3. check the loaded driver modules

To check what drivers are currently loaded to operate the wifi driver, use the lsmod command and grep for wifi.

$ lsmod | grep -i wifi
rtlwifi                77824  3 rtl8192c_common,rtl_usb,rtl8192cu
mac80211              778240  4 rtl_usb,rtl8192cu,rtlwifi,rtl8xxxu
cfg80211              622592  2 rtlwifi,mac80211

4. Get lots of detail about wifi adapter

The iw list command shows a huge amount of hardware information about the wifi adapter.

$ iw list

Links and Resources

https://nullr0ute.com/2016/09/connect-to-a-wireless-network-using-command-line-nmcli/
About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].

Leave a Reply

Your email address will not be published. Required fields are marked *