When you work on a Linux server or local machine, quickly identifying network interfaces helps with troubleshooting and configuration. Learning how to list network interfaces in Linux gives you immediate visibility into connectivity, IP assignment, and device naming.
Below is a concise reference that maps out the key commands, expected outputs, and practical options you can use in day-to-day administration.
| Command | Scope | Human Readable | Machine Parse Friendly |
|---|---|---|---|
| ip link | All interfaces | Yes | No |
| ip -brief link | All interfaces | Yes | Partial |
| ifconfig | Active interfaces | Yes | No |
| nmcli device status | Managed by NetworkManager | Yes | Partial |
| ls /sys/class/net | Kernel exposed | Minimal | Yes |
Using ip command to list interfaces
The ip tool is the modern replacement for older ifconfig utilities and provides a consistent way to query interface details.
Basic listing with ip link
Running ip link shows state, index, and link-layer information for every interface, including those that are down.
Brief format with ip -brief link
Adding the -brief flag produces a compact table with interface names and operational state, similar to a concise version of ifconfig output.
Legacy ifconfig for quick checks
On many older systems and containers, ifconfig is still available and useful for a quick glance at IP addresses and flags.
Default ifconfig behavior
Running ifconfig without arguments displays details for interfaces that are currently active.
Showing all interfaces with ifconfig
Using ifconfig -a reveals interfaces even if they are administratively down or lack an assigned IP.
Using NetworkManager CLI
Systems managed by NetworkManager provide device status and connection profiles through the nmcli utility.
Device status overview
nmcli device status lists every managed device, its type, state, and connection name in a clean columnar view.
Detailed device information
nmcli device show exposes underlying properties such as driver, MAC address, and IPv4 or IPv6 settings.
Exploring the kernel interface
The /sys filesystem exposes raw device attributes that you can use in scripts or for very specific queries.
Listing interfaces via sysfs
Simply listing /sys/class/net returns short interface names without extra metadata, ideal for lightweight checks.
Parsing with standard tools
Piping the sysfs output into while read loops enables custom processing, such as filtering by name pattern or feeding into other scripts.
Key takeaways for listing network interfaces
- Prefer
ip linkorip -brief linkfor consistent, distribution-agnostic output. - Use
ifconfig -awhen dealing with legacy environments or minimal containers. - Leverage
nmcli device statuson systems managed by NetworkManager for state and connection context. - Inspect
/sys/class/netfor lightweight, script-friendly interface names. - Filter by state and device type to match the exact troubleshooting or automation scenario.
FAQ
Reader questions
How do I list only UP interfaces on Linux
Pipe the output of ip -brief link show up or ifconfig to see interfaces that are currently in the UP state with an operational link.
Can I list wireless interfaces separately
Use iw dev or query /sys/class/net/*/type to identify interfaces that expose wireless capabilities and separate them from Ethernet or loopback devices.
What if a command is not found on my system
Install the relevant package, such as iproute2 for ip, net-tools for ifconfig, or ensure NetworkManager tools are present in your distribution.
How do I include VLAN interfaces in the list
VLAN interfaces usually appear in standard listings after the base device; use ip link show type vlan or inspect /sys/class/net to confirm their presence.