Skip to content
Ask AI

Link Aggregation Configuration

[Command]

show link-aggregation summary

[Purpose]

Display LAG configuration information

[View]

System view

[Use Cases]

sonic# show link-aggregation summary
Flags: A - active, I - inactive, Up - up, Dw - Down, N/A - not available,
S - selected, D - deselected, * - not synced
No. Team Dev Protocol Ports
----- --------------- ----------- -------------
0001 PortChannel0001 LACP(A)(Dw) Ethernet46(D)
0002 PortChannel0002 LACP(A)(Dw) Ethernet47(D)

Description of the

ParameterDescription
Team DevLink aggregation group name
ProtocolLink aggregation group type: Dynamic Link Aggregation Group States: Link Aggregation Group States:
PortsMember Interface Physical States: Member Interface States in LACP Mode:

[Command] show hash brief

[Purpose] Show the system hash method

[View] System View

[Use Cases]

Terminal window
sonic# show hash brief
Hash Mode Hash Seed
--------------- -----------
src-dst-ip-port 10

[Command] show lacp config

[Purpose] Show the lacp configuration

[View] System View

[Use Cases]

Terminal window
sonic# show lacp config
Name Mode System-id Fast-rate Fallback System-priority
--------------- ------- ----------------- ----------- ---------- -----------------
PortChannel0001 dynamic 60:eb:5a:01:25:29 false false 65535
PortChannel0002 dynamic 00:00:00:00:00:01 true true 2

[Command]

interface link-aggregation lag_id

no interface link-aggregation lag_id

[Purpose]

Add aggregation groups

[Parameter]

ParameterDescription
lag_idAggregate group id, range 1-9999

[View]

System configuration view

[Use Cases]

sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic(config-lagif-3)# show this
!
interface link-aggregation 3

[Command]

link-aggregation-group lag-id [port-priority ]

no link-aggregation-group

[Purpose]

Add member ports to an aggregation group

[Parameter]

ParameterDescription
lag-idAggregate group id
port-priorityInterface priority, range 0-65535, default 255

[View]

Interface view

[Usage Scenario]

Configuring interface priority is done to differentiate between different interfaces on the same device. Interfaces with higher priority will be selected as active interfaces. If interface priority is not configured, the active interfaces will be selected based on the interface numbers, with lower-numbered interfaces having higher priority.

[Notes]

  • Port-priority is used for setting the priority of device ports. Ports with higher priority will be selected as active ports. This parameter is typically used to configure the priority of multiple ports within a Link Aggregation Group (LAG) to enable fast failover to backup links in case of a link failure.
  • Lacp-key is used for setting the key value for the device’s Link Aggregation Control Protocol (LACP). Ports with the same key value will be considered part of the same aggregation group. When multiple ports in a LAG need to be controlled using LACP, they should have the same key value assigned to be recognized as part of the same aggregation group.
  • Lacp-portid is used to set the port ID for the LACP protocol, which identifies each port within a Link Aggregation Group (LAG). When multiple ports in a LAG need to be controlled using LACP, each port should be assigned a unique port ID for correct identification and control.

[Use Cases]

sonic# configure terminal
sonic(config)# interface ethernet 45
sonic(config-if-45)# link-aggregation-group 1
sonic(config-if-45)# link-aggregation-group 1 port-priority 500
sonic# show link-aggregation summary
Flags: A - active, I - inactive, Up - up, Dw - Down, N/A - not available,
S - selected, D - deselected, * - not synced
No. Team Dev Protocol Ports
----- --------------- ----------- ---------------------------
0001 PortChannel0001 LACP(A)(Dw) Ethernet46(D) Ethernet45(D)
0002 PortChannel0002 LACP(A)(Dw) Ethernet47(D)

[Command]

mode {dynamic|static}

[Purpose]

Configure the mode of the LAG

[View]

Lagif view

[Usage Scenario]

The device currently supports two types of operating modes:

  • Dynamic LACP Mode: In this mode, the device can achieve both load balancing and redundant backup functions. Additionally, it can automatically detect and add member ports to the Link Aggregation Group (LAG). This mode is suitable for scenarios where you want the device to manage LAGs automatically.
  • Default Static Mode: In this mode, LAG creation and the addition of member interfaces are entirely configured manually. This means that you have full control over which interfaces are part of the LAG and how they are configured. This mode is typically used when you want to configure LAGs and their members manually according to specific requirements.

[Use Cases]

sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic(config-lagif-3)# mode dynamic
Please enter 'commit' to make lacp and mode command take effert
sonic(config-lagif-3)# commit
sonic(config-lagif-3)# show this
!
interface link-aggregation 3
mode dynamic

[Command]

lacp system-priority system_priority

[Purpose]

Configure the sys_prio in the portchannel port lacp attribute

[Parameter]

ParameterDescription
system_prioritysystem-priority, in the range 0-65535

[View]

Lagif view

[Usage Scenario]

Configuring the system priority is done to differentiate between the local device’s priority and the remote device’s priority in a Link Aggregation Group (LAG). The device with the higher system priority will be selected as the active side of the LAG, and the selection of active interfaces will be based on the active side’s interfaces. When system priorities are not configured, the local and remote devices will be selected as the active side based on the system IDs. The device with the smaller system ID will become the active side. By default, the system ID is set to the system’s MAC address.

[Use Cases]

sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic (config-lagif-3)# lacp system-priority 100
sonic (config-lagif-3)# show this
!
interface link-aggregation 3
lacp system-priority 100
mode dynamic

[Command]

lacp system-id mac_address

no lacp system-id

[Purpose]

Configure the sys_id in the portchannel port LACP attribute

[Parameter]

ParameterDescription
mac_addresssystem-id, non-all-0 mac address

[View]

Lagif view

[Usage Scenario]

The System ID is used to identify devices in the LACP (Link Aggregation Control Protocol) protocol. By default, the System ID is set to the system’s MAC address. When the system priority is not configured, the devices’ priority is determined based on the System ID’s size. Smaller System IDs are given higher priority.

[Use Cases]

sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic (config-lagif-3)# lacp system-id 00:a0:23:12:23:53
sonic (config-lagif-3)# show this
!
interface link-aggregation 3
commit
lacp system-id 00:a0:23:12:23:53
mode dynamic

[Command]

lacp fast-rate

no lacp fast-rate

[Purpose]

Enable the fast_rate attribute of LACP

[View]

Lagif view

[Usage Scenario]

This configuration will make your local device consider a link as down if it doesn’t receive LACP packets from the remote device within a short period, which is usually around 3 seconds.

[Use Cases]

sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic (config-lagif-3)# lacp fast-rate
sonic (config-lagif-3)# show this
!
interface link-aggregation 3
lacp fast-rate
mode dynamic

[Command]

lacp fallback

no lacp fallback

[Purpose]

Enable the fallback attribute of LACP

[Usage Scenario]

This command is used to enable the fast negotiation mode for the Link Aggregation Control Protocol (LACP). In this mode, the LACP protocol quickly renegotiates the link aggregation group in the event of a link failure, ensuring a fast recovery of the link aggregation group. Typically, LACP protocol link aggregation groups take some time to renegotiate, and if a link failure occurs, the reconfiguration process may lead to network interruption or delays, impacting the reliability and performance of the network. By using this command, the dynamic link aggregation group can be kept in the UP (active) state at all times, providing continuous and reliable network connectivity.

[Use Cases]

sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic (config-lagif-3)# lacp fallback
sonic (config-lagif-3)# show this
!
interface link-aggregation 3
lacp fallback
mode dynamic

[Command]

hash mode {src-dst-mac-ip-port|src-dst-ip|src-dst-ip-port|src-dst-mac|src-dst-mac-ip}

[Purpose]

Configure the device hash mode

[View]

System configuration view

[Usage Scenario]

Using different hash mode will yield different load-balancing results. Users can choose the appropriate hash mode based on their traffic model for load distribution. The default hash method for the device is src-dst-ip-port.

[Use Cases]

sonic(config)# hash mode src-dst-mac-ip-port

[Command]

hash seed interger

[Purpose]

Configure the device hash seed

[Parameter]

ParameterDescription
intergerValue range: 0-4294967295, default value is 10

[View]

System configuration view

[Use Cases]

sonic(config)# hash seed 100