cancel
Showing results for 
Search instead for 
Did you mean: 

Bonding

Waqar Razi
Regular Advisor

Bonding

I have configured bonding using two lan cards eth0, eth1 and created a bonding file ifcfg-bond0.
I can ping my self. But cant ping the other servers.

Do I need to make some changes on the switch as well?

I have one more question here, Can I get IP Address for the bonding channel (bond0 having two network interfaces eth0 and eth1) from DHCP server.

Do I need to make some configurations here.

I will really appreciate your help.

THanks in advance.
4 REPLIES
Steven McCoy
Valued Contributor

Re: Bonding

Once you've created the bonded device (bond0), you should be able to treat it just like any other ethernet device (at least in my experience):

ifconfig bond0 192.168.1.50 netmask 255.255.255.0
route add default gw 192.168.1.1
echo 'nameserver 192.168.1.1' > /etc/resolv.conf

^ please replace '192.168.1.50' with the IP address you want, the '255.255.255.0' with the subnet mask on the network, and '192.168.1.1' with the router/gateway and DNS server(s) you may have.
Waqar Razi
Regular Advisor

Re: Bonding

Can bonding channel use DHCP?
Steven McCoy
Valued Contributor

Re: Bonding

In my experience, yes:

dhcpcd bond0

Does that work for you?
Matti_Kurkela
Honored Contributor

Re: Bonding

Some bonding modes will require configuration at the switch side, some won't.

Which bonding mode did you choose?

This is usually configured in /etc/modprobe.conf (or /etc/modules.conf in older versions of Linux). The configuration appears usually in one or two lines:

alias bond0 bonding
options bond0 mode= [other options]

If no mode is specified, the default is "balance-rr", which sends outgoing packets sequentially from each available slave NIC in turn. From the switch side, this looks like one MAC address is rapidly jumping from one port to another and back.

If your switch has (for example) security features to disallow MAC address hijacking, it might disable traffic to those ports in this case. If the security feature can be disabled in the switch, you might be able to use this mode.

If you don't need extra bandwidth but only fault tolerance, choose mode 1, "active-backup". It will use only one slave NIC at a time, and switch only if the active NIC loses connection. This mode is the easiest to get working if the switch configuration is not accessible and/or you don't know anything about the features of that particular switch.

With this mode, you will also have to define what is regarded as a "lost connection": you can either just monitor the NIC link state (miimon) or make the system monitor the link by ARP probes.

Link state monitoring is easier to set up and does not cause any extra traffic to the network; ARP probes require more configuration and will cause extra traffic, but will catch more failure situations than link state monitoring.

Example modprobe.conf options line for link state monitoring:

options bond0 mode=active-backup miimon=100
or
options bond0 mode=1 miimon=100

(miimon=100 means the link state is checked in 100 ms intervals)


If you need the bandwidth of both NICs and the switch does not allow you to use the default "balance-rr" mode, you might have to use the mode 4, "802.3ad". This mode *will* require some configuration at the switch side to enable 802.3ad link aggregation mode.

Example modprobe.conf options line for this configuration:

options bond0 mode=802.3ad
or
options bond0 mode=4

For more information, see RedHat documentation:

https://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s2-modules-bonding.html

MK
MK