Sie sind auf Seite 1von 2

IP Bonding in Linux

The Linux bonding driver provides a method for aggregating multiple network
interfaces into a single logical bonded interface.
The behavior of the bonded interfaces depends upon the mode; generally speaking,
modes provide either hot standby or load balancing services. Additionally, link
integrity monitoring may be performed.

This is the explanation to configure two Ethernet interfaces in the same server into
a single logical bonded interface.

There are several parameters that can be set for the mode for the Bonding drivers
to be configured.

Parameters are to be set in file /etc/modprobe.conf

These lines in /etc/modprobe.conf file define bonding drivers in bond0 bonding


with Ethernet interfaces in Active-Standby mode MII Link monitoring frequency as
100ms and primary slave which will be active as eth0.

alias bond0 bonding


options bond0 mode=1 miimon=100 primary=eth0

Most Possible modes for the Ethernet Bonding for two Ethernet Interfaces are

0 – Round Robin providing Load Balancing and Fault tolerance


1 – Active-Backup mode in which the bond's MAC address is externally visible on
only one port (network adapter) to avoid confusing the switch.
2 – Balance-XOR Transmit based on the selected transmit hash policy. The default policy is a
simple
3 – Broadcast mode transmits everything on all slave interfaces. This mode provides
fault tolerance
Bonding configuration has to be done in the file /etc/sysconfig/network-scripts/ifcfg-
bond0. The file ifcfg-bond0 has to be created for the configuration.

ifcfg-bond0

DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
NETWORK=10.3.251.128
NETMASK=255.255.255.224
IPADDR=10.3.251.134
GATEWAY=10.3.251.129
USERCTL=no
BONDING_MASTER=yes
BONDING_SLAVE0="eth0"
BONDING_SLAVE1="eth1"
Here BONDING_SLAVE0=eth0 indicates the eth0 interface as primary slave as
the bonding interface which will be active initially and the standby interface will be
the eth1. When the eth0 goes inactive or to abnormal state eth1 which is configured
as BONDING_SLAVE1 will get Active.

An Important note while configuring the Bonding Drivers is that the interfaces
which are being configured for this should not have any sort of IP Configurations.
The following configuration will explain the same for both the Ethernet interfaces.

ifcfg-eth0

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
USERCTL=no
MASTER=bond0
SLAVE=yes
MII_NOT_SUPPORTED=yes

Ifcfg-eth1

DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
MII_NOT_SUPPORTED=yes