# 2 NICs: when I start one the other goes down

## Thomas Carrie

I have 2 NICs :

- I start eth0, it goes up and gets IP 192.168.0.9

- then I start eth1, it goes up and gets IP 192.168.0.10

- but it also stops eth0

```
# I have an empty network config file

$ grep -v # /etc/conf.d/net*

# all interfaces are down except l0

$ ifconfig | grep inet

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          inet6 addr: ::127.0.0.1/96 Scope:Unknown

$ /etc/init.d/net.eth0 start

 * Bringing up interface eth0

 *   dhcp ...

 *     Running dhcpcd ... [ ok ]

 *     received address 

 [ ok ]

# eth0 is up

$ ifconfig | grep inet

          inet addr:192.168.0.9  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::f66d:4ff:fed5:6cc7/64 Scope:Link

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          inet6 addr: ::127.0.0.1/96 Scope:Unknown

$ /etc/init.d/net.eth1 start

 * Bringing up interface eth1

 *   dhcp ...

 *     Running dhcpcd ... [ ok ]

 *     received address 

 [ ok ]

# eth1 is up but eth0 is down

$ ifconfig | grep inet

          inet6 addr: fe80::f66d:4ff:fed5:6cc7/64 Scope:Link

          inet addr:192.168.0.10  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::da5d:4cff:fe80:5679/64 Scope:Link

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          inet6 addr: ::127.0.0.1/96 Scope:Unknown

```

Here are the corresponding var log messages

```
Oct 19 00:42:55 odin kernel: [ 4584.465162] forcedeth 0000:00:07.0: irq 43 for MSI/MSI-X

Oct 19 00:42:55 odin dhcpcd[1546]: eth0: carrier acquired

Oct 19 00:42:55 odin dhcpcd[1546]: eth0: rebinding lease of 192.168.0.9

Oct 19 00:42:55 odin dhcpcd[1546]: eth0: acknowledged 192.168.0.9 from 192.168.0.254

Oct 19 00:42:55 odin /etc/init.d/net.eth0[5851]: No configuration specified; defaulting to DHCP

Oct 19 00:42:55 odin dhcpcd[1546]: eth0: checking for 192.168.0.9

Oct 19 00:42:55 odin dhcpcd[1546]: control command: dhcpcd -m 4 eth0

Oct 19 00:43:00 odin dhcpcd[1546]: eth0: leased 192.168.0.9 for 864000 seconds

Oct 19 00:43:06 odin kernel: [ 4595.114021] eth0: no IPv6 routers present

Oct 19 00:43:49 odin kernel: [ 4638.414906] r8169 0000:01:07.0: eth1: link down

Oct 19 00:43:49 odin kernel: [ 4638.415349] ADDRCONF(NETDEV_UP): eth1: link is not ready

Oct 19 00:43:49 odin /etc/init.d/net.eth1[5956]: No configuration specified; defaulting to DHCP

Oct 19 00:43:49 odin dhcpcd[1546]: control command: dhcpcd -m 3 eth1

Oct 19 00:43:49 odin dhcpcd[1546]: eth0: removing interface     !!!!!!!!!!!!!!!!!!

Oct 19 00:43:49 odin dhcpcd[1546]: eth1: waiting for carrier

Oct 19 00:43:51 odin kernel: [ 4640.137337] r8169 0000:01:07.0: eth1: link up

Oct 19 00:43:51 odin kernel: [ 4640.137665] ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready

Oct 19 00:43:51 odin dhcpcd[1546]: eth1: carrier acquired

Oct 19 00:43:51 odin dhcpcd[1546]: eth1: rebinding lease of 192.168.0.10

Oct 19 00:43:51 odin dhcpcd[1546]: eth1: acknowledged 192.168.0.10 from 192.168.0.254

Oct 19 00:43:51 odin dhcpcd[1546]: eth1: checking for 192.168.0.10

Oct 19 00:43:56 odin dhcpcd[1546]: eth1: leased 192.168.0.10 for 864000 seconds

Oct 19 00:44:01 odin kernel: [ 4650.546031] eth1: no IPv6 routers present

```

My config is very vanilla, I wonder if someone has a working 2 NICs config.

Thanks for your help

----------

## NeddySeagoon

Thomas Carrie,

If you think you need two interfaces in the same subnet, as you are trying to do here you are probably doing something wrong. 

About the only exception I can think of is if one is doing PPP.

What are you trying to achieve?

----------

## s_bernstein

If you try to use two nics in one subnet it will fail because your system can't decide where to send the packages to. So either check your config and setup to different subnets or - if you try to use doubled links for more speed - use bonding. The later will virtually connect your nics to one bonding device, which will have only one ip. But to get this working, you will need a switch supporting bonding (or etherchannel on cisco).

----------

## Thomas Carrie

I am building a server with redundant hardware : for instance I have 2 HD using Raid1.

I would like to do a similar thing with my 2 NICs : more speed but also most notably fault tolerance.

From your answers I understand that

- to achieve my goal I should use "bonding" , I will try http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=3#doc_chap6

- I could also have a different subnet, so 2 IPs on the host : one for service A and the other for service B

Is that it ?Last edited by Thomas Carrie on Thu Oct 20, 2011 7:24 pm; edited 1 time in total

----------

## jburns

 *Quote:*   

> I am building a server with redundant hardware : for instance I have 2 HD using Raid0. 

 

If you use raid 0 the HDs are not redundant.  If you lose a drive all the data is lost.  Raid 1 is redundant and if you lose a drive the system will continue to work using the other drive.

----------

## solamour

If I'm not completely mistaken, I believe you just need to bring up eth0 and eth1 without giving them IPs. You combine them as bond0, and give the IP to bond0. Refer to the following document.

http://www.gentoo-wiki.info/HOWTO_Setup_Bonded_ethernet_adapters

__

sol

----------

