Skip to main content

Interface bonding on Ubuntu 14.04

Install the required package ifenslave

$ sudo apt-get install ifenslave ethtool

To prevent issues make sure that the bonding  module is listed in the /etc/modules file. In this way the module will be loaded at boot time.

$ cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

lp
rtc
bonding

Configure the network with the new bond0 interface.

$ cat /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual
  bond-master bond0

auto eth1
iface eth1 inet manual
  bond-master bond0

auto bond0
iface bond0 inet manual
  address 172.17.16.10
  netmask 255.255.255.0
  gateway 172.17.16.1
  bond-miimon 100
  bond-mode balance-alb
  bond-slaves eth0 eth1

I configured here with the balance-alb mode that is able to balance the outgoing and incoming traffic without any special switch support, but the network drivers must support ethtool to retrieve the speed from them.

The common bonding modes that are very used are:
– active-backup
– balance-alb
– 802.3ad

You should check the bonding documentation and the features of each mode here:

https://www.kernel.org/doc/Documentation/networking/bonding.txt

To check that the new bond0 interface is working:

$ sudo cat /proc/net/bonding/bond0 
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 0c:c4:7a:34:e8:a2
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 0c:c4:7a:34:e8:a3
Slave queue ID: 0

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.