Linux Show / Display Available Network Interfaces

See all Linux/UNIX networking related FAQ
How do I display all available network interfaces names under Linux operating systems using bash shell prompt? How do use the ip command to list interfaces / NIC on Linux?

You can use the following commands to see all network interfaces under Linux operating systems:

  • ip command – It is used to show or manipulate routing, devices, policy routing and tunnels.
  • netstat command – It is used to display network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.
  • ifconfig command – It is used to display or configure a network interface.
  • nmcli command – A command to show or configure a network interface on Linux.
  • tcpdump command – Print the list of the network interfaces available on the system.
Tutorial details
Difficulty level Easy
Root privileges No
Requirements Linux terminal
Category Network Utilities
OS compatibility AlmaLinux Alpine Arch Debian Fedora Mint openSUSE Pop!_OS RHEL Rocky Stream SUSE Ubuntu WSL
Est. reading time 3 minutes

List Network Interfaces Using ip Command on Linux

Type the following ip command, enter:
$ ip link show
Here is what we see (the network device names might differ on your bare metal or cloud server):

1: lo:  mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0:  mtu 1500 qdisc mq state UP qlen 1000
    link/ether b8:ac:6f:65:31:e5 brd ff:ff:ff:ff:ff:ff
3: wlan0:  mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 00:21:6a:ca:9b:10 brd ff:ff:ff:ff:ff:ff
4: vboxnet0:  mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
5: pan0:  mtu 1500 qdisc noop state DOWN 
    link/ether c2:10:fa:55:8e:32 brd ff:ff:ff:ff:ff:ff
6: vmnet1:  mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:50:56:c0:00:01 brd ff:ff:ff:ff:ff:ff
7: vmnet8:  mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:50:56:c0:00:08 brd ff:ff:ff:ff:ff:ff
11: ppp0:  mtu 1496 qdisc pfifo_fast state UNKNOWN qlen 3
    link/ppp 
See all Novell Suse / OpenSuse Linux related FAQ
Where,

  1. lo – Loopback interface.
  2. eth0 – My first Ethernet network interface on Linux. On modern Linux distros eth0 might be renamed as enp0s31f6 depending upon your driver.
  3. wlan0 – Wireless network interface in Linux. Again, WiFi device might be renamed as wlp82s0 depending upon your driver.
  4. ppp0 – Point to Point Protocol network interface which can be used by dial up modem, PPTP vpn connection, or 3G wireless USB modem.
  5. vboxnet0, vmnet1, vmnet8 – Virtual machine interface working in bridge mode or NAT mode on Linux.

Linux show / display available network interfaces using nmcli

One can list available devices and their status on Linux, run:
$ nmcli device status
OR
$ nmcli connection show

Linux Show or Display Available Network Interfaces

Linux list all network interfaces using nmcli and ip command

Show a table of all network interfaces using netstat command in Linux

Type the following netstat command:
$ netstat -i
Here is what we see:

Kernel Interface table
Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0       1500 0   2697347      0      0 0       2630262      0      0      0 BMRU
lo        16436 0      2840      0      0 0          2840      0      0      0 LRU
ppp0       1496 0    102800      0      0 0         63437      0      0      0 MOPRU
vmnet1     1500 0         0      0      0 0            49      0      0      0 BMRU
vmnet8     1500 0         0      0      0 0            49      0      0      0 BMRU

Checking the network interface on Linux using the tcpdump

Type the following tcpdump command and for each Linux network interface, a number and an interface name, possibly followed by a text description of the interface, is printed as follows:
$ tcpdump --list-interfaces
Outputs:

1.lxdbr0 [Up, Running]
2.wg1 [Up, Running]
3.enp0s31f6 [Up, Running]
...

The tcpdump command is a cross-platform utility that works on Unix-like systems including macOS and FreeBSD.

Linux ip list interfaces using ifconfig command

NOTE: The ifconfig command is deprecated on Linux in favor of ip command. So you may get an error that reads as: “bash: ifconfig: command not found.

Type the following ifconfig command:
$ /sbin/ifconfig -a
Sample outputs:

eth0      Link encap:Ethernet  HWaddr b8:ac:6f:65:31:e5  
          inet addr:192.168.2.100  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::baac:6fff:fe65:31e5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2697529 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2630541 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2159382827 (2.0 GiB)  TX bytes:1389552776 (1.2 GiB)
          Interrupt:17 
 
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2849 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2849 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2778290 (2.6 MiB)  TX bytes:2778290 (2.6 MiB)
 
ppp0      Link encap:Point-to-Point Protocol  
          inet addr:10.1.3.105  P-t-P:10.0.31.18  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1496  Metric:1
          RX packets:102800 errors:0 dropped:0 overruns:0 frame:0
          TX packets:63437 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:148532544 (141.6 MiB)  TX bytes:4425518 (4.2 MiB)
 
vmnet1    Link encap:Ethernet  HWaddr 00:50:56:c0:00:01  
          inet addr:192.168.47.1  Bcast:192.168.47.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
vmnet8    Link encap:Ethernet  HWaddr 00:50:56:c0:00:08  
          inet addr:172.16.232.1  Bcast:172.16.232.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

How do I see routing table on Linux?

Use the following ip command:
$ ip r
Sample outputs:

0.0.0.0/1 via 10.8.0.1 dev tun0 
default via 192.168.2.254 dev enp6s0 proto static metric 100 
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.2 
128.0.0.0/1 via 10.8.0.1 dev tun0 
139.59.1.155 via 192.168.2.254 dev enp6s0 
169.254.0.0/16 dev virbr0 scope link metric 1000 linkdown 
192.168.2.0/24 dev enp6s0 proto kernel scope link src 192.168.2.24 metric 100 
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown

How do I see arp cache connected to my NIC on Linux?

Run arp command:
$ arp
$ arp -a
$ arp -e
$ arp -n
# On modern Linux distros use the ip command #
$ ip neigh
$ ip -s neigh

Outputs:

Address                  HWtype  HWaddress           Flags Mask            Iface
centos7                  ether   00:01:c0:1c:09:4c   C                     enp6s0
freebsd11-box            ether   00:01:c0:1c:09:4c   C                     enp6s0
192.168.2.203            ether   00:01:c0:1c:09:4c   C                     enp6s0
fw0-pfsense-sg-3100.swe  ether   00:08:a2:0d:05:41   C                     enp6s0
192.168.2.205            ether   00:01:c0:1c:09:4c   C                     enp6s0
192.168.2.202            ether   00:01:c0:1c:09:4c   C                     enp6s0

How to list all network devices connected to the PCI bus in Linux

Use the lspci command as follows:
$ sudo lspci
# Filter out results using the "grep" or "egrep" #
$ sudo lspci | grep -Ei 'eth|network|ethernet|wireless|wifi'

It seems that I have Intel Ethernet (00:1f.6) and Wifi (52:00.0 ) device connected to my PCI bus:

00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (7) I219-LM (rev 10)
52:00.0 Network controller: Intel Corporation Wi-Fi 6 AX200 (rev 1a)

Want to know more about those devices and their drivers? Try passing the -vss {ID} options to the lscpi command:
$ sudo lspci -vvs 00:1f.6
And here is what I see:

00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (7) I219-LM (rev 10)
	Subsystem: Lenovo Ethernet Connection (7) I219-LM
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 178
	Region 0: Memory at ee500000 (32-bit, non-prefetchable) [size=128K]
	Capabilities: [c8] Power Management version 3
		Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
		Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=1 PME-
	Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
		Address: 00000000fee00998  Data: 0000
	Kernel driver in use: e1000e
	Kernel modules: e1000e

How to list all physically installed network cards in Linux using the lshw, inxi, or hwinfo commands

Prerequisite
By default, lshw, inxi, and hwinfo command may not be installed on your system. Hence, use the apk command on Alpine Linux, dnf command/yum command on RHEL & co, apt command/apt-get command on Debian, Ubuntu & co, zypper command on SUSE/OpenSUSE, pacman command on Arch Linux to install the lshw, inxi, and hwinfo.
First, install those tools on your Debian or Ubuntu Linux using the apt command. For instance:
$ sudo apt install lshw inxi hwinfo
Fedora users try the dnf command:
{fedora:~}$ sudo dnf install lshw inxi hwinfo
RHEL/CentOS/Rocky/Oracle and AlmaLinux users need to enable the EPEL repo and then use the yum command:
{rhel9:~}# yum install lshw inxi hwinfo
Now use them as follows to list NIC’s:
$ sudo hwinfo --short --netcard
$ sudo lshw -C network -short
$ sudo inxi -N

How to List Network Interfaces in Linux

Using the /proc/net/dev file to see available network interfaces in Linux

The /proc/net/dev file is a special file containing information about the network device status. This information includes the number of packets received and sent, the number of errors and collisions that have occurred, and other basic statistics. Use the “cat“, “bat“, “more“, or “less” to view it. For example:
$ cat /proc/net/dev
The following output indicates that I’ve lo, eth0, and wg0 network interfaces on my WireGuard server:

Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo:  164243    1526    0    0    0     0          0         0   164243    1526    0    0    0     0       0          0
  eth0: 2372840589 2027484    0    0    0     0          0         0 2467369079 2428370    0    0    0     0       0          0
   wg0: 203283936  601457  640    0    0   640          0         0 2201800868 1830420    0 1061    0     0       0          0

You can also use the ls command to list same info using the /sys/class/net/ directory. For instance:
$ ls -l /sys/class/net/
Outputs:

total 0
lrwxrwxrwx    1 root     root             0 Jun 17 13:30 eth0 -> ../../devices/pci0000:00/0000:00:04.0/virtio2/net/eth0
lrwxrwxrwx    1 root     root             0 Jun 17 13:30 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx    1 root     root             0 Jun 17 13:31 wg0 -> ../../devices/virtual/net/wg0

Getting name of interface from the /sys/class/net

Here is bash for loop example to list those in nice format:

list=$(find /sys/class/net -type l)
for nic in $list
do
    echo "*** [ NIC: $nic ] ***"
    cat "${nic}/uevent"
    echo "" 
done

How does it works?

  • The list=$(find /sys/class/net -type l) line uses the find command to search for symbolic links (-type l) inside the /sys/class/net directory. The output of the find command, which contains the list of NICs, is stored in the $list shell variable.
  • The for nic in $list line starts a bash for loop that iterates over each element in the list variable. In other words, each element represents a $nic variable.
  • The $nic is the shell variable. It holds the name of the current NIC.
  • The echo "*** [ NIC: $nic ] ***" line act as a header indicating the current NIC being processed.
  • Finally, the cat "${nic}/uevent" line reads and outputs the contents of the uevent file associated with the current NIC. The uevent file provides information about the NIC and related attributes. The “${nic}/uevent” notation uses the value of the $nic variable to form the file path for the cat command.
  • The last echo "" line adds an empty line to separate the output for each NIC and makes reading easier on the Linux terminal using the echo command.

When you run these commands in a Linux terminal you get the following info about network interfaces in a Linux system:

Listing physical network cards in Linux using the sys class net file

Click to enlarge

Conclusion

You learned how to display all available network interfaces on Linux using the command line. See the following documentations using the man command/help command:
$ man ip
$ ip --help
$ man ifconfig
$ man nmcli
$ man arp

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

18 comments… add one
  • Zee Jul 8, 2023 @ 19:07

    Great collection of all the network related command in one place. thanks

  • ju71us Dec 26, 2023 @ 7:30

    This site has been a savior for some time, coming through when prior searches returned nil.

  • wjgeorge7 Mar 18, 2024 @ 16:58

    very nice collection! Thank you

  • chris Apr 17, 2024 @ 12:03

    This is great article!

  • Garry Lincoln May 7, 2024 @ 0:41

    Thanks for this very informative article Vivek.
    This article has answered a number of questions I had related to this.
    On this line, the o is missing from HWINFO
    sudo apt install lshw inxi hwinf

    Thanks again

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.