Search Authority

How to List Network Interfaces in Linux - GeeksforGeeks

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...

Mara Ellison
How to List Network Interfaces in Linux - GeeksforGeeks

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.

Running ip link shows state, index, and link-layer information for every interface, including those that are down.

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 link or ip -brief link for consistent, distribution-agnostic output.
  • Use ifconfig -a when dealing with legacy environments or minimal containers.
  • Leverage nmcli device status on systems managed by NetworkManager for state and connection context.
  • Inspect /sys/class/net for 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.

Related Reading

More pages in this topic cluster.

Brigand (Fire Emblem):角色 profile 与战斗指南

在 Fire Emblem 系列中,Brigand 是一种以近战物理为特色的敌我通用职业,通常使用刀剑或斧头,偏向高机动与中等攻击的组合。相较于 Sw...

Read next
Cleo in King's Raid:角色背景、定位与养成指南

Cleo 是 King's Raid 中以机动性与持续输出见长的角色,主要承担副输出或功能型前锋职责。她在队伍中的核心价值体现在灵活切入战场、...

Read next
Oldest Ice Skater: Defying Age on the Ice

The title of oldest ice skater often refers to dieners who have competed or performed well into their eighties and nineties. These athletes combine decades of training with bala...

Read next