Sometimes, it creates problem, when you add a new Ethernet interface to your system/Virtual Machine, the name assigned to interface is something else not eth0/eth1 (in case of its your second interface). Actually, it depends on the Linux distribution, what name will be given to your newly added interface. For example, on one distro Intel Giga bit Ethernet card might be detected as eth0 and Broadcom card as eth1 while with another distro this might be reversed. This causes a lot of problem, when one uses automated scripts which hardcoded “eth0” and “eth1”.
One can choose “ip” command to make the changes temporarily. But to make the changes permanently it needs to be changed in udev. udev is a daemon which dynamically creates and removes device nodes from /dev/, handles hotplug events and loads drivers at boot time. First you have to check whether your distribution is using udev daemon or not.
Installing of udev
$ yum search udev
libudev.ix86 : Dynamic library to access udev device information
Note that you must be the root/administrator to install the package. To install this package in Red Hat/Fedora Linux.
$ yum install libudev.i686
You can check the details of this package udev.
$ yum info libudev.i686
Changing the name of interface
Open the terminal and type the following command:
$sudo vim /etc/udev/rules.d/70-persistent-net.rules
Depending on the distribution, the name of network interface rule file may differ. In this file you will find the list of n/w adapters and their names. Change the field NAME=”eth0″ to NAME=”eth1″ or vice versa. Remember to rename the other adapter whose name you have borrowed. Restart the system and you will find the new names interchanged!