Recently I moved a server (Linux centos 6.5) to a new server. I don't know about the hardware I don't own the servers. However, when I did that(I've noticed this on linux in general with VMs and more lately) that the eth0 in ip link show will change to higher numbers.

I went in and named eth0 in /etc/sysconfig/network-scripts/ifcfg-eth0 to ifcfg-eth2. I had issues with ip link set eth0 name eth2 and the connection would still drop.

Just now I had to go in an do ip link set eth2 up because the link went down.

How do I prevent the links from going down? What is causing this? How do I properly fix this problem.

I noticed under ifconfig when I brought it up there are over 400000000000 errors.


cat /etc/sysconfig/network-scripts/ifcfg-eth2

cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x10d3 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:4c:e0:ad", ATTR{type}=="1",                                  KERNEL=="eth*", NAME="eth1"

# PCI device 0x8086:0x10d3 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:4c:e0:ac", ATTR{type}=="1",                                  KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x10d3 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:75:ad:69", ATTR{type}=="1",                                  KERNEL=="eth*", NAME="eth2"

# PCI device 0x8086:0x10d3 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:75:ad:68", ATTR{type}=="1", 

                             KERNEL=="eth*", NAME="eth3"

I've wuped the .rules file. I've set everything to eth0 and ip link show will show UP and ifconfig will show the eth0 device but it will still randomly drop connectivity out of the blue.

  • Can you ensure that the flag 'NM_CONTROLLED' is set to 'no' and try again? – Matthew Ife Mar 18 '14 at 15:32
  • Yes, it is. I'll post full config – Jason Mar 18 '14 at 16:27
  • Does this network interface have a consistently named MAC address? – Matthew Ife Mar 18 '14 at 17:24
  • That I am not sure of. How do I properly set the MAC Address? – Jason Mar 18 '14 at 20:01
  • Well, you normally dont set it, you can but on a typical host the MAC address will be consistent between boots. Is this the case here? – Matthew Ife Mar 18 '14 at 20:16

i don't think you can rename the network interface in that way

from http://lxr.free-electrons.com/source/include/linux/netdevice.h#L1143 

linux kernel uses struct net_device for define the net interface, if interface is referenced in some where that means the interface is used and rename without put the interface down isn't good idea

| improve this answer | |
  • Since the kernel actualy is keeping track of network objects via their ifindex value, I doubt that what you name it has any real significance. – Matthew Ife Mar 18 '14 at 15:31
  • i'm connected in console, linux-80kc:~ # ip link set eth1 name eth0 RTNETLINK answers: Device or resource busy , so i think linux has some referenced to know if the interface is used – c4f4t0r Mar 18 '14 at 15:40

Try this:

  • Wipe /etc/udev/rules.d/70-persistent-net.rules (delete all the contents)
  • Make sure you have only one /etc/sysconfig/network-scripts/ifcfg-eth* file, and name it /etc/sysconfig/network-scripts/ifcfg-eth0
  • Reboot

I suspect you've migrated machines here, while saving your old persistent-net file. This appears to be causing some significant confusion.

| improve this answer | |
  • Tried that. It still randomly decides to drop network connectivity for some reason. – Jason Mar 19 '14 at 18:19
  • Can you post your updated persistent-net file? Does that still have 4 MACs? – devicenull Mar 19 '14 at 20:14

To rename network interfaces:

Check network interface hardware address: lspci -D |grep Ethernet Check motherboard model: dmidecode -s baseboard-product-name

Our file /etc/udev/rules.d/60-persistent-net.rules on LTE LabKit

[yatebts@ybts-UNCONFIG ~]$ cat /etc/udev/rules.d/60-persistent-net.rules

# motherboard Gigabyte Z370N WIFI-CF                                                                                                                                                                              
# 0000:00:1f.6 Ethernet controller: Ethernet controller: Intel Corporation Ethernet Connection (2) I219-V was enp0s31f6                                                                                           
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:1f.6", NAME:="eth-ran"

# 0000:05:00.0 Ethernet controller: Intel Corporation I211 Gigabit Network Connection (rev 03) was enp5s0
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:05:00.0", NAME:="eth-mgmt"

[yatebts@ybts-UNCONFIG ~]$

| improve this answer | |

To keep the IP up even if the link gets down ([2938737.731632] tg3 0000:02:00.0 eth0: Link is down)

If the interface has a static IP (OR does not get the IP from a dhcp server) Edit /etc/sysconfig/network-scripts/ifcfg-eth0 add: MII_NOT_SUPPORTED=yes and ACCOUNTING=no

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.