Recent version of Ubuntu and Debian (stretch) bring a new network interface naming scheme.

Now, when updating from a system that's using old style names like "eth0", I'd like to know prior to booting what the new name will be.

How can I do this? Is there a magic invocation of "systemd" I can use to edit /etc/network/interface befor booting (and subsequently losing network connectivity)?

There's two different schemes available: biosdevname vs predictable network interface name.

biosdevname

Biosdevname seems to be the default in ubuntu. It is activated by installing the biosdevname package.

The biosdevname of an interface can be found with:

biosdevname -i eth0

Predictable network interface names

I believe this is the default in Debian stretch, but needs to be explicitly enabled on upgrade from previous releases.

The predictable name for eth0 can be found with:

udevadm test-builtin net_id /sys/class/net/eth0 | grep '^ID_NET_NAME_'
  • Though the actual answer on how to predict "prior to booting what the new name will be" (according to the link provided by @Neil) is the new name will be the same as the old name, because there are still udev rules which configure the old names in /etc/udev/rules.d/70-persistent-net.rules. The link will provide a migration guide, if you want to switch to new naming scheme. – Tuomas Aug 12 at 14:04

The new scheme is apparently called "predictable network interface names" but I'm not finding a lot of documentation on how to actually predict the name. Everything I've found about it basically points to this source code comment (which itself points back to the first link). From the comment, it's not clear at all how to know which addressing scheme udev is going to use for the network device name.

Per the first link, you can disable it and use the traditional names by adding net.ifnames=0 on the kernel command line in Grub. According to this comment it might be necessary if you plan on creating a VLAN tagged interface, since the added extension will make the interface name too long.

Otherwise, it might be better to re-ask the question to explain what you're trying to do with the name (eg configure the interface through ansible or something similar)

I'm not sure if this is still the case with updated versions, but on my old systems I was able to create an empty file at /etc/udev/rules.d/80-net-name-slot.rules and it would disable the "predictable" naming feature. You can also create your own rule and name the interfaces by yourself based on mac address or PCI/USB connections.

This documentation might help a little bit. See the section under "What precisely has changed in v197?". Yes, I realize this is of somewhat limited value, but it might give you an avenue for further research.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.