[systemd-devel] How to set both name and altname of a NIC with a given device_addr

Lars Petter Mostad larspm at gmail.com
Mon May 27 14:59:54 UTC 2024


Hi,

Currently I'm using a udev rule to set a known name for a network
interface connected
to certain pins on an SoC, then I use a .link file to set altnames for
that interface.
The udev rule matches the base address of the memory mapped registers of the MAC
connected to the given pins (e.g. ATTR{device_addr}=="1af0000"). The .link file
matches the OriginalName set by the udev rule.

This works with v250, but altnames are not being applied with v255,
probably due to
commit 9094ae52 (udev/net: assign alternative names only on add
uevent). I get the message
"Skipping to apply AlternativeNames= and AlternativeNamesPolicy= on
'move' uevent.".a

I have tried moving name and altname assignment to the .link file by matching on
Property=ATTR{device_addr}=1af0000, but then I get "Invalid property or value,
ignoring assignment: ATTR{device_addr}=1af0000".

Is there some way to match on device_addr in .link files, or set
altnames in udev rules?

Regards,
Lars Petter


More information about the systemd-devel mailing list