Skip to content

Networking

Use the iproute2 commands. ifconfig belongs to the net-tools package, which is not installed by default on RHEL 8 and later or on current Debian and Ubuntu releases, and which does not report everything the kernel now tracks.

Terminal window
ip link show # interfaces and their state
ip addr show # interfaces with their addresses
ip -br addr # one line per interface, easier to scan
ip route # the routing table

systemd assigns interface names derived from the device’s type and its physical location, so a name stays the same across reboots and kernel upgrades however many cards are fitted. The old eth0/wlan0 names were allocated in enumeration order, which could change between boots and therefore could not safely be referenced in configuration.

A name is a two-letter type prefix followed by a location:

PrefixDevice type
enEthernet
wlWireless LAN
wwWireless WAN (WWAN, for example a mobile broadband modem)
ibInfiniBand
slSerial line IP (SLIP)

The loopback interface keeps its fixed name, lo, and is not renamed by this scheme.

The location suffix says where the device is attached:

SuffixMeaning
o<index>On-board device, by firmware index
s<slot>Hotplug slot number
p<bus>s<slot>PCI geographic location: bus and slot
u<port>USB port chain
x<MAC>The device’s MAC address

So enp3s0 is an Ethernet device on PCI bus 3, slot 0.

NameMeaning
eth0, eth1Ethernet interface, numbered in enumeration order
wlan0, wlan1Wireless interface, numbered in enumeration order

These still appear where predictable naming has been disabled on the kernel command line, and inside containers and virtual machines whose interfaces are created by the hypervisor. Do not rely on the number: it describes the order the kernel found the device in, not the device.