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 have an ubuntu server (meerkat) that I had to replace a NIC since it is failing. So I removed the failing NIC and replaced it with two NICs inserted into two PCI slots on my server.

Everything's well except that one of the NICs name is eth1-eth3. Please see ifconfig -a result below:

eth1      Link encap:Ethernet  HWaddr xx:xx:xx:xx:50:a5
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:16

eth2      Link encap:Ethernet  HWaddr xx:xx:xx:xx:50:a4
          inet addr:xxx.xxx.xxx.98  Bcast:xxx.xxx.xxx.255  Mask:255.255.255.0
          inet6 addr: fe80::204:23ff:fec8:50a4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:18746 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25886 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3423836 (3.4 MB)  TX bytes:3148479 (3.1 MB)

eth3      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:51
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:24 Base address:0xe800

eth1-eth3 Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:63
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:28 Base address:0xec00

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:116 errors:0 dropped:0 overruns:0 frame:0
          TX packets:116 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8124 (8.1 KB)  TX bytes:8124 (8.1 KB)

I googled on how to change the NICs name via 70-persistent-net.rules but I got the following:

# PCI device 0x1186:0x1300 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:56", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x1076 (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:a4", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

# PCI device 0x11ab:0x4361 (sky2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:a5", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x1106:0x3106 (via-rhine)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:63", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

# PCI device 0x1106:0x3106 (via-rhine)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:51", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

How do I change eth1-eth3 to just eth4? And why did linux label my new NIC eth1-eth3?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Change the NAME argument of the second eth3 interface to eth4 in 70-persistent-net.rules, then restart your networking.

share|improve this answer
2  
That is only 1/2 right. You have to restart udev (or reboot) to get the new names to take affect. –  Squidly Oct 29 '11 at 0:09
    
I will try to do this later and will update this thread if it solved the problem... Thanks! –  jerichorivera Oct 29 '11 at 0:38
    
this worked for me. I had to reboot the server to restart udev. I still don't know why linux named the NIC to eth1-eth3 though... –  jerichorivera Oct 30 '11 at 2:22

Take a look at ifrename. I remember it to be very easy to use.

$ aptitude show ifrename

Description : Rename network interfaces based on various static criteria
 Ifrename allow the user to decide what name a network interface will have.
 Ifrename can use a variety of selectors to specify how interface names match
 the network interfaces on the system, the most common selector is the interface
 MAC address.
Site : http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html

It uses a config file which be used to tell udev how to name the interfaces.

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.