Friday, July 1, 2022

Devuan / Debian renaming ethernet interfaces

Create /etc/udev/rules.d/70-netinterfaces.rules file. Put this inside it:

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="d4:f5:ef:4c:d2:64", NAME="eth0lan"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="d4:f5:ef:4c:d2:65", NAME="eth1wlan"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="d4:f5:ef:4c:d2:66", NAME="eth2"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="d4:f5:ef:4c:d2:67", NAME="eth3inet"

Based on MAC address you can change the name of your network interfaces.

Now udev rules should be put in your initrd image. To do that you need to run:

root@son:~# update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.10.0-15-amd64

Reboot and you should see your new network names.

No comments: