change NIC in Centos 6 VM

While building a clustered vm in kvm/qemu, i needed to clone a system so it could run in a high availability configuration. after cloning the system, i wanted to clear out all traces of the old NIC, but there were still files that held into the original MAC address of the original.

thank goodness for google… ask the question properly, and the genie delivers a usable answer.

  1. in the cloned vm, i deleted the following files:
    /etc/udev/rules.d/70-persistent-net.rules
    /etc/sysconfig/networking/devices/ifcfg-eth*
    /etc/sysconfig/networking/profiles/default/ifcfg-eth*
    /etc/sysconfig/network-scripts/ifcfg-eth*
  2. shutdown the vm
    virsh <domain> shutdown
  3. edited the vm to remove the old vNIC and added a new one
  4. booted vm and ran system-network-config
  5. created new NIC and restart network service.

Leave a Reply

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