Link Aggregation Group (LAG) multiply the bandwidth, increase port flexibility, and provide link redundancy between two devices. Link Aggregation Control Protocol (LACP) is a part of IEEE specification (802.3az) that can control the bundling of several physical ports together to form a single logical channel. Traffic load balancing over the active member ports of a LAG is managed by a hash-based distribution function that distributes unicast and multicast traffic based on Layer 2 or Layer 3 packet header information. LACP helps to form one single LAG by bundling many physical ports. It is also responsible for bandwidth multiplication, increase in port flexibility, and in providing redundancy on links between any 2 devices. Additionally this helps in changing the LAG speed, advertisement, flow control, and also protection which can be easily identified in LAG settings table.
This document explains how to configure LAG on a switch through the Command Line Interface (CLI).
For instructions on how to configure LAG on a switch through the Graphical User Interface (GUI), click here
In this document, we have two CBS350 switches connected to each other on ports GE1/0/1 and GE1/0/2. All the member ports should have the same configuration and speed. The configuration is configured on both of the switches.
Step 1. SSH to the switch. The default username and password is cisco/cisco. If you have configured a new username or password, enter the credentials instead.
In this example, we will be using the CBS350 to configure LAG. To learn how to access an SMB switch CLI through SSH or Telnet, click here.
Step 2. From the Privileged EXEC mode of the switch, enter the Global Configuration mode by entering the following:
CBS350#configure
Step 3. To configure the load balancing policy of the port channeling, use the port-channel load-balance Global Configuration mode command. The parameters are defined as:
src-dst-mac is the default option. In this example, we leave the load balacing as the default option.
CBS350(config)#port-channel load-balance {src-dest-mac/src-dst-mac-ip}
Step 4. To execute a command on multiple ports at the same time, use the interface range command. In this example, we will be configuring port 1 and 2 of the switch.
CBS350(config)#interface range GigabitEthernet1/0/1-2
To configure a single interface, use the interface interface-id command.
Step 5. To enable auto-negotiation operation for the speed and duplex parameters and primary-subordinate mode of a given interface, use the negotiation Interface (Ethernet, Port channel) Configuration mode command. In this example, we will be disabling auto-negotiation.
CBS350(config-if-range)#no negotiation
Step 6. To associate a port with a port-channel, use the channel-group Interface Configuration mode command. The parameters are defined as:
CBS350(config-if-range)#channel-group port-channel mode {on|auto}
In this example, we will be configuring channel-group 1 with LACP.
CBS350(config-if-range)#channel-group 1 mode auto
Step 7. To enter the Interface Configuration mode in order to configure an interface, use the interface Global Configuration mode command. In this example, we will be configuring port-channel 1.
CBS350(config-if-range)#interface port-channel 1
Step 8. To configure the flow control on a given interface, use the flow control Interface (Ethernet, Port Channel) Configuration mode command. Flow control is a feature that allows the receiving device to send a signal to the sending device that it is congested. This tells the sending device to temporarily stop transmitting to help ease the congestion. The parameters are defined as:
CBS350(config-if)#flowcontrol {auto|on|off}
In this example, we will be turning flow control on.
CBS350(config-if)#flowcontrol on
To disable Flow Control, use the no form of this command. For example:
CBS350(config-if)#no flowcontrol
Step 9. To add a description to an interface, use the description Interface (Ethernet, Port Channel) Configuration mode command.
CBS350(config-if)#description LAG1
Step 10. (Optional) A trunk interface is an untagged member of a single VLAN, and, in addition, it may be a tagged member of one or more VLANs. Use the switchport trunk allowed vlan Interface Configuration mode command to add/remove VLAN(s) to/from a trunk port.
CBS350(config-if)#switchport trunk allowed vlan {all|none|add vlan-list|remove vlan-list|except vlan-list }
In this example, we allowed vlan 2-15, 100, 105-115.
CBS350(config-if)#switchport trunk allowed vlan add 2-15,100,105-115
Step 11. To end the current configuration session and return to the Privileged EXEC mode, use the end command.
CBS350(config-if)#end
Step 12. (Optional) To copy any file from a source to a destination, use the copy command in Privileged EXEC mode. In this example, we will be copying the running configuration to the startup configuration.
CBS350#copy running-config startup-config
Step 13. (Optional) A message will appear asking if you would like to overwrite your running-config to the startup-config. Type Y for yes or N for No.
Step 1. From the Privileged EXEC mode of the switch, enter the Global Configuration mode by entering the following:
CBS350#configure
Step 2. To execute a command on multiple ports at the same time, use the interface range command. In this example, we will be configuring port 1 and 2 of the switch.
CBS350(config)#interface range GigabitEthernet1/0/1-2
Step 3. To set the physical port priority, use the lacp port-priority Interface (Ethernet) Configuration mode command. Each port configured to use LACP has an LACP port priority. You can configure a value between 1 and 65535. LACP uses the port priority in combination with the port number to form the port identifier. The port priority is used to decide which ports should be put into standby mode when there is a hardware limitation that prevents all compatible ports from aggregating. The default port priority is 1.
CBS350(config-if-range)#lacp port-priority value
In this example, we will be leaving the port priority as 1.
CBS350(config-if-range)#lacp port-priority 1
Step 4. To assign an administrative LACP timeout to an interface, use the LACP timeout Interface (Ethernet) Configuration mode command. LACP timeout is time interval between the sending and receiving of consecutive LACP protocol data units (PDUs). Select the periodic transmissions of LACP PDUs, which occur at either a long or short transmission speed, depending upon the expressed LACP timeout preference. The default port timeout value is long. The parameters are defined as:
CBS350(config-if-range)#lacp timeout {long|short}
For this example, we will be using the default value of long for our LACP timeout.
CBS350(config-if-range)#lacp timeout long
Step 5. To exit any mode and bring the user to the next higher mode in the CLI mode hierarchy, use the exit command.
CBS350(config-if-range)#exit
Step 6. To set the system priority, use the lacp system-priority Global Configuration mode command. To restore the default configuration, use the no form of this command. LACP system priority must be configured on each switch running LACP. They can be configured automatically or through the CLI). LACP uses the system priority with the switch MAC address to form the system ID and also during negotiation with other systems. The default system priority is 1.
CBS350(config-if-range)#lacp system-priority 1
In this example, we will be using the default value of 1.
CBS350(config-if-range)#lacp system-priority value
If you want to save your running configuration to the startup configuration, please follow steps 11-13 in the previous section: LAG Configuration Procedure.
You should now have configured LAG on your interfaces through the CLI.
Step 1. To verify that your port-channel has been created. Use the command below:
CBS350#show interfaces port-channel [interface-id]
CBS350#show interfaces port-channel 1
Step 2. To display LACP information for all Ethernet ports or for a specific Ethernet port, use the show lacp Privileged EXEC mode command.
CBS350#show lacp interface-id [parameters|statistics|protocol-state]
In this example, we will be looking at GE1/0/1 statistics for LACP.
CBS350#show lacp ge1/0/1 statistics
Step 3. To display LACP information for a port-channel, use the show lacp port-channel Privileged EXEC mode command.
CBS350#show lacp port-channel[port_channel_number]
The command below is the command we used to display LACP information for a port-channel.
CBS350#show lacp port-channel 1
Revision | Publish Date | Comments |
---|---|---|
2.0 |
07-Aug-2024 |
Formatting edits |
1.0 |
15-Jul-2020 |
Initial Release |