Nic bonding mode-bond0, 1 Configuration

Source: Internet
Author: User

Tag: Bonding

About Nic Bonding

Nic binding virtualizes multiple physical NICs into a virtual Nic through software. After configuration, the IP addresses and MAC addresses of all physical NICs become the same. Multiple NICs can work at the same time to increase network speed and achieve load balancing and redundancy of NICs.


Bonding mode

1 round-robin (mode = 0)

Rotation policy, which sends data packets on each slave Nic in turn to provide load balancing and fault tolerance capabilities.


2 active-Backup (mode = 1)

Active/standby policy. Only one slave is activated. Other slave interfaces are activated only when the active slave interface is down. If a Failover occurs in active/standby mode, one or more gratuitous ARP packets are sent to the newly activated slave interface. Gratuitous ARP is sent to all VLAN interfaces on the primary salve interface and configured on the interface. At least one IP address must be configured on these interfaces. The gratuitous ARP sent on the VLAN interface will be attached with the appropriate vlan id. This mode provides Fault Tolerance capabilities.

Gratuitous ARP is also called free arp. Gratuitous ARP is different from normal ARP requests. It is not expected to obtain the MAC address corresponding to the IP address, but will send a gratuitous ARP request when the host starts, that is, the MAC address of the requested IP address. (From Baidu Encyclopedia: http://baike.baidu.com/view/10101910.htm)


3 XOR (mode = 2)

Based on the selected hash policy, this mode also provides load balancing and fault tolerance capabilities.


4 Broadcast (mode = 3)

Broadcast Policy to send data packets to all slave interfaces. This mode provides Fault Tolerance capabilities.


5 802.3ad (mode = 4)

Dynamic Link aggregation: uses all slave to establish an aggregation link according to 802.3ad standards. The exit of the slave interface depends on the hash policy for transmission. The default policy is a simple XOR policy, and the hash policy can be configured through the xmit_hash_policy option.

Prerequisites: each slave Nic supports ethtool to obtain the speed and duplex status.

The switch supports the IEEE 802.3ad standard (which may need to be configured and enabled)

IEEE 802.3ad is a standard method for implementing link aggregation. Conceptually, aggregating multiple Ethernet adapters to a single virtual adapter is the same as the "etherchannel" function, which provides higher bandwidth to prevent faults. For example, ent0 and ent1 can aggregate to the IEEE 802.3ad link called ent3, and then configure the interface en3 with the IP address. The system considers these aggregated adapters as an adapter. Therefore, you can configure their IP addresses as you would on any Ethernet adapter. (From Baidu Encyclopedia: http://baike.baidu.com/view/1996279.htm? Fr = Aladdin)


6 balance-TLB (mode = 5)

Adaptive transmission load balancing: Based on the load (relative speed) of each slave, it is determined from which interface to send data packets and receive data packets from the current interface. If the received slave interface fails, other slave interfaces will take over its MAC address and continue receiving.

Premise: each slave Nic supports the ethtool acquisition rate.


7 balance-ALB (mode = 6)

Adaptive Load Balancing:

Prerequisites: each slave Nic supports the ethtool acquisition rate.

Hardware address can be reset when each slave Nic is enabled


Summary:

Vswitch settings are not required for Mode 1, 5, and 6.

Vswitch settings are required for Mode 0, 2, 3, and 4.

Mode 0 is used by default.

Bonding driver Loading

CAT/boot/config-2.6.32-431.el6.x86_64 | grep-I bonding config_bonding = m # Here we can see that the bonding driver is compiled into a kernel module that can be dynamically loaded [[email protected] ~] # Vim/etc/modprobe. d/bond. conf # automatically load the bonding driver alias bond0 bondingoptions bond0 miimon = 100 mode = 0 # miimon: How long does it take to check the network, in MS;

Bonding mode 0 Configuration

Vim/etc/sysconfig/network-scripts/ifcfg-bond0 # create a virtual Nic bond0device = bond0ipaddr = 10.10.10.1netmask = 255.255.255.0onboot = yesbootproto = noneuserctl = nogateway = 10.10.10.254
vim  /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0BOOTPROTO=noneONBOOT=yesUSERCTL=noMASTER=bond0SLAVE=yes

vim  /etc/sysconfig/network-scripts/ifcfg-eth1DEVICE=eth1BOOTPROTO=noneONBOOT=yesUSERCTL=noMASTER=bond0SLAVE=ye

# After setting, restart the network service to use bond0.

service network restart
CAT/proc/NET/Bonding/bond0 # view the current bonding status

Bonding mode 1 Configuration

# The specific steps are different in the following steps. Vim/etc/modprobe. d/bond. conf alias bond0 bondingoptions bond0 miimon = 100 mode = 1 # mode 1vim/etc/rc. d/RC. local # eth0 eth1 work order (only in Master/Slave Mode) ifenslave bond0 eth0 eth1

Reference

Http://www.cnblogs.com/Skyar/p/3397072.html

This article is from the "the-way-to-cloud" blog, please be sure to keep this source http://iceyao.blog.51cto.com/9426658/1572214

Nic bonding mode-bond0, 1 Configuration

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.