Network interface names by using udev rules

From Notes to self
Revision as of 12:23, 2 January 2024 by Verbovet (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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