46
25
I'm using CentOS 6 in a virtual environment. When cloning a virtual version of CentOS, the old eth adapters are "removed" and replaced with new ones and net MAC addresses. However, the ifcfg-ethn files still exist. I am trying to figure out how to get CentOS to automatically rescan & recreate the network adapters / eth files, just like it did on install.
Otherwise I am left with the tedious process as described here: http://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-s390info-addnetdevice.html
I know there is a quick way to do this in the GUI, but we are using a server so GUI does not apply in this case. Help?
Edit: @OldWolf suggested Kudzu, however Kudzu has been removed as of Centos 5 so I would rather avoid that. There is a procedure that Linux runs on initial install - can someone help me figure out what that is so I can manually trigger it?
There is no ifcfg-eth0 on my system (CentOS 6.6). :-( – david.perez – 2015-04-27T10:06:08.033
2Sounded wonderful tracy, however it did not work as you described. The old ifcfg-eth0 file was still there, with the original MAC address etc instead of the correct new one. – Joshua – 2011-09-08T20:58:15.713
2Sorry yes I had forgetten. You must also MANUALLY update the mac address in ifcfg-eth0 as well sorry. That will make it work. There might be an easier way but I have yet to find it... – Tracy Carlton – 2011-09-08T23:27:02.847
This was a good start. It seems like it could be possible to write a script that will automate the process - even the manual bits described - on bootup. The problem is activating the script only after the machine has been cloned / moved. Still no complete answer to this... – Joshua – 2012-02-20T21:32:40.443
FYI I marked this answer as the correct one, as it helps get it going. Admins still need to write a custom / complicated script for cloning automatically, or just manually do it each time. Bother. – Joshua – 2012-06-21T15:52:32.843
5Go into
/etc/udev/rules.d
and delete the70-persistent-net.rules
file and DO NOT reboot. Go into/etc/sysconfig/network-scripts/ifcfg-eth0
and manually update to the MAC of your new NIC card. Reboot and the network should come alive. – None – 2012-08-08T14:44:30.5772@user151091 Instead of rebooting,
start_udev
thenservice network restart
worked for me. – doshea – 2013-11-27T03:35:02.247