Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am in the situation where I have a number of CentOS Linux servers which all have two NIC interfaces. Currently one of these interfaces is used for internal communication, the other is used for external (internet) communication. Both of the NIC's are connected to the same switch.

My intention is to move both of these tasks to the first NIC and assigning it both an internal and external IP. Doing this will free the second NIC from all of its tasks, which then will be available for being connected to a second (back-up) switch.

The second NIC should the also receive an internal and a external IP address. My question is this: What should I do regarding the IP addressing on the second NIC? When the first switch or NIC breaks is there a way to automatically assign the IP info of NIC1 to NIC2? Or could I always give the the same IP information and let the switches work out the best route? What are proven techniques to accomplish this?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

In Linux, this is called a bonded ethernet interface.

The steps here are for Red Hat Linux and hopefully will be similar for other Linux distributions:

Step 1. Create bond0 - ethernet card

#vi /etc/sysconfig/network-script/ifcfg-bond0

DEVICE=bond0
USERCTL=no
BOOTPROTO=none
IPADDR=X.X.X.X
NETMASK=255.255.255.0 
GATEWAY=X.X.X.X
TYPE=Ethernet

Step 2. /etc/sysconfig/network-script/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=none
MASTER=bond0
SALAVE=yes
USERCTL=no

Step 3. /etc/sysconfig/network-script/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=none
MASTER=bond0
SALAVE=yes
USERCTL=no

Step 4 /etc/modprobe.conf

alias bond bonding
options bond0  mode=1 miimon=100

mode=1 means active/passive, and miimon=100 millisecond ping or checks for update.

Step 5. Restart the service.

share|improve this answer

It'd be a lot simpler to just use bonded ethernet on the 2 nics.

share|improve this answer
    
Looks like the correct solution. I am on it, thanks! –  Reinoud van Santen Feb 17 '11 at 9:39

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.