Linux NIC teaming w/o additional software
After unsuccessfully trying several 3rd-party drivers to provide load-balancing and failover for my Linux servers with dual NIC cards, I stumbled upon the fact that Linux has an integrated bonding driver called, appropriately, "bonding." Here's how you get it working (assuming you have at least two interfaces):
1) Add the following lines in /etc/modules.conf:
alias bond0 bonding
options bond0 primary=eth0 mode=1 miimon=200
alias eth0 bcm5700
alias eth1 bcm5700
2) Create a file named /etc/sysconfig/network-scripts/ifcfg-bond0 containing the following (change the network info for your particular environment):
DEVICE=bond0
IPADDR=192.168.1.1
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
3) Create a file named /etc/sysconfig/network-scripts/ifcfg-eth0 containing the following:
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
4) Create a file named /etc/sysconfig/network-scripts/ifcfg-eth1 containing the following:
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
5) Reboot the server.
6) Verify team configuration by viewing /proc/net/bond0/info or by using the "ifconfig" command.. The bond MAC address will be the taken from its first slave device.
You can set up your bond interface according to your needs. Changing one parameters (mode=X) in /etc/modprobe.conf allows you to select what you need. Here are the choices:
mode=0: Round-robin load balancing
mode=1: Active backup. Only one slave is active. A different slave becomes active if the active slave fails.
mode=2: Load balancing and fault tolerance.
mode=3: Broadcast. Transmits everything on all slave interfaces. Fault tolerant.
mode=4: Dynamic link aggregation. Bonding for combining bandwith into a single connection.
mode=5: Adaptive transmit load-balancing.
mode=6: Adaptive transmit and receive load balancing
1) Add the following lines in /etc/modules.conf:
alias bond0 bonding
options bond0 primary=eth0 mode=1 miimon=200
alias eth0 bcm5700
alias eth1 bcm5700
2) Create a file named /etc/sysconfig/network-scripts/ifcfg-bond0 containing the following (change the network info for your particular environment):
DEVICE=bond0
IPADDR=192.168.1.1
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
3) Create a file named /etc/sysconfig/network-scripts/ifcfg-eth0 containing the following:
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
4) Create a file named /etc/sysconfig/network-scripts/ifcfg-eth1 containing the following:
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
5) Reboot the server.
6) Verify team configuration by viewing /proc/net/bond0/info or by using the "ifconfig" command.. The bond MAC address will be the taken from its first slave device.
You can set up your bond interface according to your needs. Changing one parameters (mode=X) in /etc/modprobe.conf allows you to select what you need. Here are the choices:
mode=0: Round-robin load balancing
mode=1: Active backup. Only one slave is active. A different slave becomes active if the active slave fails.
mode=2: Load balancing and fault tolerance.
mode=3: Broadcast. Transmits everything on all slave interfaces. Fault tolerant.
mode=4: Dynamic link aggregation. Bonding for combining bandwith into a single connection.
mode=5: Adaptive transmit load-balancing.
mode=6: Adaptive transmit and receive load balancing
<< Home