Network interface names by using udev rules

From Notes to self
Revision as of 16:18, 13 December 2023 by Verbovet (talk | contribs) (Created page with "* Check current interfaces names and mac addresses: <code># ip link show</code> *Find the device type id of the interface (for example, <code>eth0</code>): <pre> # cat /sys/class/net/eth0/type 1</pre> * <code>/etc/udev/rules.d/70-persistent-net.rules</code>: <pre> SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="11:22:33:44:55:ab",ATTR{type}=="1",NAME="eth0" ... </pre> * Regenerate the initrd")
(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