Author Topic: How To - NIC Bonding  (Read 1211 times)

VastOne

  •      v-ger
  • Posts: 4134
    • View Profile
    • VSIDO Community
How To - NIC Bonding
« on: January 14, 2013, 05:52:19 AM »
How To - NIC Bonding

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

You will need to first install ifenslave-2.6

Code: [Select]
sudo apt-get install ifenslave-2.6
Next using your favorite editor, edit /etc/network/interfaces

Code: [Select]
sudo medit /-etc/network/interfaces
Now comment out what is already there for safe keeping and add the following

Code: [Select]
# 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

 
Code: [Select]
        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

Code: [Select]
        # 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

Code: [Select]
sudo medit /-etc/modprobe.d/bonding.conf
add these lines

Code: [Select]
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

Code: [Select]
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 Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO