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?

share|improve this question
    
As far as I recall it should be GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=1 biosdevname=0" – Doug Smythies Jul 27 '16 at 0:33
    
net.ifnames=1 enables 'predictable' names (ens3 etc) – insertjokehere Jul 27 '16 at 2:04
    
Yes, it seems inconsistent. What I mentioned used to work on 14.04. I gave up on 16.04, and now use the new interface names. see also here and here. – Doug Smythies Jul 27 '16 at 15:23

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"
share|improve this answer
    
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 1:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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