• Start Here
    • How to Install Linux
    • Which Distro To Choose
    • 10 Best Linux Distributions of 2023
  • Distros
    • Ubuntu
  • Linux Commands
  • Virtualization
  • Open Source
Linux Start
  • Start Here
    • How to Install Linux
    • Which Distro To Choose
    • 10 Best Linux Distributions of 2023
  • Distros
    • Ubuntu
  • Linux Commands
  • Virtualization
  • Open Source
Linux Start
Home»Distros»Ubuntu»How To List Network Interfaces On Ubuntu

How To List Network Interfaces On Ubuntu

Anup ThapaBy Anup ThapaApril 28, 2023 Ubuntu 3 Mins Read

Ubuntu assigns names to NICs using Predictable Network Interface Names. Ethernet interfaces are prefixed with en, wireless with wl, virtual with vir, and so on. This consistent naming scheme makes it easy to identify the interfaces. There are numerous ways to view and configure such network interfaces on Ubuntu.

List Adapters with lshw

lshw is used to get detailed info on a system’s hardware configuration. You can use it to list the installed physical network adapters by specifying the network class.

sudo lshw -class network

If you have multiple adapters installed, this is the best way to identify which interface corresponds to which device. Or if you don’t need the details and only want to shortlist them, you can use

sudo lshw -c network -short

List Connections with nmcli

Ubuntu uses the NetworkManager backend by default. You can use nmcli to query the state of NetworkManager and extract info relating to the network interfaces (both physical and logical).

Without any options, nmcli lists all the interfaces, where they’re connected to, and various network parameters (IP Address, MAC Address, etc.).

nmcli

nmcli connection show provides an overview of the active connection profiles only. nmcli device status does the same as well.

nmcli c show
nmcli d status

On the other hand, nmcli device show provides more detailed info on all known devices. 

nmcli d show

Use ip to List Interfaces

The ip link command is used to configure the state of network devices. Since we’re only trying to list the interfaces, we can use ip link show. This can be shortened to ip link or ip l.

ip l

The ip address command is used to view and configure the IP address assigned to network interfaces. In doing so, it lists the interfaces as well. Like earlier, we can shorten ip address show to ip addr or ip a.

ip a  

Use net-tools (Deprecated)

Various utilities from the net-tools package can list network interfaces. The other methods from this list are preferred as net-tools is actually deprecated, but these commands still work for now.

You can use ifconfig without any flags as its default behavior is to display network interfaces.

ifconfig

With netstat, you have to use the interfaces option.

netstat -i

Other Ways to List Network Interfaces

The /proc and /sys directories provide an interface to read system and device stats. Although a bit unorthodox, you can directly read the net and dev files from these directories to view the list of network interfaces.   

ls /sys/class/net/
cat /proc/net/dev

Or, if you have some hardware or networking utilities like hwinfo or iwconfig installed, you can use those to list network interfaces as well.

sudo hwinfo --short --network
iwconfig
Anup Thapa
  • LinkedIn

Anup Thapa is a Linux enthusiast with an extensive background in computer hardware and networking. At LinuxStart, Anup is an integral part of our editorial team. His goal is to effectively communicate technical concepts in a simplified form understandable by new Linux users. To this end, he mainly writes beginner-friendly tutorials and troubleshooting guides. Outside of work, he enjoys experimenting with different Linux distros and reading up on things like networking and virtualization.

Leave A Reply Cancel Reply

Table of Contents
  • List Adapters with lshw
  • List Connections with nmcli
  • Use ip to List Interfaces
  • Use net-tools (Deprecated)
  • Other Ways to List Network Interfaces
Linux Start
Guides

What is the Linux Kernel?

The Linux Kernel is the core of the Linux operating system and is central to…

How To Install Linux Mint

How To Install Linux on VirtualBox

Getting Started with Linux

How to Install Linux

10 Best Linux Distros of 2023

Which Linux Distro Should You Choose? A Complete Guide to Help You Decide

© 2023 LinuxStart.com

Type above and press Enter to search. Press Esc to cancel.