Category: CentOS 6.x

Posts relating to CentOS 6 in general

Force CentOS 6 to Detect New Network Devices

Posted on by admin

Force CentOS 6 to Detect New Network Devices

This is handy to know specially if you work with virtual machines. CentOS 6.x now uses udev to deal with all hardware devices. Udev managages hardware, including network interfaces, via .rules files which contain various attributes of a given piece of hardware that are used to match the device against a single device node each time it is connected to the system. When you move a virtual machine from one host to another, that copy has the original .rules files contained in it which will no longer match the new host (in terms of network connections, different MAC Address, UID, etc.). In the case of CentOS 6.x, the 70-persistent-net.rules file controls the network devices in the system and for what ever reason, CentOS 6.x does not update this file upon boot.

To force CentOS 6.x to detect the new settings, all you need to do is:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

And remove the existing HWADDR line so that it won’t conflict with the new value written to the 70-persistent-net.rules file when you reboot the system. If there also exists a UID line, remove that as well.

Once you have saved the changes, all you need to do is to remove the existing 70-persistent-net.rules file by:

rm -f /etc/udev/rules.d/70-persistent-net.rules

Restart the computer or virtual machine and check that you now have network connectivity.