Linux Networking BasicsLinux System AdministrationLinux Tutorials

How to List and Display Network Interfaces on Linux Using ip, nmcli, ifconfig, and More

If you need to show available network interfaces on Linux, the good news is that modern distributions provide several reliable command-line tools for the job. Whether you administer Debian, Ubuntu, RHEL, CentOS Stream, Fedora, Rocky Linux, AlmaLinux, Arch Linux, openSUSE, or Alpine, knowing how to list network interfaces on Linux is a fundamental troubleshooting and server management skill. In this guide, you will learn the best ways to display all network interfaces, identify active and inactive NICs, inspect routing information, check ARP and neighbor cache entries, and view physical network hardware details. We will focus on practical commands such as ip, nmcli, ifconfig, netstat, tcpdump, lspci, and files under /proc and /sys, with explanations suitable for both new and experienced Linux administrators.

Why Listing Network Interfaces Matters on Linux

Every Linux server or workstation depends on one or more network interfaces to communicate with other systems. These interfaces may represent physical Ethernet ports, Wi-Fi adapters, loopback devices, VPN tunnels, bridges, VLANs, containers, and virtual machine adapters. Before you configure an IP address, troubleshoot a connectivity problem, bind a firewall rule, or verify hardware detection, you need to know the exact interface name and status.

On older systems, names such as eth0 and wlan0 were common. On modern Linux systems using predictable network interface naming, you may see names like enp0s31f6, ens160, or wlp2s0. Virtual interfaces such as lo, docker0, virbr0, tun0, or wg0 are also common in cloud, virtualization, and VPN environments.

Use the ip Command to Show Network Interfaces

The ip command is the modern and preferred tool for displaying network interfaces on Linux. It is part of the iproute2 package and has replaced many older networking tools. If you want a quick and standard way to list all interfaces, this should be your first choice.

ip link show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 54:e1:ad:11:22:33 brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DORMANT group default qlen 1000
    link/ether 9c:b6:d0:44:55:66 brd ff:ff:ff:ff:ff:ff
4: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/none

The ip link show command lists all network interfaces detected by the Linux kernel. It shows the interface index, name, flags, MTU, queueing discipline, operational state, and link-layer address. In the sample output, lo is the loopback device, enp0s31f6 is a wired Ethernet NIC, wlp2s0 is a wireless interface, and wg0 is a WireGuard VPN tunnel. This command is ideal when you only need interface names and link status.

Display IP Addresses Assigned to Interfaces

In real-world administration, you often want more than the interface name. You also want to see IPv4 and IPv6 addresses assigned to each device. For that, use ip addr show.

ip addr show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    inet 192.168.1.25/24 brd 192.168.1.255 scope global dynamic enp0s31f6
    inet6 fe80::56e1:adff:fe11:2233/64 scope link
4: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 10.8.0.2/24 scope global wg0

The ip addr show command expands on the previous output by displaying configured IP addresses for every interface. This is useful when validating DHCP assignments, checking static addressing, or confirming whether a VPN interface has come up successfully. It also helps distinguish interfaces that exist but are not currently configured with an address.

Show Only Active Network Interfaces

When troubleshooting a server, you may want to filter the view to active interfaces only. This helps reduce noise on systems with bridges, container adapters, and VPN links.

ip -br link

lo               UNKNOWN        00:00:00:00:00:00
enp0s31f6        UP             54:e1:ad:11:22:33
wlp2s0           DOWN           9c:b6:d0:44:55:66
wg0              UNKNOWN        none

The -br flag means “brief” and produces a compact, script-friendly output. This format is easier to read than the full default listing and is especially useful in automation, shell scripts, and quick operational checks. It shows the interface name, state, and MAC address in a clean table-like layout.

List Network Interfaces with nmcli

On systems that use NetworkManager, the nmcli command is extremely useful. It provides a higher-level view of managed network devices and connection states. This is common on desktop systems and many server installations of RHEL, Fedora, Rocky Linux, AlmaLinux, and Ubuntu.

nmcli device status

DEVICE         TYPE      STATE                   CONNECTION
enp0s31f6      ethernet  connected               Wired connection 1
wlp2s0         wifi      disconnected            --
lo             loopback  unmanaged               --
wg0            wireguard connected (externally)  wg0

The nmcli device status command shows each device, its type, current state, and active connection profile. This is especially helpful when NetworkManager controls the interface and you want to know whether the device is connected, disconnected, unmanaged, or externally configured. On enterprise Linux systems, this command is often more meaningful than raw kernel output alone.

View Interfaces with netstat

Although considered legacy on modern Linux, netstat is still found on many servers and can display a concise kernel interface table. If it is installed, it remains useful for quick checks.

netstat -i

Kernel Interface table
Iface      MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
enp0s31f6  1500  985421      0      0 0        812334      0      0      0 BMRU
lo        65536   10455      0      0 0         10455      0      0      0 LRU
wg0        1420   230114      0      0 0        199874      0      2      0 MOPRU

The -i flag tells netstat to show the kernel interface table. The output includes packet counters and error statistics for each interface. This can be useful if you want a simple snapshot of interface activity without parsing the more detailed output of other commands. Keep in mind that many modern distributions recommend using ip instead.

Print a List of Available Interfaces with tcpdump

The tcpdump utility is usually associated with packet capture, but it can also print a list of interfaces available for sniffing. This is useful when you are preparing to troubleshoot traffic flow or select the correct capture device.

tcpdump -D

1.enp0s31f6 [Up, Running]
2.any (Pseudo-device that captures on all interfaces) [Up, Running]
3.lo [Up, Running, Loopback]
4.wg0 [Up, Running]

The -D flag lists capture-capable interfaces known to tcpdump. The output includes an index number and interface name, sometimes with a description. This is very practical when using packet capture tools on systems with many physical and virtual interfaces.

Use ifconfig on Older Systems

The ifconfig command is deprecated on Linux, but many administrators still encounter it on older distributions, legacy documentation, and long-lived environments. It may not be installed by default on current systems.

ifconfig

enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.25  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::56e1:adff:fe11:2233  prefixlen 64  scopeid 0x20<link>
        ether 54:e1:ad:11:22:33  txqueuelen 1000  (Ethernet)
        RX packets 985421  bytes 1204839921 (1.1 GiB)
        TX packets 812334  bytes 934829122 (891.5 MiB)
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>

The ifconfig command shows interface configuration details including IP address, netmask, MAC address, MTU, and traffic counters. While still useful for historical reference, new scripts and administration procedures should prefer the ip command because it is actively maintained and more feature complete.

Show the Linux Routing Table

Identifying interfaces is only part of network troubleshooting. You also need to know which interface the system uses to reach remote networks. The routing table provides that information.

ip route show

default via 192.168.1.1 dev enp0s31f6 proto dhcp metric 100
10.8.0.0/24 dev wg0 proto kernel scope link src 10.8.0.2
192.168.1.0/24 dev enp0s31f6 proto kernel scope link src 192.168.1.25 metric 100

The ip route show command displays the active routing table. The default route indicates the gateway used for outbound traffic, while other entries show directly connected networks and tunnel routes. This output is essential when an interface exists and is up, but traffic still fails because routing is incorrect.

Check ARP and Neighbor Cache Entries

If your goal is to discover systems your host has recently communicated with on the local network, inspect the ARP or neighbor cache. This is particularly useful for diagnosing L2 connectivity and MAC address resolution issues.

ip neigh

192.168.1.1 dev enp0s31f6 lladdr 3c:52:82:aa:bb:cc REACHABLE
192.168.1.10 dev enp0s31f6 lladdr 00:11:22:33:44:55 STALE
192.168.1.20 dev enp0s31f6 lladdr 08:00:27:66:77:88 DELAY

The ip neigh command shows neighbor table entries, including the IP address, interface, MAC address, and kernel reachability state. This modern command replaces older arp usage on many systems and is better aligned with current Linux networking tools.

Identify Physical Network Hardware with lspci

If an interface does not appear in ip link show, the problem may be at the hardware or driver level. In such cases, inspect the PCI bus for network hardware.

lspci | grep -Ei 'eth|network|ethernet|wireless|wifi'

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

The -Ei flags passed to grep enable extended regular expressions and case-insensitive matching. This command filters PCI devices to show likely network controllers only. If hardware appears here but not in the interface list, you should investigate driver loading, firmware, BIOS settings, or kernel support.

Inspect Detailed Network Hardware Information

For a more complete hardware inventory, tools such as lshw, hwinfo, and inxi are very helpful. They may need to be installed first, depending on your distribution.

sudo lshw -C network -short

H/W path          Device       Class          Description
=========================================================
/0/100/1f.6       enp0s31f6    network        Ethernet Connection (7) I219-LM
/0/100/1c.4/0     wlp2s0       network        Wi-Fi 6 AX200

The -C flag filters by hardware class, and -short gives a compact summary. This output maps hardware paths to Linux device names and descriptions, making it easier to correlate physical adapters with kernel interfaces. It is very useful during audits, hardware upgrades, and data center troubleshooting.

Read Interface Statistics from /proc/net/dev

Linux exposes interface counters through the virtual filesystem. This method is lightweight, scriptable, and available even on minimal systems without extra packages.

cat /proc/net/dev

Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo:   845221    10555    0    0    0     0          0         0   845221    10555    0    0    0     0       0          0
enp0s31f6: 1204839921 985421    0    0    0     0          0      213 934829122 812334    0    0    0     0       0          0
   wg0:  45392012 230114    0    0    0     0          0         0 182203994 199874    0    2    0     0       0          0

The /proc/net/dev file shows per-interface receive and transmit statistics, including bytes, packets, errors, drops, and collisions. It is excellent for scripting and monitoring because it is universally available across Linux distributions and easy to parse with shell tools, Python, or configuration management systems.

List Interface Names from /sys/class/net

Another reliable method is to query the kernel’s sysfs interface directory. This is often the fastest way to retrieve just the interface names.

ls -l /sys/class/net/

total 0
lrwxrwxrwx 1 root root 0 Mar  8 10:12 enp0s31f6 -> ../../devices/pci0000:00/0000:00:1f.6/net/enp0s31f6
lrwxrwxrwx 1 root root 0 Mar  8 10:12 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx 1 root root 0 Mar  8 10:12 wg0 -> ../../devices/virtual/net/wg0
lrwxrwxrwx 1 root root 0 Mar  8 10:12 wlp2s0 -> ../../devices/pci0000:00/0000:00:1c.4/0000:52:00.0/net/wlp2s0

The -l flag displays the symbolic link targets, revealing whether an interface is backed by physical PCI hardware or a virtual kernel device. This method is particularly useful in scripts and during investigations where you need a direct mapping between interface names and kernel device paths.

Bash Loop to Enumerate Network Interfaces Cleanly

If you need a script-friendly way to gather details from sysfs, a small shell loop works very well and does not depend on external networking packages.

for nic in /sys/class/net/*; do echo "*** [ NIC: ${nic##*/} ] ***"; cat "$nic/uevent"; echo; done

*** [ NIC: enp0s31f6 ] ***
INTERFACE=enp0s31f6
IFINDEX=2

*** [ NIC: lo ] ***
INTERFACE=lo
IFINDEX=1

*** [ NIC: wg0 ] ***
INTERFACE=wg0
IFINDEX=4

This loop iterates through every entry in /sys/class/net, prints a header for each interface, and reads the associated uevent file. The result is simple but very effective for scripting, inventory collection, and low-level Linux diagnostics. It is also a good approach on stripped-down servers where only core utilities are present.

Best Method to List Network Interfaces on Linux

For most administrators, ip link show and ip addr show are the best default commands to display available network interfaces on Linux. Use nmcli when NetworkManager is involved, lspci and lshw when diagnosing hardware issues, and /proc/net/dev or /sys/class/net for scripting and automation. Legacy tools like ifconfig and netstat still appear in older environments, but modern Linux administration should center on the ip toolset.

Conclusion

Learning how to list network interfaces on Linux is an essential skill for system administration, troubleshooting, and automation. Whether you need to display interface names, verify IP addresses, inspect routing, identify PCI network cards, or read kernel statistics, Linux provides multiple dependable methods. In day-to-day operations, the ip command remains the most important and portable choice, while tools like nmcli, tcpdump, lspci, and lshw provide valuable context for more advanced scenarios. By understanding when to use each command, you can diagnose network issues faster and manage Linux servers with greater confidence and accuracy.

Komentariši

Vaša email adresa neće biti objavljivana. Neophodna polja su označena sa *