How to remove old NICs in CentOS 5 or 6

I did a V2V conversion of a CentOS 6 machine from Hyper-V to vSphere.

After the migration I was left with a legacy NIC that would throw up a warning when ever I tried to vMotion the CentOS 6 VM. It didn’t prevent me from moving the machine around our cluster but it was an annoyance.

To solve this problem I did the following:

1. From vCenter I added a new VMXNET 3 NIC to the VM and removed the legacy NIC

2. I then logged in to the virtual machine using the vCenter console and deleted the following:
/etc/udev/rules.d/70-persistent-net.rules (CentOS 6 only)
/etc/sysconfig/networking/devices/ifcfg-eth*
/etc/sysconfig/networking/profiles/default/ifcfg-eth*
/etc/sysconfig/network-scripts/ifcfg-eth*

3. I reboot the VM and then connected back into it using the vCenter console and ran ‘system-config-network’ and created a new eth0 device, assigned the proper IP to it and saved my changes

4. A quick ‘service network restart’ and the system was back up with just the new NIC

 

References

http://superuser.com/questions/332593/how-do-you-automatically-detect-a-new-network-card-in-centos-6-redhat

4 thoughts on “How to remove old NICs in CentOS 5 or 6”

  1. thanx for ur advice.

    i have 2 different NIC, and I wanna remove/reload one which is in trouble (doesn’t work).

    how can I do?

    Reply
    • If you follow these instructions to remove all of the NICs on the system, then reboot, Linux should pickup any installed NICs. That’s typically what I do.

      Reply
  2. Apologies for the thread necromancy.  Just wanted to say thanks – this helped a lot.

    Did similar to you, is a VM and changed out my vmxnet3 adapters for E1000s and then had ghost eth0/1 whereas ifconfig showed eth2/3 :)

    Reply

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.