Mode Bond1:active-backup
Mode features: One port is in the main state, one is in the slave state, all traffic is processed on the main link, and there is no traffic. When the primary port is down, the master state is inherited from the port.
Stop NetworkManager first.
Service NetworkManager Stop
Chkconfig NetworkManager off//boot off
In the/etc/sysconfig/network-scripts/directory to establish the Ifcfg-bond0 file, the file contents are as follows:
Device=Bond0userctl=Nobootproto=Noneonboot=yesipaddr=192.168.100.17 //the IP that you setnetmask=255.255.255.0GATEWAY=192.168.100.1TYPE=unknown//or Ethernet (use unknown if NetworkManager is not closed)bonding_opts="miimon=80 mode=0" //This step can also be completed in the following/etc/modprobe.d/bonidng.conf
The binding mode is 0, which is the rond-robin pattern.
Then modify the Ifcfg-eth0 file separately, as follows:
Device="eth0"onboot="Yes"bootproto= nonemaster=bond0slave=yesuserctl=no
Modify the Ifcfg-eth1 file as follows:
Device="eth1"onboot="Yes"bootproto= nonemaster=bond0slave=yesuserctl=no
In the/etc/modprobe.d/directory to establish the bonding.conf file, the file contents are as follows:
Alias Bond0 Bonding
---If the previous bond0 configuration is not filled bonding_opts, here is another line: Options bond0 miimon=100 mode=0
Perform
modprobe Bonding
Then restart the network
Service Network restart
-------if using a remote connection, use: modprobe bonding&&service Network restart
You can then use Ifconfig-a to see the BOND0 network adapter, BOND0 and Eth0,eth1 MAC address are the same.
You can cat/proc/net/bonding/bond0 this command to view the binding situation
Nic binding is lifted:
Delete ifcfg-bond0, and delete/etc/modprobe.d/bonding.conf
Modify the appearance of Ifcfg-eth0 and ifcfg-eth0 before binding
Rmmod bonding (Very important)
Service Network restart
Precautions:
1.warning:the permanent HWaddr of Eth0-00:0c:29:2d:4a:87-is still in use by BOND0. Set the HWaddr of eth0 to a different address to avoid conflicts.
An: In the online search, many people are said to be the problem of VMware Workstation, physical machine do not problem. The specific reason is not very clear, I check the information on the Internet: http://blog.csdn.net/robertkun/article/details/16873961, but I have not tried.
The most direct solution: Recommend testing time do not use Ifdown eth0 to test, but in the lower right corner of the workstation to find the Eth0 network adapter, right-click Disconnect.
2. Why eth0 repair, bond0 does not return eth0
3.
[Email protected] network-scripts]#Catifcfg-bond0 DEVICE=Bond0onboot=yes# dual Nic Ipipaddr=192.168.1.100GATEWAY=192.168.1.1NETMASK=255.255.255.0#mode0代表Active-backup Policy (Master-backup policy) bonding_opts="miimon=80 mode=1"[[Email protected] network-scripts]#Catifcfg-ETHCat: Ifcfg-eth:no Suchfileor Directory[[email protected] network-scripts]#Catifcfg-Eth0device="eth0"#IPADDR=192.168.1.200#NM_CONTROLLED="Yes"Onboot="Yes"#NETMASK=255.255.255.0#GATEWAY=192.168.1.1MASTER=Bond0slave=Yestype="Ethernet"UUID="a90ad08d-f6e9-4f34-94e3-690d44454e9e"[[Email protected] network-scripts]#Catifcfg-Eth1device="eth1"#IPADDR=192.168.174.200#NM_CONTROLLED="Yes"Onboot="Yes"MASTER=Bond0slave=Yes#netmask=255.255.255.0#GATEWAY=192.168.1.1#TYPE="Ethernet"#UUID="a90ad08d-f6e9-4f34-94e3-690d44454e9e"
Thank you: http://blog.csdn.net/yh10169658/article/details/52220582
Linux dual NIC bindings ~