Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have some Fedora VMs setup ontop of VMWare. Sometimes, when software updates happen to VMWare, the VMs will get new MAC addresses. However, the default network configuration in Fedora is to bind an interface to the MAC at time of creation.

This causes all the VMs to lose network connectivity until I manually login and unbind the MAC via system-config-network-gui. How do I do this via the command line?

share|improve this question
    
VMware does not replace the MAC address. Someone is either exporting/importing your VM(s) or adding/removing NIC's from them.. –  pauska Mar 18 '13 at 17:13
    
You're partially correct. There were some hardware changes, causing VMWare to think they were copied, so it changed the MAC addresses. –  Cerin Mar 18 '13 at 18:07

2 Answers 2

up vote 2 down vote accepted

To fix this, you are going to want to edit two files:

First of all, you are going to want to remove the NIC from udev. Edit /etc/udev/rules.d/70-persistent-net.rules, and remove all lines similar to the following:

# PCI device 0x1af4:0x1000 (virtio-pci)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d6:9a:17:30:d9:54", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

(Especially note the ATTR{address}=="d6:9a:17:30:d9:54" section, as that's the relevant MAC address.)

You also want to edit the interface specific configuration file, e.g., /etc/sysconfig/network-scripts/ifcfg-eth0, and remove or update the following line:

HWADDR="D6:9A:17:30:D9:54"

That's it! Reboot the VM and all should be well again.

share|improve this answer
    
This did it. Thanks. –  Cerin Mar 18 '13 at 18:18

Don't bother with this proposed kludge. Just set the VM to have a fixed MAC address.

Edit the VM settings in vSphere Client and set the MAC address to Manual (then specify an address).

vSphere Client Network Settings

share|improve this answer
    
This doesn't really work. It's a configuration issue inside the VM. Changing the MAC in VMWare isn't really feasible since I don't know what the original MACs were...and really the Linux networking configs shouldn't be hardcoded to a specific MAC anyways. –  Cerin Mar 18 '13 at 18:20
1  
Actually, yes they should. –  Michael Hampton Mar 18 '13 at 18:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.