1. environment description my Vmwareworkstation10 installs Centos6.564-bit and dual-port Intel Gigabit NICs, and uses the ifconfig-a | grepeth command to view eth2 and eth3 NICs. 2. bind two Nics: 2.1 modify/etc/sysconfig/network-scripts/ifc
1. environment description
I installed Centos 6.5 64-bit and dual-port Intel Gigabit NICs on Vmware workstation 10, and saw two NICs eth2 and eth3 through the ifconfig-a | grep eth command.
2. bind two Nics:
2.1 modify the/etc/sysconfig/network-scripts/ifcfg-eth2 configuration document, the modified content is as follows:
DEVICE = eth2
ONBOOT = yes # enable the device automatically when the system starts
BOOTPROTO = none # No protocol is used at startup
MASTER = bond0
SLAVE = yes
2.2 modify the/etc/sysconfig/network-scripts/ifcfg-eth3 configuration document, the modified content is as follows:
DEVICE = eth3
ONBOOT = yes # enable the device automatically when the system starts
BOOTPROTO = none # No protocol is used at startup
MASTER = bond0
SLAVE = yes
2.3 Create a configuration file/etc/sysconfig/network-scripts/ifcfg-bond0 bound to the network port, the content is as follows:
DEVICE = bond0 # virtual Nic name
BOOTPROTO = static
IPADDR = 192.168.88.11 # IP address
NETMASK = 255.255.255.0 # subnet mask
GATEWAY = 192.168.88.1 # GATEWAY
BORADCAST = 192.168.88.255 # broadcast address
DNS1 = 8.8.8.8
DNS2 = 222.88.88.88
ONBOOT = yes
TYPE = Ethernet
2.4 modify/etc/modprobe. d/dist. conf, configure the binding model, and add the following content to the configuration file:
Alias bond0 bonding
Options bond0 miimon = 100 mode = 0
# The millmon option specifies the interval for link monitoring. the unit is ms.
# Option mode indicates the working mode of the binding Port. There are 7 modes in total from 0 to 7. commonly used modes include 0 and 1. mode = 0 indicates the "round-robin" policy, the two cards work in the server load balancer status at the same time. Mode = 1 indicates the "active-backup" policy. two cards use the backup status of one slave.
2.5 The modification is/etc/rc. local, which is responsible for binding the virtual network card and two physical network cards at system startup. add the following content:
Ifenslave bond0 eth2 eth3
3. restart the NIC to make the operation take effect.
Service network restart
Note: disable the networkmanager service and set it to not start upon startup to prevent interference with related operations.
Service NetworkManager stop
Chkconfig NetworkManager off
4. test results
If any network card is ifdown, normal server communication is not affected.