Categories: Ubuntu

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.

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:

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:

Method 3: Network Manager

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

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.”

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

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:

sudo ethtool eth0

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.

Ubuntu Server Admin

Recent Posts

Ubuntu vs Debian: Linux Distributions Compared Deep Dive

Debian and Ubuntu are two popular Linux distributions. In this deep dive we will guide…

6 hours ago

How to Install Google Cloud BigQuery Python client library on Linux

In this article, we will see how to Install Google Cloud BigQuery Python client library…

2 days ago

Wallpaper Contest for Xfce 4.20 open for voting

Nov 15,2024 Wallpaper Contest for Xfce 4.20 open for voting The submission phase for the…

2 days ago

Canonical announces the first MicroCloud LTS release

MicroCloud 2.1.0 LTS is now available, expanding the number of Canonical infrastructure solutions with a…

3 days ago

Join Canonical in Paris at Dell Technologies Forum

Canonical is thrilled to be joining forces with Dell Technologies at the upcoming Dell Technologies…

4 days ago

Bringing automation to open source 5G software at Ubuntu Summit 2024

In today’s massive private mobile network (PMN) market, one of the most common approaches to…

5 days ago