Wednesday, 22 May 2013
Ubuntu 12.04.2 LTS Interface bonding (802.3ad / LACP) with vlan tagging (802.1q)
Ubuntu 12.04.2 LTS Interface bonding (802.3ad) with vlan tagging (802.1q)
I just had a little wrestle to get this working on 12.04.2 so thought I would write it down quick!
Not sure why but the interface configuration changed between earlier versions of Ubuntu and 12.04.2 LTS.
I followed this guide to get bonding working. My switches support 802.1q / LACP make . I must admit to already having vlan tagged interface and I cannot remember all of the steps, but my interface config works.
Before you start think about how you are connecting to this server. Are you changing an Interface that you are using to connect to the server? Do you have a backup plan to control it if your config does not work first time?
Install the bonding package. (I am using aptitude, if you use apt-get use that instead ;-)
sudo aptitude install ifenslave
Install the vlan package.
sudo aptitude install vlan
Add the modules bonding and 8021q so they are loaded by the kernel.
# /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.
Edit the interface config.
sudo nano -w /etc/network/interfaces
# Create a bond0 interface that binds eth1 and eth3 together.
iface eth1 inet manual
iface eth3 inet manual
# Next configure bond0 interface, I had to set an IP, I would prefer to use null..
UPDATE: if you don't want to set an IP address then instead of "iface bond0 inet static" make it "iface bon0 inet manual". Thanks to Sean for the tip.
# NB the bond-mode, try bond-mode 0 if LACP fails.
iface bond0 inet static
If you need more bonding modes have a look at this it might help.
# Next create as many vlan tagged Interfaces as you need!
iface bond0.140 inet static
iface bond0.10 inet static
iface bond0.180 inet static
Save the changes and reboot your server. You can restart the networking service if you prefer.
Now when you issue the ifconfig command you will see bond0 and bond0.vlanx interface.
Additional useful commands.
Check your bonded interfaces are working as expected, this will also show the LACP actor and partner keys.
Hope this helps someone.