Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I currently have a CentOS 6.5 box with 4 NICs.

eth0, eth2 and eth3 all come up fine, however when I bring eth1 up with an IP address, even on it's own, it causes complete network loss.

If I remove the IP and bring eth1 up with the other NICs it works fine. Then adding an IP and restarting network services causes the network to lose connection again and requires a console connection to bring the interface down.

Is there anything that can be causing this on this particular NIC?

Configs for each NIC as below:

eth0

DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
HWADDR=3C:4A:92:11:11:11
IPADDR=192.168.228.225
PREFIX=24
GATEWAY=192.168.228.254
DNS1=192.168.224.201
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
IPV6_AUTOCONF=no
NAME="Management"

eth1

DEVICE=eth1
TYPE=Ethernet
ONBOOT=no
NM_CONTROLLED=no
BOOTPROTO=none
HWADDR=3C:4A:92:00:00:00
IPADDR=192.168.223.225
PREFIX=24
GATEWAY=192.168.223.254
DNS1=192.168.223.201
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
IPV6_AUTOCONF=no
NAME="Production"

eth2

DEVICE=eth2
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
HWADDR=00:13:3B:00:00:00
NAME="Mirror Port Switch 1"

eth3

DEVICE=eth3
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
HWADDR=00:13:3B:11:11:11
NAME="Mirror Port Switch 2"
share|improve this question
2  
You've got 2 interfaces with 2 gateways. When eth1 comes up, its gateway is probably taking over. Try removing the gateway from eth1. –  Patrick Apr 23 at 11:58
1  
@Patrick indeed it seems to have been the case. How can I have a gateway for the 192.168.228.0 network as well as the 192.168.223.0 network without it killing the connection? –  lethalMango Apr 23 at 12:24
1  
If you have multiple gateways to the internet, how is the system supposed to know which one it should use? They're both equally valid. As for not killing eth0's traffic, you need to use source based routing. It's been a while since I've done this on RedHat/Centos. Someone else can probably answer how this is configured on those distros. –  Patrick Apr 23 at 12:57
    
@Patrick thanks for your help on this one. I managed to use persistent routes on eth0 and use the gateway on eth1 to get the desired result. –  lethalMango Apr 23 at 13:03
    
@lethalMango - please write up how you solved it. Other's can benefit from your issue. I seem to remember a couple of Q's in the past around multiple NICs and having this as a reference for these OP's would've been useful. –  slm Apr 23 at 14:03

2 Answers 2

up vote 1 down vote accepted

As mentioned in the original question comments this was caused by the multiple NICs having multiple gateways.

The solution to this specific problem was to remove a single default gateway from one of the NICs as below:

eth0

DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
HWADDR=3C:4A:92:11:11:11
IPADDR=192.168.228.225
PREFIX=24
DNS1=192.168.224.201
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
IPV6_AUTOCONF=no
NAME="Management"

eth1

DEVICE=eth1
TYPE=Ethernet
ONBOOT=no
NM_CONTROLLED=no
BOOTPROTO=none
HWADDR=3C:4A:92:00:00:00
IPADDR=192.168.223.225
PREFIX=24
GATEWAY=192.168.223.254
DNS1=192.168.223.201
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
IPV6_AUTOCONF=no
NAME="Production"

Persistent routes were then added to the NIC which had it's gateway removed:

/etc/sysconfig/network-script/route-eth0

192.168.111.0/24 via 192.168.228.254 dev eth0
192.168.222.0/24 via 192.168.228.254 dev eth0

The alternative I did find that resolved the network inaccessibility issue was by adding the METRIC=x line to NIC configs, however this did not resolve other network issues such as internet access.

share|improve this answer

First edit this file:

$ vim /etc/sysconfig/network-scripts/ifcfg-eth1

Then change ONBOOT to yes:

ONBOOT=yes

Then restart network, it will works fine.

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.