following configuration collected from other blogs.
This blog introduces Link Aggregation Control Protocol (LACP) bonding and provides step-by-step configuration of LACP bonding on Red Hat Enterprise Linux (RHEL) and CentOS operating systems versions 6 and 7.
Introduction
Network bonding enables the combination of two or more network interfaces into a single-bonded (logical) interface, which increases the bandwidth and provides redundancy. If a specific network interface card (NIC) experiences a problem, communications are not affected significantly as long as the other slave NICs remain active.
Bonding modes supported by RHEL and CentOS operating systems
The behavior of the bonded interfaces depends on the mode that is selected. RHEL supports the following common bonding modes:
- Mode 0 (balance-rr): This mode is also known as round-robin mode. Packets are sequentially transmitted and received through each interface one by one. This mode provides load balancing functionality.
- Mode 1 (active-backup): This mode has only one interface set to active, while all other interfaces are in the backup state. If the active interface fails, a backup interface replaces it as the only active interface in the bond. The media access control (MAC) address of the bond interface in mode 1 is visible on only one port (the network adapter), which prevents confusion for the switch. Mode 1 provides fault tolerance.
- Mode 2 (balance-xor): The source MAC address uses exclusive or (XOR) logic with the destination MAC address. This calculation ensures that the same slave interface is selected for each destination MAC address. Mode 2 provides fault tolerance and load balancing.
- Mode 3 (broadcast): All transmissions are sent to all the slaves. This mode provides fault tolerance.
- Mode 4 (802.3ad): This mode creates aggregation groups that share the same speed and duplex settings, and it requires a switch that supports an IEEE 802.3ad dynamic link. Mode 4 uses all interfaces in the active aggregation group. For example, you can aggregate three 1 GB per second (GBPS) ports into a 3 GBPS trunk port. This is equivalent to having one interface with 3 GBPS speed. It provides fault tolerance and load balancing.
- Mode 5 (balance-tlb): This mode ensures that the outgoing traffic distribution is set according to the load on each interface and that the current interface receives all the incoming traffic. If the assigned interface fails to receive traffic, another interface is assigned to the receiving role. It provides fault tolerance and load balancing.
- Mode 6 (balance-alb): This mode is supported only in x86 environments. The receiving packets are load balanced through Address Resolution Protocol (ARP) negotiation. This mode provides fault tolerance and load balancing.
IEEE 802.3ad Link Aggregation Policy and LACP
Before we explore LACP configuration, we should understand the IEEE 802.3ad link aggregation policy and LACP bonding, which allows us to aggregate multiple ports into a single group. This process combines the bandwidth into a single connection.
IEEE 802.3ad link aggregation enables us to group Ethernet interfaces at the physical layer to form a single link layer interface, also known as a link aggregation group (LAG) or bundle.
Some users require more bandwidth in their network than a single fast Ethernet link can provide. Using IEEE 802.3ad link aggregation in this situation provides increased port density and bandwidth at a lower cost.
For example, if you need 2 GBPS bandwidth to transmit data and have only 1 GBPS Fast Ethernet links installed on your system, creating a LAG bundle containing two 1 GBPS Fast Ethernet links is more cost-effective than purchasing a single 2 GBPS Ethernet link.
The following diagram illustrates the IEEE 802.3ad link aggregation policy:
LACP is a mechanism for exchanging port and system information to create and maintain LAG bundles. The LAG bundle distributes MAC clients across the link layer interface and collects traffic from the links to present to the MAC clients of the LAG bundle.
LACP identifies the MAC address of the Ethernet link that has the highest port priority and is of the lowest value, and it assigns that MAC address to the LAG bundle.
This bonding mode requires a switch that supports IEEE 802.3ad dynamic links.
Steps to configure LACP bonding
Preparation: Collect the required details to configure bonding. We recently implemented on production servers the scenario shown in the following table. We changed the IP address, MAC, and UUID details to maintain security.
Bond interface | bond1 |
---|---|
Bonding type | 802.3ad |
Bonding options | miimon=100,lacp_rate=fast,xmit_hash_policy=layer2+3 |
Slave interfaces | p5p1 p5p2 |
MTU | 9000 |
IP address/prefix | 179.254.0.2/16 |
The following sections show the steps to configure LACP bonding by using the command line interface (cli) and the NetworkManager command line interface (nmcli) tools.
STEPS TO CONFIGURE LACP BONDING ON RHEL OR CENTOS 6 BY USING THE CLI TOOL
- Backup the existing interfaces before you configure the bonding. Bring
$slave1
and$slave2
down and move these files to a backup directory by using the following commands: - Make sure module bonding is loaded by using the following command. You can also load the module with the command
#modprobe bonding
. - Create the file
ifcfg-bond1
and modify the configuration by using the following commands: - Modify the slave interface (
slave1
andslave2
) configurations by using the following commands: - Restart the network or restart the server by using one of the following commands:
- After the service or server restart, check the
proc
for a bond interface by using the following command: - Execute
ifconfig -a
and check that yourbond1
interface is active.
This completes the configuration of LACP bonding on RHEL or CentOS 6 by using the cli tool.
STEPS TO CONFIGURE LACP BONDING ON RHEL OR CENTOS 7 BY USING THE NMCLI TOOL
- Backup the existing interfaces that you plan to configure as bond slaves by using the following commands:
- Check the status of the interfaces to be configured as bond slaves by using the following commands:
- Create a bond connection by using the bonding options in the preceding preparation table and run the following command for a private network:
3.5 If you want to setup a bond for public network, you must run the following command instead:
- Restart the NetworkManager service by using the following command:
- Check the status of the bond and slave interfaces to verify that the bond1 interface is running by using the following commands:
- After the configuration is complete, check the output of the following commands to verify that the bond1 interface is active and no error is found:
This completes the process of LACP bonding on RHEL or CentOS 7 by using the nmcli tool.
Conclusion:
If you need more bandwidth in your network than a single NIC can provide, LACP bonding is very useful. Using IEEE 802.3ad link aggregation in this situation provides increased port density and bandwidth. For more options, refer to the nmcli documentation.
No comments:
Post a Comment