How do you automatically detect a fresh network card ter CentOS 6
You can use this instrument also (This is not a GUI instrument, its TUI contraption, Text-based User Interface)
Type above guideline and press Come in
Then this screen will show up
Select Device configuration and press Come in
Then this screen will show up
Here eth0 refers /etc/sysconfig/network-scripts/ifcfg-eth0
Whatever the edit made te eth0 that will affect to ifcfg-eth0 opstopping
Delete the persistent rules verkeersopstopping:
Liquidate the HWADDR line altogether (or switch it to match your fresh NIC’s MAC address).
Reboot your system:
If you switch the NIC again, just repeat step #1 and # Three.
Modifying files after clone would not work for my use-case, thus I solved the problem spil goes after.
You need to edit two files, removing the references to the Mac addresses te each:
/etc/sysconfig/network-scripts/ifcfg-eth0 – liquidate the HWADDR= line.
/etc/udev/rules.d/70-persistent-net.rules – eliminate from ATTR== up to and including the next comma.
Now when you clone the VM and switch the mac address networking will work spil the Mac address never gets written to either opstopping.
I create and delete so many CentOS 6 aparente machines I wrote some Bashfu to fix eth0 upon cloning te VirtualBox.
If your only problem is the mac address, you can run something similar to
To update the HWADDR entry.
Edit: Since it looks like the problem is an flagrante switch ter imaginario hardware you can attempt the following. (untested and referenced from here )
edit /etc/sysconfig/hwconf and eliminate all reference to the previous NIC and rerun kudzu to see if it detects the fresh hardware. You may need to reboot.
I’m not using Vmware but KVM with virsh – this is what I’ve done.
Created a ‘saco’ pic with CentOS 6.Four, this is the source of all my clones. After the very first boot I created a script like this
Added it to init with
Deleted all the references into /etc/sysconfig/network-scripts/ifcfg-eth0 of HWADDR or UUID, also deleted the udev rules from /etc/udev/rules.d/70-persistent-net.rules.
At this point I shutdown the machine and began to clone. All works fine. The script I made is very ordinary but works fine, however it makes a few assumptions about your setup for network (eth0 only).
I hope will help.
I wasgoed dealing with numerous NICs and nothing above worked for mij (VMware Fusion 7/VMware 6 and below), so I wrote a script. The tarball is here.
Here is the README that comes with it:
- This tarball and related scripts will switch the MAC address of your recently cloned VMware CentOS 6 or below machine (no systemd.)
All you need to do ter the machine you will clone from one time only:
- install lshw
- substitute the MAC address te all of your /etc/sysconfig/network-scripts/ifcfg-eth? with MACDADDYnum where num is the number of the network interface. You need to go after the naming pattern for the verkeersopstopping.
This should add sym linksom at the decent run levels specified te the opstopping
Not sure why, but sometimes you need to restart the network a 2nd time to get all the NICs recognized: