Linuxbond configuration steps, seven bond mode descriptions

  

First, 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 for different functions,

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

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

DEVICE=eth0

BOOTPROTO=none

ONBOOT=yes< Br>

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: Set /etc/modprobe.conf, 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 it by looking at /proc/net/bonding/bond0 What mode is currently used, and if it is active/standby, which network card is currently working. # cat/proc/net/bonding/bond0

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

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

Two or seven bond modes Description:

The first mode: mod=0, ie: (balance- Rr) Round-robin policy

Features: The order of transmission packets is transmitted in sequence (ie: the first packet goes eth0, the next packet goes eth1…. it keeps looping until The last transfer is complete), this mode provides load balancing and fault tolerance; but we know that if a connection or session packet is sent from a different interface After passing through different links in the middle, there is a possibility that the packet arrives randomly in the client, and the out-of-order packet needs to be re-requested, so the throughput of the network will drop
< H2> The second mode: mod=1, ie: (active-backup) Active-backup policy

Features: Only one device is active, when one is smashing another Converted from backup to master. The mac address is externally visible. From the outside, the MAC address of the bond is unique to avoid confusion on the switch. This mode only provides fault tolerance; thus the advantage of this algorithm is that it can provide high network connection availability, but its resource utilization is low, only one interface is working, in the case of N network interfaces, Resource utilization is 1/N

The third mode: mod=2, ie: (balance-xor) XOR policy

Features: Transmission based on specified transmission HASH policy data pack. The default policy is: (source MAC address XOR destination MAC address) % slave number. Other transmission strategies can be specified by the xmit_hash_policy option, which provides load balancing and fault tolerance.

The fourth mode: mod=3, ie: broadcast (broadcast policy)

Features: At each Each packet is transmitted on a slave interface. This mode provides fault tolerance.

The fifth mode: mod=4, ie: (802.3ad) IEEE 802.3adDynamic link aggregation (IEEE 802.3ad Dynamic Link Aggregation)

Features: Create an aggregation group that shares the same rate and duplex settings. Multiple slaves work under the same activated aggregate according to the 802.3ad specification.

The slave election for outgoing traffic is based on the transport 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 strategies are adapted to 802.3ad, especially considering the out-of-order problem mentioned in section 43.2.4 of the 802.3ad standard. Different implementations may have different adaptabilities.

Prerequisites:

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

Condition 2: switch (switch) supports IEEE 802.3ad Dynamic link Aggregation

Condition 3: Most switches (switches) need to be specifically configured to support 802.3ad mode

Sixth mode: mod=5, ie: (balance-tlb) Adaptive transmit load Balancing (adapter transmission load balancing)

Features: No special switch (switch) supported channel bonding. Outgoing traffic is allocated on each slave based on the current load (calculated based on speed). If the slave that is accepting the data fails, the other slave takes over the MAC address of the failed slave.

The necessary conditions for this mode: ethtool supports the rate of getting each slave

The seventh mode: mod=6, ie: (balance-alb) Adaptive load balancing Equilibrium)

Features: This mode includes balance-tlb mode, plus receive load balance (rlb) for IPV4 traffic, and does not require any switch support. Receive load balancing is implemented through ARP negotiation. The bonding driver intercepts the ARP reply sent by the local machine and rewrites the source hardware address to the unique hardware address of a slave in the bond, so that different peers use different hardware addresses for communication.

Copyright © Windows knowledge All Rights Reserved