Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using CentOS 5.9. One of my servers recently had a malfunctioning NIC port. The software running on the server was hard-coded to use eth0. The other physical NIC ports were fine and unused. The issue is now resolved but I'm curious, how hard would it be to convince CentOS that the other NIC port is eth0?

Is it just a matter of editing /etc/sysconfig/network-scripts/ifcfg-eth0 and setting HWADDR=<MAC Address of second NIC port> ?

share|improve this question
up vote 7 down vote accepted


/etc/sysconfig/network-scripts/ifcfg-eth0 (HWADDR)

should do the trick.

share|improve this answer
The udev rules bit is applicable to most modern Linux distros. – Andrew Apr 5 '13 at 6:23
persistent-net.rules name could be different depending on OS. For example for for suse it could be 30-net_persistent_names.rules. – Drt Apr 5 '13 at 7:38
Just for grins, I checked this on a VM and I don't see /etc/udev/rules.d/70-persistent-net.rules. Is this file only present on bare-metal systems? – Mike B Apr 6 '13 at 3:01

Open /etc/udev/rules.d/70-persistent-net.rules with your favorite editor and Do below changes

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:xx:xx:xx", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"


cd /etc/sysconfig/network-scripts/      

put the HWADDR entry in ifcfg-eth1 file


then after rebooting your system & you will be able to get IP assign in ifcfg-eth1

share|improve this answer

Your Answer


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.