1: configure the eth0 ip address in the graphic interface. # Cd/etc/sysconfig/network-scripts # cpifcfg-eth0ifcfg-bond0 // you can copy the content of the ifcfg-eth0 # viifcfg-bond0 & nbsp
1: FirstEth0OfIpAnd so on.
#Cd/etc/sysconfig/network-scripts
#Cp ifcfg-eth0 Ifcfg-bond0//You can setIfcfg-eth0The content is copied.
#Vi ifcfg-bond0//ModifyDEVICEIsBond0,SetMacDelete address
DEVICE = bond0
ONBOOT = yes
BOOTPROTO = none
IPADDR = 192.168.128.225
NETMASK = zookeeper
GATEWAY = 192.168.128.233
USERCTL = no
2.Change/Etc/sysconfig/network-scripts/ifcfg-eth0Nic attributes
DEVICE = eth0
ONBOOT = yes
BOOTPROTO = none
USERCTL = no
MASTER = bond0
SLAVE = yes
3.Change/Etc/sysconfig/network-scripts/ifcfg-eth1Nic attributes
DEVICE = eth1
ONBOOT = yes
BOOTPROTO = none
USERCTL = no
MASTER = bond0
SLAVE = yes
4.Edit/Etc/modprobe. confFile,Add the following content
Alias bond0 bonding
Options bond0 miimon = 100 mode = 0
Note:
(1)MiimonIs used for link monitoring. For example: Miimon = 100, Then every system100 msMonitors the connection status of one link. If one line fails, it is transferred to another line;
(2)ModeThe value indicates the working mode.0, 1, 2, 3Four modes, commonly used0, 1.
Mode = 0IndicatesLoad balancing (round-robin)For load balancing,Both NICs work.When one of the NICS goes down, the other will continue to work..
Mode = 1IndicatesFault-tolerance (active-backup)Provides the redundancy function, working in the following way:Active/standby mode,That is to say, only one network card works by default.,Back up the other part.
It should be noted that if you want to achieve Load Balancing,Set here onlyOptions bond0 miimon = 100 mode = 0Not enough,You also need to set the vswitch Port.Mode 0LowerBondTheIPAll are modified to the sameMacAddress. If these NICs are connected to the same vswitchArpTableMacThere are multiple ports corresponding to the address, so the switch acceptsMacWhich port should the address package forward? Under normal circumstancesMacThe address is globally unique.MacThe switch is certainly confused when the address corresponds to multiple ports.
5.Join/Etc/rc. d/rc. localStartup Item
#Vi/Etc/rc. d/rc. local
Ifenslave bond0 eth0 eth1
6.Restart NETWORK SERVICE
#Service network restart
7.View binding status
#Cat/Proc/net/bonding/bond0