How to Check Link Speed in Ubuntu

The link speed in a basic network refers to the maximum speed that a device can communicate with the wireless router. The link speed is expressed in bits/second and may vary depending on the device and the wireless access point.

In most cases, you will find speeds like 144.4Mbps, 300Mbps, 100Mbps for fast ethernets, or 1000Mbps for devices such as Gigabit ethernets.

I will not dive into how the various layers of the TCP/IP process the speeds. Instead, we’ll focus on how to check for link speed on Ubuntu.

Method 1: Using the IP Command

The very first method to get the link speed of your interface is using the IP command.

Sponsored

We are all familiar with the IP command in Linux; it is part of the net-tools package. It allows us to configure network interfaces in the Linux system, including bringing interfaces up and down, setting IP addresses, netmasks, routes, and more. Thus, it is a powerful tool for network administrators.

See also  Firefox 124.0 Released! Caret Browsing in PDF Viewer & Qwant to All Languages in France

To get the link speed of your interface, use the ip command followed by grep as:

sudo ip -a | grep qlen

In the above command, we grep for qlen, which shows the transmit queue length of the network interface in packets.

Here is an example:

How to check link speed in ubuntu 1

The above shows the interfaces, loopback, and eth0, which is an ethernet adapter.

Method 2: Ask the Kernel

As you guessed, in this method, we will view the interface speed directly from the kernel. The network interface information is stored in the /sys/classes/net/[interface_name]/speed.

All we need to do is query the file using a cat as:

sudo cat /sys/classes/net/eth0/speed

The output is as shown:

How to check link speed in ubuntu 2

Method 3: Network Manager

The simplest and most common is to look at the network interface in the network manager GUI tool.

See also  How to Install Notepad++ on Ubuntu 20.04
Sponsored

In Ubuntu, to get the Link speed of the ethernet interface. Click on the Network connection action in the top bar and select “Wired Settings.”

How to check link speed in ubuntu 3

This should take you to the network management window that shows the link speed as shown below:

How to check link speed in ubuntu 4

Method 4: Mii-Tool/Ethtool

The next method is somewhat unconventional but works for systems with the tool installed. In this case, you can use the mii-tool or ethtool. They both allow users to query the device for information.

However, that may require you to have root or a user with sudo privileges to work.

NOTE: If you are on a Linux machine that does not have the tools installed, use the method discussed above as it will work in most systems.

To get the link speed of a network interface using the ethtool, use the command:

sudo ethtool <interface_name>

The command below shows the link speed for the interface eth0 as shown:

See also  Canonical at Google Next – What you need to know
sudo ethtool eth0

How to check link speed in ubuntu 5

To learn more how to use the ethtool, consider the manual in the 8th section or use the link below:

man 8 ethtool

<a href=“https://linux.die.net/man/8/ethtool”>https://linux.die.net/man/8/ethtoola>

Conclusion

In this tutorial, we discussed various methods and tricks to get the link speed of network interfaces in Ubuntu.

Thank you for reading.


Discover more from Ubuntu-Server.com

Subscribe to get the latest posts sent to your email.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply