Linux – IP Link keeps resetting to down

centoslinuxnetworking

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.

EDIT:

cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE="eth2"
BOOTPROTO=none
#BROADCAST="108.x.x.135"
DNS1="208.x.x.22"
GATEWAY="108.x.x.129"
IPADDR="108.x.x.130"
NETMASK="255.255.255.248"
NM_CONTROLLED="no"
ONBOOT="yes"
DNS2=64.x.x.82
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no

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.

Best Answer

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