Small blog about system administration.

CentOS 6.4: Device eth0 does not seem to be present

After cloning a Centos machine from VMware template, I got following error message when networking service was restarted
device eth0 does not seem to be present
Initially, I thought the issue might be with the network adapter but was not sure exactly which network adapter settings should be kept..
On further investigation, I came with a solution with following solution.
Basically, the problem occurs due to old NIC record does not getting erased even though new NIC record is assigned.
1) Open following file which holds record of the NIC templates
vi /etc/udev/rules.d/70-persistent-net.rules
The above file should contain similar records as below:
# PCI device 0x15ad:0x07b0 (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 
ATTR{address}=="00:50:56:a4:3c:58", 
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x15ad:0x07b0 (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 
ATTR{address}=="00:50:56:a4:35:b1", 
ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
2) Remove previous eth entries and change the last entry NAME to eth0
# PCI device 0x15ad:0x07b0 (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 
ATTR{address}=="00:50:56:a4:35:b1", 
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
3) Save the file.
4) Open following file and modify the mac address
/etc/sysconfig/network-scripts/ifcfg-eth0
5) Save the file.
6) Reload udev configuration for the changes we made to reflect
start_udev
7) Restart network service
service network restart
or
/etc/init.d/network restart
8) Check the available ip using ifconfig command and update /etc/resolv.conf file with correct nameservers.

That’s it !

2 comments :

Post a Comment