Cannot re-assign network interface names

JustaGuy

Renowned Member
Jan 1, 2010
324
2
83
On a Debian Squeeze KVM guest, 70-persistent-net.rules is not generated.

When I create 010_netinterfaces.rules, it's settings are not applied.

As such, I am unable to explicitly define interface names.

-

I found this statement in Debian bug report 562211, that says this is a feature.

Apparently there's a function of udev to blacklist virtualized MAC addresses, as defined in /lib/udev/rules.d/75-persistent-net-generator.rules.

I took a look at the file, and I see a section mentioning a whitelist, but I'm at a loss as to how to go about adding the range used by the guest.

Does anyone know how to make this work?
 
What finally ended up happening to make the interfaces have the proper names, is I copied the contents of the PVE host's /etc/udev/rules.d/70-persistent-net.rules into a text file on my desktop to use as a template.

Then on the guest I issued
Code:
# udevadm info -a -p /sys/class/net/eth0
..for each eth device to confirm the values in the /etc/udev/rules.d/70-persistent-net.rules template would be valid in this machine.

This I edited it to include the MAC addresses assigned by QEMU and match them to the desired eth number, and saved the file on the remote KVM guest as:
/etc/udev/rules.d/70-persistent-net.rules

In this case I didn't have to because it didn't exist, but if you have the file:
/etc/udev/rules.d/75-persistent-net-generator.rules, the possibility exists that the file just created could be overwritten automatically one day.

If that's the case on your machine, disable it from being regenerated by issuing the following command that renames the file so it cannot run:
Code:
#mv /etc/udev/rules.d/75-persistent-net-generator.rules /etc/udev/rules.d/75-persistent-net-generator.rules.disabled
 
Thanks a lot, I had the the same trouble, two nodes one day with eth6 instead of eth0...(Proxmox 2.6.18)...and always rewritten...