$ udevadm test-builtin net_id /sys/class/net/enxb827eb3eabfb
Load module index
Parsed configuration file /usr/lib/systemd/network/99-default.link
Parsed configuration file /usr/lib/systemd/network/73-usb-net-by-mac.link
Created link configuration context.
Using default interface naming scheme 'v245'.
ID_NET_NAMING_SCHEME=v245
ID_NET_NAME_MAC=enxb827eb3eabfb
ID_OUI_FROM_DATABASE=Raspberry Pi Foundation
Unload module index
Unloaded link configuration context.
/usr/lib/systemd/network/73-usb-net-by-mac.link is the systemd policy file that handles the renaming of eth0.
Don't know if that's the right way to do this. Also, wlan0 still has a non-persistent name, so that needs to be addressed too if we want to go that route.
The default for both core20 and server is 'net.ifnames=0' which disables persistent network interface names so it's expected to see eth0 and wlan0.
cat /proc/cmdline fb.fbwidth= 1280 bcm2708_ fb.fbheight= 1024 bcm2708_fb.fbswap=1 smsc95xx. macaddr= DC:A6:32: 08:85:96 vc_mem. mem_base= 0x3ec00000 vc_mem. mem_size= 0x40000000 net.ifnames=0 dwc_otg. lpm_enable= 0 root=LABEL=writable rootfstype=ext4 elevator=deadline rootwait fixrtc console=tty1 console= ttyS0,115200 quiet splash
coherent_pool=1M 8250.nr_uarts=1 bcm2708_
However, if I drop 'net.ifnames=0' from cmdline.txt I *do* get a persistent name on a 3B+ but *not* on a 4B.
On a Pi 3B:
$ udevadm info /sys/class/ net/enxb827eb3e abfb platform/ soc/3f980000. usb/usb1/ 1-1/1-1. 1/1-1.1. 1/1-1.1. 1:1.0/net/ enxb827eb3eabfb /devices/ platform/ soc/3f980000. usb/usb1/ 1-1/1-1. 1/1-1.1. 1/1-1.1. 1:1.0/net/ enxb827eb3eabfb enxb827eb3eabfb D=5428547 NAMING_ SCHEME= v245 NAME_MAC= enxb827eb3eabfb FROM_DATABASE= Raspberry Pi Foundation INTERFACES= :ff00ff: INTERFACE_ NUM=00 DRIVER= lan78xx CLASS_FROM_ DATABASE= Vendor Specific Class FROM_DATABASE= Microchip Technology, Inc. (formerly SMSC) platform- 3f980000. usb-usb- 0:1.1.1: 1.0 TAG=platform- 3f980000_ usb-usb- 0_1_1_1_ 1_0 DRIVER= lan78xx LINK_FILE= /usr/lib/ systemd/ network/ 73-usb- net-by- mac.link NAME=enxb827eb3 eabfb ALIAS=/ sys/subsystem/ net/devices/ enxb827eb3eabfb
P: /devices/
L: 0
E: DEVPATH=
E: INTERFACE=
E: IFINDEX=2
E: SUBSYSTEM=net
E: USEC_INITIALIZE
E: ID_MM_CANDIDATE=1
E: ID_NET_
E: ID_NET_
E: ID_OUI_
E: ID_VENDOR=0424
E: ID_VENDOR_ENC=0424
E: ID_VENDOR_ID=0424
E: ID_MODEL=7800
E: ID_MODEL_ENC=7800
E: ID_MODEL_ID=7800
E: ID_REVISION=0300
E: ID_SERIAL=0424_7800
E: ID_TYPE=generic
E: ID_BUS=usb
E: ID_USB_
E: ID_USB_
E: ID_USB_
E: ID_USB_
E: ID_VENDOR_
E: ID_PATH=
E: ID_PATH_
E: ID_NET_
E: ID_NET_
E: ID_NET_
E: SYSTEMD_
E: TAGS=:systemd:
$ udevadm test-builtin net_id /sys/class/ net/enxb827eb3e abfb systemd/ network/ 99-default. link systemd/ network/ 73-usb- net-by- mac.link NAMING_ SCHEME= v245 NAME_MAC= enxb827eb3eabfb FROM_DATABASE= Raspberry Pi Foundation
Load module index
Parsed configuration file /usr/lib/
Parsed configuration file /usr/lib/
Created link configuration context.
Using default interface naming scheme 'v245'.
ID_NET_
ID_NET_
ID_OUI_
Unload module index
Unloaded link configuration context.
/usr/lib/ systemd/ network/ 73-usb- net-by- mac.link is the systemd policy file that handles the renaming of eth0.
On a Pi 4B:
$ udevadm info /sys/class/net/eth0 platform/ scb/fd580000. ethernet/ net/eth0 /devices/ platform/ scb/fd580000. ethernet/ net/eth0 D=2348632 NAMING_ SCHEME= v245 NAME_MAC= enxdca632088596 FROM_DATABASE= Raspberry Pi Trading Ltd platform- fd580000. ethernet TAG=platform- fd580000_ ethernet DRIVER= bcmgenet LINK_FILE= /usr/lib/ systemd/ network/ 99-default. link ALIAS=/ sys/subsystem/ net/devices/ eth0
P: /devices/
L: 0
E: DEVPATH=
E: INTERFACE=eth0
E: IFINDEX=2
E: SUBSYSTEM=net
E: USEC_INITIALIZE
E: ID_MM_CANDIDATE=1
E: ID_NET_
E: ID_NET_
E: ID_OUI_
E: ID_PATH=
E: ID_PATH_
E: ID_NET_
E: ID_NET_
E: SYSTEMD_
E: TAGS=:systemd:
$ udevadm test-builtin net_id /sys/class/net/eth0 systemd/ network/ 99-default. link systemd/ network/ 73-usb- net-by- mac.link NAMING_ SCHEME= v245 NAME_MAC= enxdca632088596 FROM_DATABASE= Raspberry Pi Trading Ltd
Load module index
Parsed configuration file /usr/lib/
Parsed configuration file /usr/lib/
Created link configuration context.
Using default interface naming scheme 'v245'.
ID_NET_
ID_NET_
ID_OUI_
Unload module index
Unloaded link configuration context.
systemd can't handle the platform attached bcmgenet driver of the Pi 4B so hence no renaming.
I've created the following systemd file
$ cat /etc/systemd/ network/ 73-platform- net-by- mac.link *.ethernet
[Match]
Path=platform-
[Link]
NamePolicy=mac
rebooted and ended up with a persistent net name for eth0:
$ udevadm info /sys/class/ net/enxdca63208 8596 platform/ scb/fd580000. ethernet/ net/enxdca63208 8596 /devices/ platform/ scb/fd580000. ethernet/ net/enxdca63208 8596 enxdca632088596 D=2337681 NAMING_ SCHEME= v245 NAME_MAC= enxdca632088596 FROM_DATABASE= Raspberry Pi Trading Ltd platform- fd580000. ethernet TAG=platform- fd580000_ ethernet DRIVER= bcmgenet LINK_FILE= /etc/systemd/ network/ 73-platform- net-by- mac.link NAME=enxdca6320 88596 ALIAS=/ sys/subsystem/ net/devices/ enxdca632088596 /sys/subsystem/ net/devices/ enxdca632088596
P: /devices/
L: 0
E: DEVPATH=
E: INTERFACE=
E: IFINDEX=2
E: SUBSYSTEM=net
E: USEC_INITIALIZE
E: ID_MM_CANDIDATE=1
E: ID_NET_
E: ID_NET_
E: ID_OUI_
E: ID_PATH=
E: ID_PATH_
E: ID_NET_
E: ID_NET_
E: ID_NET_
E: SYSTEMD_
E: TAGS=:systemd:
Don't know if that's the right way to do this. Also, wlan0 still has a non-persistent name, so that needs to be addressed too if we want to go that route.