Linux bonding: How to maximize your throughput by combining nics.
I’m currently working on building my own iSCSI SAN w/ SCST & a modified Linux kernel. Things are going pretty well but I needed to also bond out the 5 Gb nics so my VMHosts can maximize their connections. In Linux, you bond out an interface by creating a new network interface and telling the physical nics to register w/ that virtual network interface. There’s also 7 different types of bonding modes but the most common one is mode 6 or balance-ALB (active load balancing.)
If you’re using CentOS or RHEL like I am you cd to
Once you’ve got vi open, you dump the following in (this is an example only. Please change your IPADDR, NETMASK and NETWORK parameters as needed.)
DEVICE=bond0 BOOTPROTO=none ONBOOT=yes NETWORK=10.0.0.0 NETMASK=255.255.0.0 IPADDR=10.0.0.100 USERCTL=no
From there, you then modify your individual eth# interface config files so they point to the bonded device. As an example, here’s my
/etc/sysconfig/network-scripts/ifcfg-eth0 interface file.
DEVICE=eth0 BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes USERCTL=no
And oh ya, don’t forget to modify your modprobe.conf file to specify the loading of the bond kernel module and what options it will needed @ run-time.
alias bond0 bonding options bond0 mode=6 miimon=100
Couple of useful links. There’s tons of good info on bonding w/ Linux. Keep in mind, some distros don’t want you to modify the individual interface config files so use their administrator control panel first if possible.