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.
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:
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:
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.
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:
The command below shows the link speed for the interface eth0 as shown:
To learn more how to use the ethtool, consider the manual in the 8th section or use the link below:
In this tutorial, we discussed various methods and tricks to get the link speed of network interfaces in Ubuntu.
Thank you for reading.