# dmesg | grep -i eth0
eth0: NIC Link is Up 10000 Mbps
udev: renamed network interface eth0 to eth1
Let's check the current ethernet devices,
# ls /sys/class/net
The dynamic device manager udev stores the virtual machine's network adapter information. In the virtual machine's cloning process the MAC address of the network adapter changes but the udev sees it as a new network adapter and creates a new rules with new device name. udev network persistent rules can be checked in file,
# cat /etc/udev/rules.d/70-persistent-net.rules
You should be seeing two SUBSYSTEM entries ending with eth0 and eth1 respectively. Now, there are five simple steps to fix the issue:
- Delete or comment the SUBSYSTEM line that ends with eth0,
# /bin/sed '/eth0/s/^/#/' /etc/udev/rules.d/70-persistent-net.rules
- Make a note of MAC address from SUBSYSTEM line that ends with eth1.
- Replace eth1 to eth0 in SUBSYSTEM line,
# /bin/sed 's/eth1/eth0/g' /etc/udev/rules.d/70-persistent-net.rules
- Update the recorded MAC address in the eth0 configuration file /etc/sysconfig/network-scripts/ifcfg-eth0
- Finally reboot the system and you should be good now.
Any feedback will be highly appreciated.
This post appeared on the softlexicon.com by Sumit Goel. Copyright © 2012 – softlexicon.com and Sumit Goel. All rights reserved. Not to be reproduced for commercial purposes without written permission.