Network interface names - 20.04 on RPi

I recently downloaded and installed the Ubuntu 20.04.2 LTS pre-configured image file for the RPi, and am setting it up on a RPi4 8gb unit.

I was expecting to see the newer predictable/consistent network interface names, but instead it seems to default to the ‘old’ names like ‘eth0’ and ‘wlan0’.

I’m still a little confused as to why they (Canonical) would revert to the older naming schema, given the big ‘push’ across almost every distro over the last 5+ years towards the new style. I can kind of understand it, in the sense that the stock hardware setup of a RPi is extremely unlikely to have more than one ethernet or wifi interface, so ‘eth0’ and ‘wlan0’ are pretty safe names. But… it does seem short-sighted in that it seems to be borrowing trouble if someone adds a USB dongle for either an extra ethernet port, or an extra wireless radio (create an AP).

I guess the ‘why’ is neither here nor there… what I’m curious about is whether there is an easy way to change the system back to the (new) normal network interface naming convention. Any ideas?

I don’t know all the reasons, but, the naming convention of the nic devices are not just some random numbers, they correlate to Bus:Device.Function(BDF). I could be wrong, but, I don’t think the PI’s ever had a PCI nic card.

The correlations below are:

  • Device (en)
  • Prefix/Bus Number (p5)
  • Slot/Device Number (s0)
  • Function Number (0)

Example-1

sudo lshw -c network -businfo

Bus info          Device          Class          Description
============================================================
pci@0000:05:00.0  enp5s0          network        I211 Gigabit Network Connection
pci@0000:06:00.0  wlp6s0          network        Wi-Fi 6 AX200

Example-2

lspci -D | grep 'Network\|Ethernet'

0000:05:00.0 Ethernet controller: Intel Corporation I211 Gigabit Network Connection (rev 03)
0000:06:00.0 Network controller: Intel Corporation Wi-Fi 6 AX200 (rev 1a)

Example-3

grep PCI_SLOT_NAME /sys/class/net/*/device/uevent

/sys/class/net/enp5s0/device/uevent:PCI_SLOT_NAME=0000:05:00.0
/sys/class/net/wlp6s0/device/uevent:PCI_SLOT_NAME=0000:06:00.0

More info on Bus:Device.Function(BDF)

1 Like

I forgot to mention renaming. Renaming NIC cards, particularly on system that have several (many), is common through the use of persistent Udev rules. I’ve used them for USB Sound devices (multiple sound cards), and there’s all kinds of How-To’s floating around that cover the subject of Nics is much grater detail than I can.

And here’s an example of a Ubuntu Server running in a Container via Promxmox on a different machine than the examples above.

Note that eth0 doesn’t have an PCI DBF associated with it. That is the NIC card assigned in the network section of creating the CT image.

sudo lshw -c network -businfo

Bus info          Device   Class          Description
=====================================================
pci@0000:05:00.0           network        I211 Gigabit Network Connection
pci@0000:06:00.1           network        RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
                  eth0     network        Ethernet interface

From the Proxmox CT

eth0-example