Network bonding or network teaming is binding two physical NIC (Network Interface Card) together to create once virtual NIC. This virtual NIC serves purpose of redundancy, fault tolerance and load balancing.
For application running on system its a one NIC they are talking to but on bare metal their requests are being served by two physical cards. Hence in case one physical card is failed or unplugged, another one still serves beneath virtual NIC and applications dont even know about failure. Its same as Auto Port Aggregation in HP-UX.
As of now with RHEL7, there are 7 types of NIC bond available :
- Bond 0 : Load balancing (round robin)
- Bond 1 : Active backup
- Bond 2 : Balance XOR
- Bond 3 : Broadcast
- Bond 4 : 802.3ad
- Bond 5 : Balance TLB
- Bond 6 : Balance ALB
We will see in detail about these types in another post. More commonly used are type 0 and type 1 bonds. Lets see step by step procedure to configure network bond in Linux.
For this tutorial, we will consider two ethernet cards eth1 and eth2 to configure bond. It is assumed that both are configured/connected to same network vlan.
Step 1:
Configure both eth with master bond0 and slave as themselves. For that, open NIC configuration file located in /etc/sysconfig/network-scripts/ifcfg-eth1 & ifcfg-eth2 in vi and edit entries as highlighted below :
For eth2 file, DEVICE name will be eth2.
Step 2:
Create bond0 device file under /etc/sysconfig/network-scripts/ifcfg-bond0. Add below details in it.
Here under bonding options we choose mode 1. If you choose to select any other mode out of 7 mentioned above, you need to specify here against mode=
Step 3:
Make sure bonding module is loaded into kernel. Add append lines in /etc/modprobe.conf file.
Execute module with below command.
Step 4:
Thats it. You are done with configuration. You need to restart networking service and you are good to go. Make sure your network manager service is not running.
You can confirm your bond0 is up with mentioned IP in ip addr command output. Bonding mode can be verified with below command :
Even ifconfig command output will show you bond0 is up with mentioned IP address.
0 comments:
Post a Comment