Ubuntu Server 14.04 LTS NIC Bonding

As you know I like to play with os’s so I moved my webserver over to Ubuntu LTS, I like the idea of having long term support without having to upgrade my server to the latest and greatest version every 6 months.  As such I have two NICs in my server so wanted to play with network bonding, the previous OS on the machine was CentOS and this was a breeze to setup so I figured how hard could it be on Ubuntu?  Well not hard at all to be honest.

sudo apt-get install ifenslave-2.6

 

sudo vi /etc/modules

Make sure it has these in it

# /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.
loop
lp
rtc
bonding

Load the bonding kernel module.

sudo modprobe bonding

Edit Interfaces

sudo vi /etc/network/interfaces

This is mine for an example

auto lo
iface lo inet loopback

#eth0 is manually configured, and slave to the “bond0” bonded NIC
auto eth0
iface eth0 inet manual
bond-master bond0
bond-primary eth0

#eth1 ditto, thus creating a 2-link bond.
auto eth1
iface eth1 inet manual
bond-master bond0

# bond0 is the bonding NIC and can be used like any other normal NIC.
# bond0 is configured using static network information.
auto bond0
iface bond0 inet static
address x.x.x.x
gateway x.x.x.x
netmask x.x.x.x
dns-nameservers x.x.x.x x.x.x.x
dns-search xxxxxxx
bond-mode balance-tlb
bond-miimon 100
bond-slaves none

Reboot or restart networking, you should then be able to check your bonding to see if it’s worked.

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

Bonding Mode: transmit load balancing
Primary Slave: eth0 (primary_reselect always)
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: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: xx:xx:xx:xx:xx:xx
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: xx:xx:xx:xx:xx:xx
Slave queue ID: 0

Advertisements

6 thoughts on “Ubuntu Server 14.04 LTS NIC Bonding

  1. Hi, thank you for this Tutorial. I tried the official Ubuntu Tutorial first but it didn’t work. But yours works great. Now my Homeserver works like i want

    Thanks and greets from Germany
    Dirk

    Like

  2. Hey man, just wanted to give you a shout out for the nice instructions. Worked without fail, did require a reboot on 15.10 since networking didn’t seem to restart properly otherwise.
    Either way, I’m now up n’ running with bonded NIC’s.. 🙂

    So, thanks!

    Like

  3. Is it possible to run dhcpd over a bonded interface?

    Let’s say I have a box as my router/media server…for throughput reasons I would be using mode 6 with a 4-port nic. Will that work?

    Like

    • I believe it’s possible, not tried it on an Ubuntu box, but I have on a RHEL box, just setup dhcpd to use bond0.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s