{ 18 comments… read them below or add one }

1 Sudanking July 11, 2011 at 12:12 pm

Nice topic.

I faced this problem before, but I solve when I change old mac address with new MAC I get from VMWare inside “70-persistent-net.rules” file.


2 less November 16, 2011 at 7:17 pm

removing /etc/udev/rules.d/cp 70-persistent-net.rules worked for me



3 Buzz January 4, 2012 at 11:42 am

Thanks for this, resolved my issue after some head scratching, also note this bug here: https://bugzilla.redhat.com/show_bug.cgi?id=493995 which claims this is/was an anaconda bug, and should be resolved in later versions.


4 Andreas February 12, 2012 at 6:25 pm

Saved me a lot of work. Thanks for the article!


5 denicfr April 30, 2012 at 10:42 am

This can be easily fix with this kind of script :

# Annoying bug in vmware guest centos6
# eth0 doesn't exist
ifconfig eth0 2>/dev/null >/dev/null
if [ $? -ne 0 ] ; then
        # Rename eth1 with eth0
        echo "UDEV Config..."
        rm /etc/udev/rules.d/70-persistent-net.rules
        # Change ifcfg-eth0 with hostname address (in /etc/hosts)
        echo "Changing eth0 address..."
        mac=`ifconfig eth1 | grep eth1 | awk '{ print $5}'`
        ip=`grep $hostname /etc/hosts|cut -s -f 1`
        rm -f /etc/sysconfig/network-scripts/ifcfg-eth1
        cfg=`grep -v IPADDR /etc/sysconfig/network-scripts/ifcfg-eth0 |grep -v HWADDR`
        echo "$cfg" > /etc/sysconfig/network-scripts/ifcfg-eth0
        echo "HWADDR=\"$mac\"" >> /etc/sysconfig/network-scripts/ifcfg-eth0
        echo "IPADDR=\"$ip\"" >> /etc/sysconfig/network-scripts/ifcfg-eth0
        # Apply changes
        echo "Applying changes..."
        service network stop
        service NetworkManager stop
        ifconfig eth1 down
        udevadm trigger
        udevadm control --reload-rules
        service network start
        service NetworkManager start
I had it in a .conf file /etc/init/.
I hope it helps...


6 PatLh March 10, 2013 at 4:07 am

It helps for sure…
Just installed ur script in a template and called by /etc/rc.d/rc.local !
works perfectly when deploying a new VM. Your script is really helpfull thanks a lot ! great stuff… :-)

BTW Nixcraft when you say “My guess is my network card switched names or renamed eth0 and eth1 as eth1 and eth2.”
Wrong guess, it’s because of VmWare reassigning new mac address to your clone… then udev create a new rule so eth0 always end as eth1 in your clone.

Martin Allert go it right about deleting mac address reference in template. It’s the way to workaround and fix this problem.
I still don’t understand why Redhat still bind mac address to ethernet card … can’t work at all in a virtual environment as hypervisor deciding about hardware stuff!
And nowadays 70% more Linux servers are virtual… go figure !


7 Martin Allert June 18, 2012 at 8:42 am

My problem is:
When I clone a new VM from a template, I get a eth1 despite the fact firstboot is presenting a eth0 for initial configuration.

The solution is:
Delete the HWADDR or MAC adresse from /etc/sysconfig/network-scripts/ifcfg-eth0 in the template. After a reboot, firstboot comes up and correctly configures a eth0.


8 venkat July 3, 2012 at 11:40 am

good information.


9 eiger3970 July 29, 2012 at 1:08 am

Sweet! Thank you, it actually worked (with the sudo).
# cd /etc/udev/rules.d
# cp 70-persistent-net.rules /root/
# rm 70-persistent-net.rules
# reboot


10 toughdeep October 16, 2012 at 4:15 pm

I have the same problem, I have done all the steps form the top to reboot,
but to check when used grep command i could not see other eth ports or MAC address, I think at least I should see 2 mac addresses after reboot. where may i have gone wrong?


11 battila.hu November 7, 2012 at 4:12 pm


thanks it was usefull. But with some bad coding:)


# cd /etc/udev/rules.d
# mv 70-persistent-net.rules /root/
# reboot


# ifconfig eth1 | awk ‘/HWaddr/ { print $5}’


12 maryam November 19, 2012 at 11:43 am

Thanks a lot for your helpful post :)


13 blogo November 30, 2012 at 8:22 am

I perfected the whole process ;)

# mv /etc/udev/rules.d/70-persistent-net.rules /root/

Remove MAC-address from the following files
# nano /etc/sysconfig/network-scripts/ifcfg-eth0
# nano /etc/sysconfig/network-scripts/ifcfg-eth1

# reboot


14 Herms March 5, 2013 at 6:55 pm

This is a great article!!


15 Tris April 30, 2013 at 4:20 pm

On red hat 5 & 6 it works removing the /etc/udev/rules.d/70-persistent-net.rules files and removing the mac address from the ifcfg-ethX files. This is done on the original machine to prevent the future clone to create a new ifcfg-ethY

Any Idea on how does it work with suse ?


16 Andrea November 26, 2013 at 6:09 pm

Thank you mate.. :)


17 Carl May 29, 2014 at 10:20 pm

I was trying to copy a VM that contained a snapshot, evidently there is extra path and file name info in there, which presents a problem because snapshots may be more than 2GB:
grep -n GameServer1 UDB1-Snapshot1.vmsn
11495040:nvram = “GameServer1.nvram”
11495057:displayName = “GameServer1″
11495058:extendedConfigFile = “GameServer1.vmxf”
11495074:scsi0:0.fileName = “GameServer1.vmdk”
11495088:sched.swap.derivedName = “/vmfs/volumes/5321bbd3-ad5bdbf5-9ec4-f01fafd599b9/GameServer1/GameServer1-25db7aa3.vswp”

I was able to copy this too using the sed utility after inflating the snapshot:
cat path/GameServer1-Snapshot1.vmsn |sed ‘s/GameServer1/UDB1/g’ > path/UDB1-Snapshot1.vmsn

This may take a long time depending on the file size. All the other files I had copied normally and edited using vim. Hope this helps.


18 Peter August 25, 2014 at 9:16 am

Thank you!

Saved me a lot of Time!!


Leave a Comment

Tagged as: , , , , ,

Previous post:

Next post: