Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've installed a new NIC. It shows up as eth2. I'd like it to be eth1. How I can do this?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

edit /etc/udev/rules.d/70-persistent-net.rules

You may have something like:

# PCI device 0x14e4:0x165a (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:22:19:07:90:e4", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0a:79:b8:72:7d", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x10ec:0x8169 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:24:a5:84:de:62", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

Remove the line ending with NAME="eth1" and rename eth2 to eth1 as such:

# PCI device 0x14e4:0x165a (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:22:19:07:90:e4", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x10ec:0x8169 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:24:a5:84:de:62", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

reboot

share|improve this answer
    
My Fedora 17 box doesn't have this file anymore. Perhaps they have changed the way this is done? If that's the case, then this answer won't be useful anymore in a few years, after everybody adopts the new way.... –  Michael Hampton Oct 5 '12 at 12:12
    
@Michael Hampton, notice the tag debian. On Fedora it's probably named differently. Why don't you grep for the name of your device: grep -R eth0 /etc/udev/rules.d/. AFAIK, Fedora does use udev, but I could be wrong. –  d-_-b Oct 6 '12 at 6:25

The configuration for your interfaces on Red Hat distros, should be located in:

/etc/sysconfig/network-scripts

You will want to look for the appropriate script for your interface to modify.

share|improve this answer

Your Answer

 
discard

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.