Networking – Predict Network Interface Names in Wily/Xenial

networkingudev

I usually install systems with debootstrap. As part of the script, I add the interface eth0 to /etc/network/interfaces.

But with Wily changing to persistent network interfaces, this doesn't work anymore, since, while it may be persistent, the name is also unpredictable (e.g. something like enp0s3).

How should I adjust? Is there any way to know what the interface name will be? To deactivate persistent names? Or is the only solution to defer that configuration to the first boot, for instance by using a systemd oneshot service?

Best Answer

Yes, in my opinion, this stuff is a little inconsistent. I now use the following line in grub:

GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=1 biosdevname=0"

and things are the way they used to be (although I haven't tried it in Wily). See also.

Related Question