Ethernet interface names on Vultr

Hello.

When using the CoreOS images on Vultr, the name of the ethernet interface that’s connected to the public internet is always (so far!) called enp1s0.

When using their “virtual private cloud” feature, the VM will also be given another ethernet interface in addition to enp1s0 that’s connected some kind of software-defined private network.

In the past, this interface was named enp6s0. This seemed to be consistent for months across all of the virtual machines I deployed, so it was hardcoded into the ignition files.

Then, of course, at some point the interface suddenly became enp7s0 after a CoreOS update. Now it’s enp8s0!

Clearly I’m not supposed to be guessing the interface names ahead of time, but I’m not sure how else I’m supposed to put the interface-specific configuration into the ignition file if I don’t know the name of the interface. I’m not sure there’s even any metadata associated with either interface so that I can tell them apart.

Are the interface names supposed to be stable and aren’t due to a bug? Or is there some other way I’m supposed to configure interfaces?

One can create a udev rule to force the system to always assign the same name to the same interface. Doing so avoids the changes you are seeing.

Read up on udev and how to create a rule file for that purpose.
Files for this purpose would be placed in /etc/udev/rules.d and information about using udev can be found using the man pages. Start with man udev.conf

Thanks, I’ll take a look.

I’m not sure exactly where the change came from (I haven’t seen any other reports of this), but that doesn’t mean the behavior didn’t change. Do you happen to know which update changed the behavior? And if you go back to the update before that does the behavior revert. If you know the package set that got updated you may be able to pinpoint which package (i.e. kernel or systemd probably) brought in the change.

The names are supposed to be stable, but int depends on how the PCI interfaces are enumerated, and that could change with chnages in installed hardware or perhaps even a new kernel.

Currently this is controlled by the .link files in /usr/lib/systemd/network or /etc/systemd/network. The default is found in /usr/lib/systemd/network/99-default.link

The details is found in man systemd.link and man systemd.net-naming-scheme

There is also a general description at https://systemd.io/PREDICTABLE_INTERFACE_NAMES/