How-To

Gathering Information on Your Wi-Fi NIC and Connection on Linux

Tom Fenton shares his tools for monitoring built-in device Wi-Fi among the wide variety of Linux versions and GUI interfaces.

I have been working with a lot of edge devices and virtual desktop infrastructure (VDI) clients lately and one of the issues that I have encountered is that many of these devices have built-in Wi-Fi that I need to monitor and gather information about.

Because many edge devices run Linux -- which in turn means a wide variety of Linux versions and GUI interfaces that each supports -- I have found it easier to use the command line to monitor the Wi-Fi of these devices.

In this article, I will show you some of the command-line tools that I use to monitor Wi-Fi NICs on Linux edge devices.

The /proc Filesystem
Most of the information provided by these command-line tools comes from /proc, a pseudo-file-system that contains runtime information about the system, such as CPU, memory and networking; it even contains information about the processes that are running on it. Some of the commands are just a shortcut to the information in /proc. For example, lsmod is the same as cat /proc/modules, and lspci is the same as cat /proc/pci.

By looking at /proc, you can discover some fascinating insights into your system. However, despite its usefulness, extreme caution must be used with /proc, as making changes to the files located within it can change kernel parameters while the system is running, which may cause unpredictable results.

/proc allows you to see the PID of all the active processes on the system, as well as directories for the major subsystems on it.

[Click on image for larger view.]

For instance, cat /proc/cpuinfo will display information about the CPU.

[Click on image for larger view.]

You can find information about the Wi-Fi by entering cat /proc/net/wireless.

[Click on image for larger view.]

This tells us, among other things, information about the interface and the quality of the Wi-Fi connection. The quality of the connection in the example above has a link level of -45. The link level can be a little bit confusing, but it is a performance metric most people are concerned with. The level is a negative number, so -50 means the signal is fine, but if it gets to -80 it will be borderline unusable.

WI-FI Command Line Tools
Below are some of the commands that will work with most Linux systems, and are ones that I have found most useful:

  • Ipconfig -- Displays information about the network connection that was made.
    [Click on image for larger view.]
  • iwconfig -- Displays the information in /proc/net/wireless as well as other information. You can just type in iwconfig to see the information about all the network devices on your system, or iwconfig wlan0 to see the information just about wlan0.
    [Click on image for larger view.]
  • iwlist -- Displays some very interesting information, such as: which channels are available;
    [Click on image for larger view.]

    or which authentication methods are available;

    [Click on image for larger view.]

    or which other Wi-Fi access points are available.

    [Click on image for larger view.]
  • lspci -- Used to get information about the chipset of a wireless network adapter.
    [Click on image for larger view.]

    You can use the first number from the output to gather even more information about the device.

    [Click on image for larger view.]

    This information includes the driver it's using.

    [Click on image for larger view.]

Conclusion
Different versions of Linux have different tools and GUIs that can be used to show information about your network. Many of these tools are easier and more intuitive to use than the commands shown above, but I have found the ability to use a standard set of commands that do not rely on having a graphical interface to be very valuable.

About the Author

Tom Fenton has a wealth of hands-on IT experience gained over the past 30 years in a variety of technologies, with the past 20 years focusing on virtualization and storage. He previously worked as a Technical Marketing Manager for ControlUp. He also previously worked at VMware in Staff and Senior level positions. He has also worked as a Senior Validation Engineer with The Taneja Group, where he headed the Validation Service Lab and was instrumental in starting up its vSphere Virtual Volumes practice. He's on X @vDoppler.

Featured

Subscribe on YouTube