Configuration Guide
LAG Configuration Guide
18 min
introduction introduction link aggregation combines multiple physical links into one logical link to increase bandwidth, achieve traffic load balancing, and improve link reliability link aggregation has two modes static aggregation and dynamic aggregation users can choose one of these modes based on their characteristics and the specific network setup static aggregation after configuration, the selected/non selected status of the ports is not affected by the network environment, making it relatively stable however, it cannot adjust the selected/non selected status of member ports based on the state of the peer device dynamic aggregation it can adjust the selected/non selected status of ports based on information from both ends, making it more flexible however, the selected/non selected status of member ports is more easily influenced by the network environment explanation of principles explanation of principles ethernet link aggregation bundles multiple physical interfaces into one logical interface, allowing bandwidth to be increased without hardware upgrades a link aggregation interface can be used like a regular ethernet interface to support various routing protocols and other services link aggregation, link aggregation group, and link aggregation interface link aggregation is a technology that bundles several physical interfaces into a single logical interface to increase bandwidth and reliability a link aggregation group refers to the logical link formed by bundling several ethernet links together each aggregation group uniquely corresponds to a logical interface, which is referred to as the aggregation interface member interfaces and member links the physical interfaces that make up the aggregation interface are called member interfaces the links corresponding to these member interfaces are known as member links dynamic link aggregation working mechanism 1 selecting a reference port the reference port is chosen from the member ports on both ends of the aggregation link that are in the up state first, the device with the higher priority is selected from both ends of the aggregation link if device priorities are the same, the system id is compared; the lower the id value, the higher the priority next, on the higher priority device, the port with the higher priority is chosen the smaller the port priority number, the higher the priority if port priorities are the same, the port with the smaller port number is prioritized and selected as the reference port 2 determining the state of member ports on the higher priority device, the state of the member ports is determined if the local port is in the up state and its peer port's system id matches the system id of the reference port's peer, the member port state is set to "selected " if the local port is in the down state, the member port state is "deselected " if the local port is up but its peer port's system id does not match the reference port's peer system id, the member port state is "not synced " at the same time, the device with the lower priority will adjust the state of its member ports according to changes on the peer device, ensuring the consistency of member port states on both ends of the aggregation link member interface states within an aggregation group s (selected) in this state, the member port can participate in data forwarding and is referred to as a "selected port " d (deselected) in this state, the member port cannot participate in data forwarding and is referred to as a "deselected port " (not synced) when the port link is up but due to factors like lacp not being enabled on the peer device or mismatched port properties, the port is placed in a suspended state after message negotiation ethernet link aggregation configuration ethernet link aggregation configuration true 436,134 25051180709343,90 74948819290657#4283c7 unhandled content type #4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type unhandled content type creating a link aggregation group creating a link aggregation group true 301,201 67183673469387,158 32816326530613#4283c7 unhandled content type #4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type adding member interfaces to the aggregation group adding member interfaces to the aggregation group when configuring member ports for the aggregation group, the recommended process is as follows in system view, use the show running config command to check if the ports have any attribute related configurations (such as port isolation, vlan configurations, etc ) if such configurations exist, use the corresponding no commands to remove these configurations, ensuring the ports are in their default attribute state once the ports are in the default state, add them to the created aggregation group true 237,284 2760531137032,139 7239468862968#4283c7 unhandled content type #4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type configuring the working mode of the aggregation group configuring the working mode of the aggregation group true 284,188 07256235827663,188 92743764172337#4283c7 unhandled content type #4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type configuring the system's lacp priority configuring the system's lacp priority configuring the system's priority is important to distinguish the priority between the local device and the peer device in lacp mode for a link aggregation group (lag) to be established, both devices at either end must select the same active interfaces when one device has a higher priority, the other device will select its active ports based on the higher priority device, ensuring consistency of selected ports on both ends the lower the system's lacp priority value, the higher the priority by default, the system lacp priority is set to 65535 if the priority is not configured, the devices will choose the active side based on the system id, with the device having the smaller system id becoming the active device the system id is typically based on the system mac address for example device a’s system mac address 60\ eb 5a 00\ ee\ a7 device b’s system mac address 60\ eb 5a 01 10\ d3 the first three bytes of both mac addresses are identical when comparing the fourth byte, 00 (hex) is smaller than 01 (hex), so device a has a smaller mac address and becomes the active device true 238,249 0204081632653,173 9795918367347#4283c7 unhandled content type #4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type configuring the lacp system id attribute configuring the lacp system id attribute the system id is used to identify a device in the lacp protocol by default, the system id is the mac address of the system when system priority is not explicitly configured, the system id is used to determine the priority between devices, with the device having the smaller system id being given higher priority true 253,235 5374149659864,172 4625850340136#4283c7 unhandled content type #4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type configuring the lacp fast rate attribute configuring the lacp fast rate attribute the fast rate attribute enables the local device’s fast detection mechanism, reducing the lacp packet transmission interval from 30 seconds to 1 second per packet this configuration is particularly useful for networks that require high availability, where faster link failure detection and switchover to backup links are critical to minimize network downtime true 300,224 09070294784578,136 90929705215422#4283c7 unhandled content type #4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type configuring the lacp fallback attribute configuring the lacp fallback attribute the fallback attribute configures the lacp protocol for fast negotiation mode, enabling quick re negotiation of the link aggregation group during a link failure normally, lacp requires some time to re establish the aggregation group if a link fails, which could cause network disruptions or delays, impacting reliability and performance by enabling the fallback attribute, the system will bring the link aggregation group back up even if lacp negotiation fails, ensuring continuous network availability true 302,200 09297052154193,158 90702947845807#4283c7 unhandled content type #4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type display and maintenance display and maintenance true 245,226 5283446712018,189 4716553287982#4283c7 unhandled content type #4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type unhandled content type layer 2 link aggregation group configuration example layer 2 link aggregation group configuration example network requirements device a and device b are connected to each other via their respective ethernet0, 1 configure layer 2 static link aggregation groups on device a and device b, and implement vm interworking in vlan 10 and vlan 20, respectively procedure 1 configuration device a \# create vlan10 and add ethernet3 to this vlan sonic(config)# vlan 10 sonic(config)# interface ethernet 3 sonic(config if 3)# switchport access vlan 10 \# create vlan 20 and add ethernet4 to this vlan sonic(config)# vlan 20 sonic(config)# interface ethernet 4 sonic(config if 4)# switchport access vlan 20 \# create dynamic aggregation port portchannel0001, and add ethernet0, 1 to this aggregation group sonic(config)# interface link aggregation 1 sonic(config lagif 1)# exit sonic(config)# interface ethernet 1 sonic(config if 1)# link aggregation group 1 sonic(config if 1)# exit sonic(config)# interface ethernet 2 sonic(config if 2)# link aggregation group 1 sonic(config if 2)# exit 2 configure device b similar to device a, the configuration process is omitted verify configuration view configuration information by show interfaces portchannel; 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) ethernet1(d) 0002 portchannel0001 lacp(a)(dw) ethernet2(d)
