Network interface names by using udev rules

From Notes to self
Jump to navigation Jump to search
  • Check current interfaces names and mac addresses:

# ip link show

  • Find the device type id of the interface (for example, eth0):
# cat /sys/class/net/eth0/type
1
  • /etc/udev/rules.d/70-persistent-net.rules:
SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="11:22:33:44:55:ab",ATTR{type}=="1",NAME="eth0"
...
  • Regenerate the initrd