3

I'm running a few Ubuntu Xenial instances on an Openstack private cloud, and running into trouble with predictable network interface naming. I've tried to disable it by setting GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0" in /etc/default/grub. After rebooting, the first network interface still has its old 'predictable' name (ens3), but the second interface has its old name (eth1).

dmesg has [ 1.403328] virtio_net virtio0 ens3: renamed from eth0

How do I configure Ubuntu so my first network interface is named eth0?

insertjokehere
  • 131
  • 1
  • 2

2 Answers2

1

I think that the cleaner solution is:

sudo ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules

and reboot. This will bring back the old interface naming.

If you want to assign specific network interfaces names, and you have persistent mac addresses, then you can follow heynnema's solution or use a systemd.link.

chefarov
  • 201
0

Edit your /etc/udev/rules.d/70-persistent-net.rules. The format is pretty simple. Only 1 line per interface, and just copy/paste an existing line, and change the mac address and the device name.

Here's what an entry looks like:

# PCI device 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="20:1a:06:d8:65:ae", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
heynnema
  • 70,711
  • That's fine when you've got a couple of machines, but trying to scale that to dozens or hundreds of machines isn't really viable. Besides, that's just undoing the change after its been made, what I'm trying to is stop it from being renamed in the first place – insertjokehere Jul 27 '16 at 01:59