Network interfaces can be bonded to provide fault-tolerant operation. Here’s how to do it in Ubuntu. I will assume the interfaces to be bonded are eth0 and eth1.
First, install the ifenslave package. The ifenslave tool will be used to actually bond the interfaces.
1 |
apt-get install ifenslave |
Create file /etc/modprobe.d/bonding with the following contents:
1 2 |
alias bond0 bonding options bonding mode=0 miimon=100 |
Load the bonding module:
1 |
modprobe bonding |
Add a bonded interface into /etc/network/interfaces:
1 2 3 4 5 6 7 8 9 |
auto bond0 iface bond0 inet static address 192.168.0.1 gateway 192.168.0.254 netmask 255.255.255.0 pre-up modprobe bonding up ifenslave bond0 eth0 eth1 pre-down ifenslave bond0 -d eth0 eth1 post-down rmmod bonding |
Restart networking:
1 |
/etc/init.d/networking restart |
That’s it! The bonded interface should come up automatically after a reboot as well.
You made a typo there, the -d should come before the bond0