Due to hardware reasons, we have to rename our network interfaces. Because we have to do that on all our boards, for which we do not know the mac address.
We are doing it currently with systemd .link files, which look like this:
[Match]
Path=<path-name>
[Link]
Description=<driver-name>,mainboard
NamePolicy=keep
Name=eth0
Due to legal and software reasons, we have to get rid of systemd. So how can we formulate these files into plain udev rules?
I ended up with this:
SUBSYSTEM=="net", ACTION=="add", ENV{ID_PATH}=="<path-name>", NAME="eth0"
called it 10-rename-eth0.rules
and placed it into /etc/udev/rules.d/
, but it did not work.
I also tried to add the following statements to the rule:
ATTR{dev_id}=="0x0",
ATTR{type}=="1",
KERNEL=="end0"
but it still did not work.
I put these rules together from these links:
[solved] Rename network interface without using MAC addresstext
Setting persistent name for usb serial device with udev rule without symlink
Udev : renaming my network interface
and some others and of course I read the udev manpage.
What am I doing wrong?