Network interface status on Linux is displayed using `ip link show` or `ifconfig` to see whether interfaces are up or down. If you’re managing a Linux server, knowing how to check interface status in Linux is essential for troubleshooting connectivity issues. This guide walks you through every method, from basic commands to advanced monitoring tools.
How To Check Interface Status In Linux
Checking interface status helps you determine if your network card is active, has a link, or is configured correctly. You’ll learn multiple approaches, so you can pick the one that fits your workflow.
Using The Ip Command
The `ip` command is the modern standard for network configuration on Linux. It’s part of the iproute2 package and is available on almost all distributions.
Open your terminal and type:
ip link show
This displays all network interfaces with their current state. Look for the word UP or DOWN next to each interface name. For example:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
Here, `lo` is the loopback interface (always up), and `eth0` shows state UP, meaning it’s active.
To see only a specific interface, add its name:
ip link show eth0
You can also check IP addresses and interface status together with:
ip addr show
This gives you both the link state and assigned IP addresses. It’s a quick way to verify if an interface has an IP and is running.
Using The Ifconfig Command
Although `ifconfig` is older and deprecated on some distros, it’s still widely used. Many sysadmins find it simpler for quick checks.
Type:
ifconfig -a
The `-a` flag shows all interfaces, including those that are down. Without it, only active interfaces appear.
Look for lines like:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
The word UP in the flags indicates the interface is active. RUNNING means it has a carrier signal (cable connected).
If you see only BROADCAST,MULTICAST without UP, the interface is down.
Note: On modern systems, you may need to install net-tools to use ifconfig:
sudo apt install net-tools # Debian/Ubuntu
sudo yum install net-tools # RHEL/CentOS
Checking Interface Status With Ethtool
For detailed physical link information, `ethtool` is your best friend. It shows speed, duplex, and link detection.
Install it if missing:
sudo apt install ethtool
Then run:
sudo ethtool eth0
Output includes:
- Link detected: yes – cable is connected and working
- Speed: 1000Mb/s
- Duplex: Full
If you see Link detected: no, the physical connection is broken or the cable is unplugged.
Using NetworkManager CLI (Nmcli)
If your system uses NetworkManager, `nmcli` gives a clean overview.
Check all connections:
nmcli device status
This shows each device, its type, state (connected/disconnected), and connection name. For example:
DEVICE TYPE STATE CONNECTION
eth0 ethernet connected Wired connection 1
wlan0 wifi disconnected --
To see detailed info on a specific interface:
nmcli device show eth0
This outputs everything from IP addresses to DNS servers.
Checking Interface Status With System Files
Linux exposes network interface status in the `/sys` filesystem. You can read it directly without any commands.
Check if an interface is up:
cat /sys/class/net/eth0/operstate
It returns up or down.
Check carrier (link detected):
cat /sys/class/net/eth0/carrier
Returns 1 for link up, 0 for no link.
This method is useful for scripting because it’s fast and doesn’t require parsing.
Using The Proc Filesystem
The `/proc/net/dev` file lists all interfaces with statistics. It’s not as human-friendly, but it’s great for automation.
cat /proc/net/dev
Output looks like:
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 127000 1000 0 0 0 0 0 0 127000 1000 0 0 0 0 0 0
eth0: 5000000 4500 0 0 0 0 0 0 2000000 3000 0 0 0 0 0 0
If an interface is missing from this list, it might be down or not configured.
Checking Interface Status Remotely
You can check interface status on remote servers using SSH. For example:
ssh user@server "ip link show eth0"
Or combine with `grep` to get just the state:
ssh user@server "ip link show eth0 | grep state"
This is handy for monitoring multiple machines.
Automating Interface Status Checks
You can write a simple script to check interfaces and alert you if one goes down. Here’s a bash example:
#!/bin/bash
for iface in /sys/class/net/*; do
name=$(basename "$iface")
state=$(cat "$iface/operstate")
echo "$name: $state"
done
Save it as `check_ifs.sh`, make it executable with `chmod +x`, and run it.
For more advanced monitoring, consider using `watch` to refresh every 2 seconds:
watch -n 2 "ip link show"
Common Interface Statuses And What They Mean
- UP – Interface is active and ready to send/receive data
- DOWN – Interface is disabled (administratively down)
- UNKNOWN – Usually loopback or a device that doesn’t report state
- LOWER_UP – Physical link is present (cable connected)
- NO-CARRIER – Interface is up but no physical connection
When you see state DOWN, the interface might be disabled by the system or manually taken down.
Troubleshooting With Interface Status
If your network isn’t working, start with these steps:
- Run
ip link showto see if the interface is UP - Check
ethtool eth0for link detection - Verify IP address with
ip addr show - Ping the gateway to test connectivity
If the interface is DOWN, bring it up with:
sudo ip link set eth0 up
Or using ifconfig:
sudo ifconfig eth0 up
If it still shows DOWN after bringing it up, check for hardware issues or driver problems.
Using Graphical Tools
If you’re on a desktop Linux, you can check interface status via GUI. Most desktop environments have a network icon in the system tray. Click it to see connection status.
For more detail, open Settings > Network. You’ll see wired and wireless connections with their status (Connected/Disconnected).
Some distros include GNOME Network Manager or KDE Plasma Network Manager with advanced options.
Checking Wireless Interface Status
For Wi-Fi interfaces, use `iwconfig` or `iw` commands.
Check with iwconfig:
iwconfig wlan0
Output shows ESSID, signal strength, and link quality.
With `iw`:
iw dev wlan0 link
This gives similar info in a cleaner format.
To see all wireless interfaces:
iw dev
Checking Bonded Interfaces
If you use network bonding (teaming), check the bond status with:
cat /proc/net/bonding/bond0
This shows which slave interfaces are up and the active slave.
You can also use:
ip link show bond0
Checking Virtual Interfaces
Virtual interfaces like VLANs, bridges, or Docker interfaces show up in `ip link show` as well. For example, Docker creates `docker0` bridge.
Check bridge status:
bridge link show
Or for VLANs:
ip link show eth0.100
Persistent Interface Status
Interface status changes are not persistent across reboots unless configured in network configuration files. To make an interface always up, edit the config file (e.g., `/etc/network/interfaces` on Debian or `/etc/sysconfig/network-scripts/ifcfg-eth0` on RHEL).
For example, on Debian/Ubuntu:
auto eth0
iface eth0 inet dhcp
The auto line brings it up at boot.
Using Systemd-Networkd
If your system uses systemd-networkd, check status with:
networkctl status
This shows all links and their state. For a specific interface:
networkctl status eth0
It gives a clean, color-coded output.
Checking Interface Status In Containers
Inside a Docker or LXC container, you can still use `ip link show` if the container has network tools. For minimal containers, check `/sys/class/net/`.
Example inside a container:
cat /sys/class/net/eth0/operstate
Common Mistakes When Checking Interface Status
- Forgetting to use `sudo` for ethtool or bringing interfaces up/down
- Confusing “state UP” with “LOWER_UP” – LOWER_UP means physical link is present
- Using `ifconfig` without `-a` and missing down interfaces
- Not checking both link state and IP configuration
Scripting Interface Status Checks
Here’s a Python script that checks all interfaces and prints their status:
#!/usr/bin/env python3
import os
net_path = '/sys/class/net'
for iface in os.listdir(net_path):
with open(f'{net_path}/{iface}/operstate') as f:
state = f.read().strip()
print(f'{iface}: {state}')
This is useful for integrating with monitoring systems.
Monitoring Interface Status Over Time
For long-term monitoring, use tools like `nload`, `iftop`, or `bmon`. These show real-time traffic and interface state.
Install them:
sudo apt install nload iftop bmon
Run `nload` to see bandwidth usage per interface. `iftop` shows traffic by connection. `bmon` gives a graphical view.
When To Use Each Method
- Quick check: `ip link show`
- Physical link details: `ethtool`
- IP configuration: `ip addr show`
- Scripting: `/sys/class/net/` files
- Remote monitoring: SSH with commands
- Real-time traffic: `nload` or `iftop`
Final Tips
Always start with `ip link show` – it’s the most reliable and universal method. If you need more detail, add `ethtool` for hardware info. For automation, use the sysfs files.
Remember that interface status can change due to cable pulls, switch reboots, or driver issues. Regular checks help catch problems early.
Frequently Asked Questions
How Can I Check Interface Status In Linux Without Using Commands?
You can check via the `/sys/class/net/` directory. For example, `cat /sys/class/net/eth0/operstate` shows if it’s up or down. This works without any command-line tools.
What Is The Difference Between “State UP” And “LOWER_UP”?
state UP means the interface is administratively enabled. LOWER_UP indicates the physical link (cable) is connected. An interface can be UP but not LOWER_UP if the cable is unplugged.
Why Does Ifconfig Show My Interface But Ip Link Show Doesn’t?
If `ifconfig` shows an interface but `ip link show` doesn’t, you might be using a different namespace or the interface is a virtual one that `ip` doesn’t list by default. Try `ip link show` with the interface name explicitly.
Can I Check Interface Status On A Remote Linux Server?
Yes, use SSH: `ssh user@server “ip link show eth0″`. You can also use monitoring tools like Nagios or Zabbix to check remotely.
How Do I Make An Interface Stay Up After Reboot?
Configure it in your network config files. On Debian/Ubuntu, add `auto eth0` in `/etc/network/interfaces`. On RHEL/CentOS, set `ONBOOT=yes` in `/etc/sysconfig/network-scripts/ifcfg-eth0`.