Centos 6.564-bit dual-nic binding tutorial

Source: Internet
Author: User

Centos 6.564-bit dual-nic binding tutorial

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.

ServiceNetworkManagerstop

ChkconfigNetworkManageroff

4. Test Results

If any network card is ifdown, normal server communication is not affected.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.