List Network Interfaces on Linux Systems (and others)

Show Network Interfaces

The network configuration is a common place to start during system configuration, security audits, and troubleshooting. No surprise that Lynis helps with collecting information about network interfaces, like MAC and IP addresses. We will have a look on how to gather this information yourself, like listing all available interfaces. Although we focus a lot here at Linux, we will include tips for other platforms, like macOS.

Network configuration


Previously the most obvious command to obtain the available network interfaces, was using the ifconfig command. As some systems no longer have that command installed by default, we will also look at using alternative ip. So if you have ifconfig available, run it with the -a parameter.

ifconfig -a | grep Link

Depending on what particular information you need, you can use grep to get you the right lines. The ifconfig command on Linux actually has the most option available, so have a look at the man page for all details.

As described, newer Linux distributions now ship only the ip command. The easiest way to see what connections you have available, is showing the available links.

ip link show

Screenshot showing ip command, an alternative to ifconfig

Linux Network Interfaces with ip link show

AIX and Solaris

These two old style platforms have of course ifconfig still available. By using the -a parameter, all interfaces will be displayed.

ifconfig -a | grep "flags="

To see only the interfaces which are active, add the -u (up) parameter.

DragonBSD, FreeBSD, NetBSD

On the systems running BSD, it is also the ifconfig tool that can be used.

ifconfig -l


One more thing...

Keep learning

So you are interested in Linux security? Join the Linux Security Expert training program, a practical and lab-based training ground. For those who want to become (or stay) a Linux security expert.

See training package

Lynis Enterprise screenshot to help with system hardeningSecurity scanning with Lynis and Lynis Enterprise

Run automated security scans and increase your defenses. Lynis is an open source security tool to perform in-depth audits. It helps with system hardening, vulnerability discovery, and compliance.


One comment

  • ZoidZoid

    Three more low-level ways:

    cat /proc/net/dev
    ls /sys/class/net
    find /sys/devices -name ‘mtu’


Leave a Reply

Your email address will not be published. Required fields are marked *