Sunday 10 May 2015

Bonding NICs on linux

You've got a managed switch and want two gig NICs hooked up to give you twice the bandwidth. How do you do this on ubuntu?


Easy...

    apt-get install ifenslave-2.6

vi /etc/network/interfaces

auto eth1
iface eth1 inet manual
bond-master bond0
auto eth2
iface eth2 inet manual
bond-master bond0
# The primary network interface
auto bond0
iface bond0 inet static
address 192.168.2.247
gateway 192.168.2.254
netmask 255.255.253.0
  bond-mode 4
bond-miimon 100
bond-lacp-rate 1
bond-primary eth1 eth2
dns-nameservers 8.8.8.8
dns-search corp.philspencer.org



check with ip link

cat /proc/net/bonding/bond0


bond mode type 4 requires a managed switch (I have a HP Procure 1810) and have enabled trunking on both ports of the switch where my NAS is connected to

finally ifenslave bond0 eth1 eth2