Linux Display Network Interfaces Step-by-Step
In this article
Displaying network interfaces in Linux helps you identify and manage your system’s network connections. This guide shows you how to list network interfaces using built-in commands like ip, ifconfig, and lspci. You’ll learn how to quickly check which interfaces are active, their status, and basic configuration details—all from the command line. Whether you’re troubleshooting a connectivity issue, verifying interface names, or configuring networking manually, these commands provide the tools you need.
What You'll Need
- A Linux system with command-line access (Debian, Ubuntu, Fedora, CentOS, Arch, etc.)
- Basic familiarity with the terminal
- Optional: Root or sudo privileges for certain commands
- Optional: NetworkManager installed (if using
nmcli)
Step-by-Step
- Open a terminal
PressCtrl + Alt + Tor navigate toApplications > Terminalto launch the command-line interface. If you're using a remote server via SSH, ensure you're connected before proceeding. - Use
ipto list interfaces
Enter the command:ip link show
This lists all network interfaces along with their status (UP/DOWN). For example, you might see: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: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:10:2b:9c brd ff:ff:ff:ff:ff:ff 3: enp0s8: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:87:0e:0a brd ff:ff:ff:ff:ff:ffThis shows three interfaces:lo(loopback),enp0s3(Ethernet), andenp0s8(Ethernet likely unplugged). - Check detailed interface information
To see more details, use:ip addr show
This displays interface names, IP addresses, MAC addresses, and other relevant info. For example, you might get output like: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 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:10:2b:9c brd ff:ff:ff:ff:ff:ff inet 192.168.1.2/24 brd 192.168.1.255 scope global dynamic enp0s3 valid_lft 85264sec preferred_lft 85264sec inet6 fe80::a00:27ff:fe10:2b9c/64 scope link valid_lft forever preferred_lft foreverThis shows the loopback interface and theenp0s3interface with an IPv4 address192.168.1.2and a MAC address08:00:27:10:2b:9c. - Try
ifconfig(if installed)
On older Linux systems or with certain distributions, use:ifconfig
Note:ifconfigis deprecated on newer systems in favor ofip. Ififconfigis not found, it likely isn’t installed. You can install it with:sudo apt install net-tools
or the equivalent for your distribution. - Use
lspcifor hardware interfaces
To see which network hardware is physically installed, run:lspci | grep -i net
This lists network controller hardware details. For example:02:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Ethernet Controller
This tells you the type of hardware present. - Use
nmclion NetworkManager systems
If your system uses NetworkManager, run:nmcli device show
This provides interface status and connection details with NetworkManager. For example, you might see:GENERAL.DEVICE: enp0s3 GENERAL.TYPE: ethernet GENERAL.VENDOR: Intel Corporation GENERAL.MODEL: 82574L Gigabit Ethernet Controller ...
This gives detailed information about the device and its connection status.
Common Mistakes
- Forgetting to use
sudowhen needed - Mixing up
ifconfigandipcommands - Not checking both
ip link showandip addr showfor full visibility - Assuming all listed interfaces are active or functional
- Not installing
net-toolswhen usingifconfig
Tips
- Use
man iporman ifconfigto explore full command options - Filter output with
grepto find specific interfaces - Use
aliasto create shortcuts for frequently used commands - Check your system’s init system (SysVinit, systemd, etc.) for interface naming conventions
- Use
ip -s linkto see statistics like packets sent and received
Troubleshooting
If the commands don’t return expected results, consider the following:
- Command not found: Some distributions do not include
ifconfigby default. Installnet-toolswith:sudo apt install net-tools
or equivalent for your distribution. - No interfaces listed: Check if the network service is running:
systemctl status networking
orsystemctl status NetworkManager
depending on which service is used. - Interfaces not working: Ensure the interface is brought up with:
sudo ip link set dev eth0 up
(replaceeth0with your actual interface name). - No IP address assigned: Use
ip addr addor configure viadhclientordhcpcdto request an IP. - Duplicate interface names: Newer systems use predictable naming (e.g.,
enp3s0), which may confuse users. Seegrubconfig for legacy naming options.
Additional Guidance: Interface Naming Conventions
Linux uses predictable interface naming to avoid confusion with eth0, eth1, etc. Here’s what you might see:
enpXsY:en= Ethernet,pX= PCI bus number,sY= slot numberwlpXsY:wl= wireless,pX= PCI bus number,sY= slot numberlo: Loopback interfacevirbr0: Virtual bridge created by libvirt for virtual machines
When to Use Specific Commands
Here’s when to use each command for best results:
ip link show: For listing interfaces and checking their state (UP/DOWN)ip addr show: For detailed interface info like IP addresses and MAC addressesifconfig: For older systems or when you prefer a simpler interfacelspci: For identifying network hardware on your machinenmcli device show: For users of NetworkManager who want a GUI-like experience from the terminal
Real-World Example
Suppose you are troubleshooting a connectivity issue and see the following from ip link show:
2: enp0s8: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether 08:00:27:87:0e:0a brd ff:ff:ff:ff:ff:ff
The NO-CARRIER flag indicates that the interface is not connected to a network. You can bring it up with:
sudo ip link set dev enp0s8 up
Then request an IP address with:
sudo dhclient enp0s8
If this still doesn’t work, you may need to check physical connections or the network configuration file in /etc/network/interfaces (for Debian-based systems) or /etc/sysconfig/network-scripts/ifcfg-interface (for Red Hat-based systems).