Command Line Reference
Ethernet Switching
Link Aggregation Configuration
18 min
link aggregation configuration show link aggregation summary \[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 show link aggregation summary command output parameter description team dev link aggregation group name protocol link aggregation group type: dynamic link aggregation group states link aggregation group states ports member interface physical states member interface states in lacp mode interface link aggregation \[command] interface link aggregation lag id no interface link aggregation lag id \[purpose] add aggregation groups \[parameter] parameter description lag id aggregate 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 link aggregation group \[command] link aggregation group lag id \[ port priority ] no link aggregation group \[purpose] add member ports to an aggregation group \[parameter] parameter description lag id aggregate group id port priority interface 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 note 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) mode {dynamic|static} \[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 lacp system priority \[command] lacp system priority system priority \[purpose] configure the sys prio in the portchannel port lacp attribute \[parameter] parameter description system priority system 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 lacp system id \[command] lacp system id mac address no lacp system id \[purpose] configure the sys id in the portchannel port lacp attribute \[parameter] parameter description mac address system 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 show hash capabilities \[command] show hash capabilities \[purpose] the hash method currently supported by the display device \[view] system view \[ use cases ] sonic# show hash capabilities + + + \| hash | capabilities | +========+================================+ \| ecmp | + + + | \| | | hash field | algorithm | | \| | | + | | \| | | src ip | crc | | \| | | dst ip | xor | | \| | | vlan id | crc 32lo | | \| | | l4 src port | crc 32hi | | \| | | l4 dst port | | | \| | | src mac | | | \| | | dst mac | | | \| | | in port | | | \| | + + + | + + + \| lag | + + + | \| | | hash field | algorithm | | \| | | + | | \| | | src ip | crc | | \| | | dst ip | xor | | \| | | vlan id | crc 32lo | | \| | | l4 src port | crc 32hi | | \| | | l4 dst port | | | \| | | src mac | | | \| | | dst mac | | | \| | | in port | | | \| | + + + | + + + show hash brief \[command] show hash brief \[purpose] display the hash method currently configured for the device \[view] system view \[ use cases ] sonic# show hash brief + + + \| hash | configuration | +========+=========================================+ \| ecmp | + + + + | \| | | hash field | algorithm | seed | | \| | | + + | | \| | | dst ip | crc | 10 | | \| | | src ip | | | | \| | | l4 dst port | | | | \| | | l4 src port | | | | \| | + + + + | + + + \| lag | + + + + | \| | | hash field | algorithm | seed | | \| | | + + | | \| | | dst ip | crc | 10 | | \| | | src ip | | | | \| | | l4 dst port | | | | \| | | l4 src port | | | | \| | + + + + | + + + lacp fast rate \[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 hash algorithm {lag|ecmp} {crc|xor|crc 32lo|crc 32hi} \[command] hash algorithm {lag|ecmp} {crc|xor|crc 32lo|crc 32hi} \[purpose] modify the device hash algorithm \[view] system configuration view \[usage scenario] different hash algorithms will yield different load balancing results users can select an appropriate hash algorithm for load balancing based on their traffic model the default hash algorithm for the device is crc \[ use cases ] sonic(config)# hash algorithm lag crc lacp fallback \[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 hash mode \[command] hash mode {lag|ecmp} {hash fields {in port|dst mac|src mac|vlan id|dst ip|src ip|l4 dst port|l4 src port}|src dst ip|src dst ip port|src dst mac|src dst mac ip|src dst mac ip port} \[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 sonic(config)# hash mode lag hash fields in port dst mac hash seed \[command] hash seed interger \[purpose] configure the device hash seed \[parameter] parameter description interger value range 0 4294967295, default value is 10 \[view] system configuration view \[usage scenario] before configuring the hash seed, the hash algorithm must be configured as crc \[ use cases ] sonic(config)# hash seed 100
