Skip to content

Instantly share code, notes, and snippets.

@plembo
Last active May 10, 2026 14:48
Show Gist options
  • Select an option

  • Save plembo/ea11a12102a5cceaeba322139b7f79ec to your computer and use it in GitHub Desktop.

Select an option

Save plembo/ea11a12102a5cceaeba322139b7f79ec to your computer and use it in GitHub Desktop.
Make Linux interface names more predictable with udev

Use udev rules to lock in Linux ifnames

Create a udev rule to lock in the physical network interface name assigned by Linux, so that the system won't change it the next time a PCI device is added or removed.

Create /etc/udev/rules.d/10-network-names.rules, and then edit as follows:

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="xx:xx:xx:xx:xx:xx", NAME="enpNxN"

"ATT{address}" is unique MAC of the physical network device (seen in output of ip addr), while "NAME" is the interface name assigned to it by Linux (this will usually be something like "enp6s0".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment