Today’s article is mostly just for fun, as we examine a couple more ways to find your network interfaces! I’ve shown you a variety of ways at this point, but this is Linux. If you just want to have some fun finding your network interfaces, read on – ’cause this article is meant for those who like to travel a different path!
One of the things that make Linux so awesome is the myriad choices we have. There are so many different ways to accomplish the same goal. In fact, we sometimes get defensive about ‘our way’ of accomplishing things. It can make for some amusing (and sometimes a bit heated) discussions.
Anyhow, I’ve covered this before. I’ve even covered it recently, which is why this is still fresh in my memory. You can start with this article if you want:
How To: Show Your Network Interfaces
Just to touch on it, a network interface is a device that your computer uses to communicate over the network. In most folks’ cases, you’ll locally use your network interface to connect to the Internet, perhaps first to your router or modem. These networking devices have names.
It’s important to be able to point to a specific networking interface, which is why they have names. If you want to issue commands, you want to send them to the right networking interface. If you want to monitor a connection, you need to know the correct name for the network interface.
So, these network interfaces have names. These names should be unique in your system, meaning you shouldn’t have more than one device per name. The names should not be shared among the devices and each working networking interface should have a name of its own.
If you want to know the network interface names, this article’s for you…
Find Your Network Interfaces Continued:
This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press
With your terminal now open, we’re going to show you a couple of new ways to find your network interfaces. It’ll be fun!
For starters, and probably one I should have already covered, we’ll use a command we’ve covered here and here. We’ll use the ‘netstat’ command, and the ‘netstat’ command you need to find your network interfaces is simply:
1 | netstat -i |
(If you don’t have ‘netstat’ available, install the ‘net-tools’ package from your distro’s repositories. It’s almost certainly available.) The output is nice and clear and will show you the names of your network interfaces.
The next command we’ll use is one we’ve used many times before. It’s just a two-letter command, so trying to search for it (on this site) is neigh on impossible – but you can be certain that we’ve used it before. (We’ve at least covered sorting and formatting the output from the ‘ls’ command.)
Anyhow, the command we’ll use to list the network interfaces is pretty simple, it’s just this simple command:
1 | ls /sys/class/net |
That ‘ls’ command should spit out a list of your network interfaces all nice and easy. If there’s going to be one command that’ll work on any system, it might be this one.
Speaking of which, as this is Linux, there are all sorts of ways to accomplish goals. Because of this, that also means they’ll not always work on every system. You may need to try multiple commands to get the output you’re after – but both of today’s commands should result in you getting the names of your network interfaces (even if you have to install ‘net-tools’ to do so).
Closure:
There you have it, another easy article. Ugh… I do wish I was feeling a bit more up to snuff. Meh… At least I’m writing and writing this sort of stuff. In this case, it’s another article that’ll show you how to find your network interfaces. It’s information worth having. They’re tools that will go well in your growing toolkit of Linux tools.
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 own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.