cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
546
Views
0
Helpful
0
Comments
smallbusiness
Community Manager
Community Manager

Article ID:5848

Configuring LAG Settings on a Switch through the Command Line Interface (CLI)

Objective

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).

Note: For instructions on how to configure LAG on a switch through the Graphical User Interface (GUI), click here

Applicable Devices

  • Sx500 Series Switches
  • Sx350X Series Switches
  • Sx550X Series Switches

Software Version

  • V2.3.5.63

LAG Configuration Procedure

In this document, we have two SG550X-24 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.

Note: In this example, we will be using the SG550X 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:

SG550X#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 – Port channel load balancing is based on the source and destination MAC addresses.
  • src-dest-mac-ip – Port channel load balancing is based on the source and destination of MAC and IP addresses.

Note: src-dst-mac is the default option. In this example, we leave the load balacing as the default option.

SG550X(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.

SG550X(config)#interface range GigabitEthernet1/0/1-2

Note: 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 master-slave mode of a given interface, use the negotiation Interface (Ethernet, Port channel) Configuration mode command. In this example, we will be disabling auto-negotiation.

SG550X(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:

  • Port-channel – Specifies the port channel number for the current port to join.
  • Mode – Specifies the mode of joining the port channel. The possible values are:
    • On – Forces the port to join a channel without an LACP operation.
    • Auto – Forces the port to join a channel as a result of an LACP operation.

SG550X(config-if-range)#channel-group port-channel mode {on|auto}

In this example, we will be configuring channel-group 1 with LACP.

SG550X(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.

SG550X(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:

  • auto – Specifies auto-negotiation of Flow Control.
  • on – Enables Flow control.
  • off – Disables Flow control.

SG550X(config-if)#flowcontrol {auto|on|off}

In this example, we will be turning flow control on.

SG550X(config-if)#flowcontrol on

Note: To disable Flow Control, use the no form of this command. For example:

SG550X(config-if)#no flowcontrol

Step 9. To add a description to an interface, use the description Interface (Ethernet, Port Channel) Configuration mode command.

SG550X(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.

SG550X(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.

SG550X(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.

SG550X(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.

SG550X#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. In this example, we will be typing Y.

Link Aggregation Control Protocol (LACP) Commands

Step 1. From the Privileged EXEC mode of the switch, enter the Global Configuration mode by entering the following:

SG550X#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.

SG550X(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. In this example, we will be leaving the port priority as 1.

SG550X(config-if-range)#lacp port-priority value

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:

  • long – Specifies the long timeout value.
  • short – Specifies the short timeout value.

SG550X(config-if-range)#lacp timeout {long|short}

For this example, we will be using the default value of long for our LACP timeout.

SG550X(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.

SG550X(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. In this example, we will be using the default value of 1.

SG550X(config-if-range)#lacp system-priority value

Note: If you want to save your running configuration to the startup configuration, please follow steps 11-13 in the previous section: LAG Configuration Procedure.

Conclusion

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:

SG550X#show interfaces port-channel [interface-id]

Step 2. To display LACP information for all Ethernet ports or for a specific Ethernet port, use the show lacp Privileged EXEC mode command.

SG550X#show lacp interface-id [parameters|statistics|protocol-state]

In this example, we will be looking at GE1/0/1 statistics for LACP.

SG550X#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.

SG550X#show lacp port-channel [port_channel_number]

The command below is the command we used to display LACP information for a port-channel.

SG550X#show lacp port-channel 1

Note: The MAC address has been blurred out in the picture below.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: