How To - NIC Bonding

VastOne

How To - NIC Bonding

For anyone with dual NIC cards and the need to bond.

You will need to first install ifenslave-2.6

sudo apt-get install ifenslave-2.6

Next using your favorite editor, edit /etc/network/interfaces

sudo medit /-etc/network/interfaces

Now comment out what is already there for safe keeping and add the following

# 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
allow-hotplug eth0
allow-hotplug eth1
allow-hotplug bond0

auto bond0

iface bond0 inet static
        address 192.168.40.133
        netmask 255.255.255.0
        network 192.168.40.0
        broadcast 192.168.40.255
        gateway 192.168.40.10
        # dns-* options are implemented by the resolvconf package, if installed
        # dns-nameservers 8.8.8.8 8.8.4.4
        # dns-nameservers 208.67.222.222 208.67.220.220
        # dns-search example.com

        up /sbin/ifenslave bond0 eth0 eth1
        down /sbin/ifenslave -d bond0 eth0 eth1


You will need to change this to match your network

Specifically these lines

        address 192.168.40.133
        netmask 255.255.255.0
        network 192.168.40.0
        broadcast 192.168.40.255
        gateway 192.168.40.10


Note - If you have different cards than eth0 and eth1, they will need to change also

These lines

        # dns-nameservers 8.8.8.8 8.8.4.4
        # dns-nameservers 208.67.222.222 208.67.220.220


are commented out here, but I have the second enabled in mine..  They are google and opendns servers. 

Others may have resolv.conf handling this .. I left this commented out so that you can decide

Save the file

Now use your favorite editor and create the following file

sudo medit /-etc/modprobe.d/bonding.conf

add these lines

alias netdev-bond0 bonding
options bonding mode=0 miimon=100

save the file

Now you can restart the network and you should see your bond

sudo /-etc/init.d/networking restart

I have disabled network-manager and wicd on my systems..  and use this for my network setup
VSIDO      VSIDO Change Blog    

    I dev VSIDO