Today’s exercise is a nice and simple exercise where we check your NIC speed in the terminal. Anyone can do this, but it’s less useful for you if you don’t use a NIC and rely on wireless. If you’re using a wireless controller, this isn’t the article for you.
I’ll make this article short.
What is a NIC?
NIC stands for Network Interface Card and is how you connect to a wired internet connection. They come in various speeds with gigabit being a fairly common speed these days. There are a number of reasons to use a wired connection, including security and maximum speeds.
The tool we’ll be using is ‘ethtool’. We will also use the ‘ip’ command. If you don’t have ethtool available immediately, you must install it. The ‘ip’ command works by default (unless your system is rather old).
As I said, if you don’t have ethtool you’ll need to install it. I just checked a couple of distros and it appears to be a fairly common application, installed by default. If you check the man page, you’ll see this:
ethtool – query or control network driver and hardware settings
So, if we want to check your NIC speed in the terminal this is a good tool for the job. We will use another command along the way…
There’s another command we’ll be using. This will be available by default in a modern system. This is, of course, the ‘ip’ command. We’ll just use the ip command to identify our NIC. If you check the man page, you’ll see this:
ip – show / manipulate routing, network devices, interfaces and tunnels
That’s exactly what we need to do! So, this is the correct tool for identifying your NIC. You used to be able to just assume that it was eth0 but those days are no more. Now it’s a longer string of characters.
As mentioned above, this is a terminal-based article. You’ll need an open terminal, of course. You can usually press CTRL + ALT + T and your default terminal will open. Try that before checking in your application menu. It’s not quite a standard but it’s pretty common.
With your terminal open, we first identify our NIC. In this case, we’ll use the following command to show our network devices:
ip addr
From there, find your NIC’s name. It’s probably going to start with enp and then be followed by some letters and numbers. Mine is enp0s31f6 for example.
You then take that information and use it with the ethtool command. This command requires elevated permissions, so we’ll be using sudo. The syntax is as follows:
sudo ethtool <NIC_name>
Then, you’re looking for ‘Speed:’, which will tell you the currently connected speed. There’s additional information that will tell you things like supported speeds, but this section tells you the current speed.
I suppose you could use grep for this…
sudo ethtool <NIC_name> | grep 'Speed:'
Or, using my case as an example:
sudo ethtool enp0s31f6 | grep 'Speed:'
Which looks like this:
$ sudo ethtool enp0s31f6 | grep 'Speed:' Speed: 1000Mb/s
That’s it. That’s all you need to know for this article…
Well, if you ever need to know your NIC’s speed you can refer back to this article. I don’t expect you’ll need to check your NIC speed often enough to commit this one to memory, though it is relatively short and easy. If you don’t remember it, you’ll know where to find it. There’s that…
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.
Today we'll cover one way to enable or disable your network interface in the Linux…
Have you ever wanted to easily monitor your wireless connection? Well, now you can learn…
I think I've covered this before with the ls command but this time we'll count…
Today we'll be learning about a basic Linux command that's known as 'uname' and it…
If you've used hardinfo in the past, it may interest you to know that hardinfo…
This won't be as complicated as it seems because we're just going to cover how…