Question

I am running CentOS 5.5 as VirtualBox guest on a Win 7 host.

It is a common problem in the forums that moving images across VMs encounters networking issues due to the MAC address persistence in /etc/udev/rules.d/70-persistent-net.rules. A solution typically proposed is to delete this file and reboot for it to be automatically regenerated.

In my case however, I cannot get the file to regenerate, despite multiple reboots with different VM network interface options. I became fairly hopeful when introduced to udevadm on an Ubuntu forum but could not find an equivalent for CentOS.

Specifying the new MAC address in /etc/sysconfig/network-scripts/ifcfg-eth0 has not helped, and neither has playing around with different network configurations in the manager.

Any pointers/assistance much appreciated.

Was it helpful?

Solution

I'm not a Centos expert, but know why this doesn't work in Ubuntu and a couple of other distributions. Have a read of the file which generates it which is normally /lib/udev/rules.d/75-persistent-net-generator.rules.

You will note that it will skip various types of ethernet interface, depending on MAC address and subsystem (i.e. where the interface comes from). Here's one from a RHEL like distro that skips Xen:

# ignore Xen virtual interfaces
SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end"

Here are some from Ubuntu that skip other hypervisors:

# ignore KVM virtual interfaces
ENV{MATCHADDR}=="52:54:00:*", GOTO="persistent_net_generator_end"
# ignore VMWare virtual interfaces
ENV{MATCHADDR}=="00:0c:29:*|00:50:56:*", GOTO="persistent_net_generator_end"
# ignore Hyper-V virtual interfaces
ENV{MATCHADDR}=="00:15:5d:*", GOTO="persistent_net_generator_end"
# ignore Eucalyptus virtual interfaces
ENV{MATCHADDR}=="d0:0d:*", GOTO="persistent_net_generator_end"
# ignore Ravello Systems virtual interfaces
ENV{MATCHADDR}=="2c:c2:60:*", GOTO="persistent_net_generator_end"

As you can see, your distro is probably skipping the generation of net rules on VM interfaces, precisely because its normally annoying. For instance if you take a templated VM image with this file in, and rehydrate it elsewhere and it gets a different MAC, you don't normally want your eth0 to disappear and you to get a new eth1 instead. If you don't like this, you can introduce your own rules.d file to handle the persistent rules generation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top