This article talk about teaming two ethernet card, with config:
First, you need create a file config call ifcfg-bond0
# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=172.30.27.42
NETMASK=255.255.255.0
GATEWAY=172.30.27.22
DNS1=210.245.31.145
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BONDING_OPTS="mode=5 miimon=100"
remember bonding teaming have 6 mode:
- Mode 0 – Round-robin (RR) policy: Packet transmissions is done in a sequential order. For ex, the first packet is transmitted using the interface and second packet is done through next interface and so on. This mode provides load balancing and fault tolerance.
- Mode 1 – active-backup policy: Packet transmission happens only through the active interface and the traffic is routed through the backup interface only when the active interface went down.
- Mode 2 – XOR policy: This mode balances outgoing traffic across the active ports. In this mode the same slave is used for transmission for each destination MAC address. This provides load balancing and fault tolerance.
- Mode 3 – broadcast policy: This transmits everything on all slave interfaces. This mode provides fault tolerance.
- Mode 4( 802.3ad ): This mode is used to create the link aggregation groups that share the same speed and duplex settings.
- Mode 5( balance-tlb ): Adaptive transmit load balancing. The outgoing traffic is distributed based on the current load on each slave. Incoming traffic is received by the current slave. If the current slave fails, then another slave takes over the incoming traffic based on MAC address.
- Mode 6( balance-alb ): Adaptive load balancing. In this, the incoming traffic is handled to use load balancing across all the slaves. The receive load balancing is done through ARP negotiation.
then, you will config ifcfg-eth0 and eth1 in order to teaming
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:5D:68:39
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
NOTE: you need stop service NetworkManager
# service NetworkManager stop
# vi /etc/modprobe.d/bonding.conf
alias bond0 bonding
# modprobe -v bonding
# service network restart
Check bond0 interface bonding:
# cat /proc/net/bonding/bond0
# ifconfig -a
Done!