Linuxbond configuration steps, seven bond modes

Source: Internet
Author: User
1. Nic binding: Step 1: Create an ifcfg-bondXvietcsysconfignetwork-scriptsifcfg-bo 1. Nic binding: Step 1: Create an ifcfg-bondX

# Vi/etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE = bond0

BONDING_OPTS = "mode = 0 miimon = 100"

BOOTPROTO = none

ONBOOT = yes

BROADCAST = 192.168.0.255

IPADDR = 192.168.0.180

NETMASK = 255.255.255.0

NETWORK = 192.168.0.0

USERCTL = no

BONDING_OPTS = "mode = 0 miimon = 100", mode has multiple modes to implement different functions,

Step 2: modify/etc/sysconfig/network-scripts/ifcfg-ethX

# Vi/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE = eth0

BOOTPROTO = none

ONBOOT = yes

MASTER = bond0

SLAVE = yes

USERCTL = no

# Vi/etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE = eth1

BOOTPROTO = none

ONBOOT = yes

MASTER = bond0

SLAVE = yes

USERCTL = no

Step 3: Configure/etc/modprobe. conf and add alias bond0 bonding

# Vi/etc/modprobe. conf
Alias eth0 e1000e

Alias eth1 e1000e

Alias scsi_hostadapter mptbase
Alias scsi_hostadapter1 mptspi

Alias bond0 bonding

Step 4: Restart the network service

# Service network restart

View/proc/net/bonding/bond0 to view the current mode, and the network adapter that works for the master and slave nodes.
# Cat/proc/net/bonding/bond0

Ethernet ChannelBonding Driver: v3.0.3 (March 23,200 6)

Bonding Mode: fault-tolerance (active-backup)

Primary Slave: None

Currently Active Slave: eth0

MII Status: up

MII PollingInterval (MS): 100

Up Delay (MS): 0

Down Delay (MS): 0

Slave Interface: eth0

MII Status: up

Link FailureCount: 0

Permanent HWaddr: 00: 0c: 29: 01: 4f: 77

Slave Interface: eth1

MII Status: up

Link FailureCount: 0

Permanent HWaddr: 00: 0c: 29: 01: 4f: 8b

II. seven bond modes description: The first mode: mod = 0, namely: (balance-rr) Round-robin policy (balance Round loop policy)

Feature: The packet transmission sequence is sequential transmission (that is, 1st packets go through eth0, and the next packet goes through eth1 .... This mode provides load balancing and fault tolerance capabilities, but we know that if a connection or session data packet is sent from different interfaces, when packets pass through different links in the middle, the client may encounter unordered data packets, and unordered data packets need to be sent again, so the network throughput will decrease.

Mode 2: mod = 1 (active-backup) Active-backup policy (Master-backup policy)

Feature: only one device is active. when one device goes down, the other device is immediately switched from backup to the master device. The mac address is externally visible. from the outside, bond's MAC address is unique to avoid confusion between switches. This mode only provides fault tolerance capabilities. it can be seen that this algorithm has the advantage of providing high network connection availability, but its resource utilization is low, and only one interface is working, when there are N network interfaces, the resource utilization rate is 1/N.

Mode 3: mod = 2, namely: (balance-xor) XOR policy (balance policy)

Feature: transmits data packets based on the specified transmission HASH policy. The default policy is (source MAC address XOR target MAC address) % slave number. Other transmission policies can be specified using the xmit_hash_policy option. this mode provides load balancing and fault tolerance capabilities.

Fourth mode: mod = 3, that is, broadcast (broadcast policy)

Feature: each data packet is transmitted on each slave interface. this mode provides fault tolerance

Fifth mode: mod = 4 (802.3ad) IEEE 802.3 adDynamic link aggregation (IEEE 802.3ad dynamic link aggregation)

Feature: create an aggregation group that shares the same rate and duplex settings. According to the 802.3ad specification, multiple slave instances work in the same active combination.

The outbound traffic slave election is based on the transmission hash policy, which can be changed from the default XOR policy to other policies through the xmit_hash_policy option. It should be noted that not all transmission policies are adapted to 802.3ad, especially considering the packet disorder mentioned in chapter 43.2.4 of the 802.3ad standard. Different implementations may have different adaptability.

Prerequisites:

Condition 1: ethtool supports obtaining the rate and duplex settings for each slave.

Condition 2: The switch supports IEEE 802.3ad Dynamic link aggregation.

Condition 3: Most switches must be configured to support the 802.3ad mode.

Mode 6: mod = 5 (balance-tlb) Adaptive transmit load balancing (adapter transfer load balancing)

Features: no special switch-supported channel bonding is required. Outbound traffic is allocated to each slave based on the current load (based on the speed. If the slave that is receiving data fails, the other slave takes over the MAC address of the failed slave.

Necessary condition for this mode: ethtool supports obtaining the speed of each slave

Mode 7: mod = 6, namely: (balance-alb) Adaptive load balancing (adapter Adaptive load balancing)

Features: This mode includes the balance-tlb mode and the receive load balance (rlb) for IPV4 traffic, without the support of any switch. The received server load balancer is implemented through ARP negotiation. The bonding driver intercepts the ARP response sent by the local machine and changes the source hardware address to the unique hardware address of a server load balancer in bond, so that different peer terminals can communicate with each other using different hardware addresses.

Related Article

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.