The reference architecture includes bonded network interfaces, which use multiple physical network interfaces for better redundancy and throughput.
Running multiple services across multiple machines and implementing appropriate HA methods ensure a high degree of tolerance to failure within our environment, but if it’s the physical network that fails and not the service, outages will occur if traffic cannot flow to and from that service. Adding in NIC bonding (also known as teaming or link aggregation) can help alleviate these issues by ensuring traffic flows through diverse routes and switches as appropriate.

Getting started

NIC bonding requires co-ordination between system administrators and the network administrators, who are responsible for the switches. There are various methods available for NIC bonding. The method presented here is active-passive mode, which describes that traffic will normally flow through a single switch, leaving the other teamed NIC to take no traffic until it is required.

To gain in-depth knowledge and be on par with practical experience, then explore  OpenStack Training course.

How to do it…

Setting up NIC bonding in Ubuntu 12.04 requires an extra package installation to allow bonding.

  • We install this in the usual manner, as follows:
sudo apt-get update

sudo apt-get -y install ifenslave
  • With this installed, we simply configure networking as normal in Ubuntu, but add in the required elements for bonding. To do this, we edit the /etc/network/interfaces file with the following contents (for active-passive mode bonding)—here we’re bonding eth1 and eth2 to give us bond0 with an address of
auto eth1
iface eth1 inet manual bond-master bond0 bond-primary eth1 eth2
auto eth2
iface eth2 inet manual bond-master bond0 bond-primary eth1 eth2
auto bond0
iface bond0 inet static address netmask network broadcast bond-slaves none bond-mode 1
bond-miimon 100
  • To ensure that the correct bonding mode is used, we add the following contents into /etc/modprobe.d/bonding.conf which describes an active/passive bond (mode=1) with a monitoring interval of 100 msec:
alias bond0 bonding
options bonding mode=1 miimon=100
  • We can now restart our networking, which in turn will bring up our bonded interface with the required IP address, as specified:
sudo service networking restart
Explore OpenStack Sample Resumes! Download & Edit, Get Noticed by Top Employers!  Download Now!

How it works…

Subscribe to our youtube channel to get new updates..!

Bonding network interfaces in Ubuntu to cater to switch failure is relatively straightforward, providing co-ordination with how the switches are set up and configured. With different paths to different switches configured, and each network interface going to separate switches, a high level of fault tolerance to network-level events such as a switch failure can be achieved.
To do this, we simply configure our bonding in the traditional /etc/network/interfaces file under Ubuntu, but we specify which NICs are teamed with which bonded interface. Each bonded interface configured has at least one unique pair of interfaces assigned to it, and then we configure that bonded interface, bond0, with the usual IP address, netmask, and so on. We tag a few options specifically to notify Ubuntu that this is a bonded interface of a particular mode.
To ensure the bonding module that gets loaded as part of the kernel has the right mode assigned to it, we configure the module in /etc/modprobe.d/bonding.conf. When the bonding module loads along with the network interface, we end up with a server that is able to withstand isolated switch failures.


Related Pages:
Interview Questions: