A: Principle:
There are seven modes for dual NIC bindings under Linux operating system. Now the general enterprise will use dual-card access, so that both the network bandwidth can be added, while the corresponding redundancy can be said to be a lot of benefits. And the general enterprise will use the Linux operating system comes with the network card binding mode, of course, now the network card manufacturers will also be some for the Windows operating system network card management software to do network card binding (Windows operating system does not have a network card binding feature requires third-party support). To get to the point, Linux has seven types of NIC binding mode: 0. Round robin,1.active-backup,2.load Balancing (XOR), 3.fault-tolerance (broadcast), 4.LACP, 5.transmit load balancing, 6. Adaptive load Balancing.
Two: Case one :mode=1 (active-backup): One network card is active, one is in a backup state, and all traffic is processed on the main link. When the active NIC is down, the network card that is backed up is enabled.
1:[[email protected] ~]# vim/etc/sysconfig/network-scripts/ifcfg-eth0 #编辑该设备eth0
[Email protected] ~]# vim/etc/sysconfig/network-scripts/ifcfg-eth1 #编辑该设备eth1
2:[[email protected] ~]# cd/etc/sysconfig/network-scripts/
[email protected] network-scripts]# CP ifcfg-eth0 IFCFG-BOND0 #生成一个bond0的虚拟网卡
[Email protected] network-scripts]# vim ifcfg-bond0 #编辑该网卡内容
3:[[email protected] network-scripts]# vim/etc/modprobe.conf #编辑该配置文件
Medium 1 means that the system loads the bonding module at startup, and the external virtual network interface device is bond0;miimon=100 that the system monitors the link connection status every 100ms, and if one line fails, it goes to another line.
mode=1 means that fault-tolerance (active-backup) provides redundancy, working in a way that the master works, which means that only one NIC works by default, and the other is backed up.
4:[[email protected] network-scripts]# vim/etc/rc.local #编辑该开机脚本, bind eth0 and eth1 network cards
5:[[email protected] network-scripts]# init 6 #重启, bond0 start successfully
[[email protected] ~]# ifconfig #查看网卡信息, where the MAC address of the three NIC is the same
[[Email protected] ~] #vim/proc/net/bonding/bond0 #查看模式及网卡信息. The actual MAC address is not the same
Test:
6:xshell:\> Ping 192.168.101.50–t #一直测试网络的连通性查看结果
Display results after eth0 NIC is disconnected
When the NIC Eth0 is broken, the system uses the backup Nic Eth1, at which time eth1 is active
case Two:mode=0 (round robin): All links are in a load-balanced state, and this mode features increased bandwidth while supporting fault tolerance.
1: On the basis of case one, only the/etc/modprobe.conf configuration file needs to be modified:
2:vim/proc/net/bonding/bond0 #查看使用的模式及网卡信息,
Test : mode=0:
3:xshell:\> Ping 192.168.101.50–t #一直测试网络的连通性查看结果
When the NIC eth1 is broken, the system can still ping through
This article is from "..." Blog, be sure to keep this source http://5503845.blog.51cto.com/5493845/96258
Linux under dual NIC binding bond0 "Turn"