CentOS dual-nic binding practices
CentOS version
12
Datanode01: ~> Cat/etc/redhat-releaseCentOS release 6.4 (Final) Disable NetworkManager
1234
# Disable NetworkManager immediately and disable automatic startup/etc/init. d/NetworkManager stopchkconfig NetworkManager off/etc/init. d/network restart Disable iptables and selinux (optional)
1234567
# Disable iptables immediately and disable automatic startup/etc/init. d/iptables stopchkconfig iptables off # disable selinux immediately and permanently disable setenforce 0sed-I's/SELINUX = enforcing/SELINUX = disabled/'/etc/selinux/config Modify host name
12345678
Vi/etc/sysconfig/networkNETWORKING = yesHOSTNAME = namenode01 # refresh the valid hostname namnode01source/etc/sysconfig/network Configure the private IP Address
12345678910
Cd/etc/sysconfig/network-scripts [root @ datanode09 network-scripts] # cat ifcfg-eth3DEVICE = eth3ONBOOT = yesBOOTPROTO = noneIPADDR = 10.129.46.19NETMASK = 255.255.255.01166init = noUSERCTL = no Bind two NICs
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
Cd/etc/sysconfig/network-scripts # edit eth0cat> ifcfg-eth0 <EOFDEVICE = eth0ONBOOT = yesBOOTPROTO = noneUSERCTL = noMASTER = others # edit eth2cat> ifcfg-eth2 <EOFDEVICE = eth2ONBOOT = yesBOOTPROTO = noneUSERCTL = noMASTER = bond0cat # edit bond0cat> ifcfg-bond0 <EOFDEVICE = bond0TYPE = EthernetONBOOT = yesBOOTPROTO = noneIPADDR = hardware = 255.255.255.0GATEWAY = hardware = noUSERCTL = noEOF # set bond parameters, note that mode is cat>/etc/modprobe. conf <EOFalias bond0 bondingoptions bond0 miimon = 100 mode = 6EOF # Add the auto-start parameter cat>/etc/rc. local <EOFifenslave bond0 eth0 eth2EOF # restart the NIC service network restart # Make the bound Nic effective immediately ifenslave bond0 eth0 eth2 # test the network binding ping 10.3.3.1 Comparison of three common Nic binding modes mode = 0
Interrupt any link or restore link, zero packet loss on the network
Advantage: traffic is doubled
Disadvantage: You need to connect to the same vswitch for aggregation configuration, so the high availability of the physical switch cannot be guaranteed (Cisco seems to have a solution ?)
Mode = 1
When one link is interrupted, 1-3 packets are lost (in seconds), and zero packet loss is restored.
Advantage: No need to configure the vswitch
Disadvantages:
Mode = 6
Zero packet loss occurs when any link is interrupted. 10-15 packets are lost when the link is recovered (in seconds)
Advantage: vswitches do not need to be configured, and the traffic is doubled
Disadvantage: Packet Loss takes too long to recover the link.