This site best when viewed with a modern standards-compliant browser. We recommend Firefox Get Firefox!.

Linux-HA project logo
Providing Open Source High-Availability Software for Linux and other OSes since 1999.

USA Flag UK Flag

Japanese Flag


About Us

Contact Us

Legal Info

How To Contribute

Security Issues

This web page is no longer maintained. Information presented here exists only to avoid breaking historical links.
The Project stays maintained, and lives on: see the Linux-HA Reference Documentation.
To get rid of this notice, you may want to browse the old wiki instead.

1 February 2010 Hearbeat 3.0.2 released see the Release Notes

18 January 2009 Pacemaker 1.0.7 released see the Release Notes

16 November 2009 LINBIT new Heartbeat Steward see the Announcement

Last site update:
2017-12-12 22:06:45

IP Failover Using The Linux Channel Bonding Driver

What is the bonding driver

  • The bonding driver originally came from Donald Becker's beowulf patches for kernel 2.0. It creates a bonding device to communicate with internet outside. Local ethernet devices are used as supporting devices for the bonding device.

              |switch or other hosts|

                <bonding device>

                /      |      \     ...
             <eth0>  <eth1>  <eth2>


  1. Building kernel with the bonding driver
  2. Get and install the userspace tools
  3. Configure your system
  4. Set module parameters

More Detailed information can be found in the kernel source file Documentation/networking/bonding.txt

Parameters Related to HA configurations

  1. The bonding driver has different transmit modes. You can set the mode when loading the bonding

    module by setting mode=. Possible values are 0(round robin policy, default) and 1 (active back policy), 2 (balance-xor), 3 (broadcast), 4(802.3ad), 5(balance-tlb), and 6(balance-alb). For our purposes, select 1 for the mode. You may be interested in other modes if you want to do load-balance.

  2. MII link monitoring miimon= Use an integer value for the frequency (in ms) of MII link monitoring. Zero value is default and means the link monitoring will be disabled. This is probably not what you want.

Bonding in active-back mode -- IP failover

Bonding driver works nicely for IP failover in a single node. In active-back mode there will be a master device (the bonding device), and several slave devices(eth0, eth1, ...). One and only one slave device is active at any given moment, while other slave devices are also monitored. The monitor interval (miimon) can be set in loading the module. If the active slave is sick, it will be detected and disabled, one of the other slaves will be selected and become active.

Starting in kernel 2.6 and late 2.4 kernels(at least from 2.4.26), failback to a primary link is supported. If an interface is configured as primary and the device is on-line, it will be used first as the output media. Only when this device is off-line, will alternate slave devices be used. This is useful when one slave device is preferred over others.

Status information, including how many slaves there are, which one is active, and each slave device's status can be found in proc directory. For example, in redhat 9 you can it in /proc/net/bonding device/info Here is an example info file

        Bonding Mode: active-backup
        Currently Active Slave: eth0
        MII Status: up
        MII Polling Interval (ms): 100
        Up Delay (ms): 0
        Down Delay (ms): 0

        Slave Interface: eth1
        MII Status: up
        Link Failure Count: 0

        Slave Interface: eth0
        MII Status: up
        Link Failure Count: 0

Typical HA configuration: Using multiple host and multiple switches to build a "no single point of failure" solution

                |                                     |
                |port3                           port3|
          +-----+----+                          +-----+----+
          |          |port7       ISL      port7|          |
          | switch A +--------------------------+ switch B |
          |          +--------------------------+          |
          |          |port8                port8|          |
          +----++----+                          +-----++---+
          port2||port1                           port1||port2
               ||             +-------+               ||
               |+-------------+ host1 +---------------+|
               |         eth0 +-------+ eth1           |
               |                                       |
               |              +-------+                |
               +--------------+ host2 +----------------+
                         eth0 +-------+ eth1

In this configuration, there is an ISL - Inter Switch Link (could be a trunk), several servers (host1, host2 ...) attached to both switches each, and one or more ports to the outside world (port3...). One and only one slave on each host is active at a time, while all links are still monitored (the system can detect a failure of active and backup links).

Possible concerns for HA

  1. The active-back mode defines the transmit policy but not the receive one. Receiving is always in round robin mode as I observe although it is not specified in the bonding document. This will not do harm to HA but it does not agree with 'standby' mode (if an interface is in the standby, it should not have any activity)

See Also

Channel Bonding project information