Configuration Guide
LAG Configuration Guide
47 min
introduction introduction link aggregation increases link bandwidth, enables load sharing of traffic and improves link reliability by aggregating multiple physical links together to form a single logical link as shown below, device a and device b are connected by three physical links, which are bundled into one logical link with a maximum bandwidth equal to the total bandwidth of the three physical links at the same time, the three physical links are backed up by each other, so that when one of the links goes down, the other two links can still work basic concepts basic concepts aggregation group and member port aggregation group and member port multiple ports are aggregated to form an aggregation group and these ports are called member ports of that aggregation group each aggregation group uniquely corresponds to a logical interface, called link aggregation interface aggregation group and link aggregation interface are numbered consistently note in this manual, ‘portchannel’ and ‘lag’ have the same meaning, both referring to a link aggregation group status of member port status of member port the member ports within the aggregation group have the following states selected the member ports in this state are called selected ports and can participate in data forwarding unselected member ports in this state are called unselected ports and do not participate in data forwarding aggregation mode aggregation mode link aggregation is divided into two modes static and dynamic aggregation static aggregation once configured, the selected/unselected state of the port is not affected by the network environment and is more stable dynamic aggregation it can adjust the selected/unselected status of the port according to the information on the other side and the local side, which is more flexible to ensure proper use, the aggregation method chosen for both ends of the aggregation group needs to be the same the dynamic aggregation mode is implemented through the lacp (link aggregation control protocol) protocol the lacp protocol, based on the ieee 802 3ad standard, is a protocol that enables dynamic link aggregation, where devices running this protocol send lacpdu to each other to exchange information about link aggregation lacp working mode the lacp operating modes are active and passive (or inactive); active mode, i e actively sending out lacpdu probes; passive mode, i e not actively sending out lacpdus until they are received if the lacp mode of member ports in the dynamic aggregation group is passive and the lacp mode of the opposite end is also passive, both ends will not be able to send lacpdu; if the lacp mode of either end is active, both ends will be able to send lacpdu; to ensure normal use o, at least one of the lag at both ends must be active lacp priority depending on the role, lacp priority can be divided into two categories system priority and port priority system priority is used to distinguish between the higher and lower priority of the switches at both ends when one of the two ends has a higher priority, the other end will select the selected port of this end according to the end with the higher priority, thus making the selected ports of the two ends agree; the port priority is used to distinguish the priority of each member port to become the selected port the lower the priority value, the higher the priority lacp timeout this parameter defines the long and short timeout attribute of the aggregation group, which is the timeout of the member ports waiting to receive lacpdu if the lacp timeout is short, the peer will send lacpdu quickly (1 lacpdu every 1 second); if the lacp timeout is long, the peer will send lacpdu slowly (1 lacpdu every 30 seconds) it should be noted that the communication status changes rapidly in the actual network, in order to ensure the quality of communication, for dynamic aggregation groups, no matter the configuration of long timeout or short timeout, after the completion of link aggregation configuration, if the status of a member port on the local side is down, the other side will immediately sense it and set the corresponding port status to down for dynamic aggregation mode, the switches on both ends of the aggregated link will automatically negotiate the status of the ports within their respective aggregation groups, and the user only needs to ensure that when the local ports are aggregated together, the peers are also aggregated together accordingly static lag configuration static lag configuration in scenarios where the network structure is simple and changes infrequently, or when connected devices (such as older switches or servers) do not support the lacp protocol, static aggregation can be used to manually bind physical ports to achieve bandwidth aggregation and redundancy configure static aggregation group configure static aggregation group table 1 configuring static aggregation groups table 1 configuring static aggregation groups purpose commands description enter global configuration view configure terminal enter lag interface configuration view and create an aggregation group interface link aggregation lag id aggregate group id, range 1 9999 configure static aggregation mode mode static submit operation commit modify the configuration and submit it for effect configure aggregation group member ports configure aggregation group member ports when adding a physical interface to an aggregation group, the interface must be in a free state, meaning it has no ip configuration, is not assigned to a vlan, and is not part of another aggregation group table 2 configuring aggregation group member ports table 2 configuring aggregation group member ports purpose commands description enter global configuration view configure terminal enter ethernet interface view interface ethernet interface name add to the lag link aggregation group lag id dynamic lag configuration dynamic lag configuration table 3 overview of lag configuration tasks table 3 overview of lag configuration tasks configuration tasks description refer to configure aggregation group configure dynamic aggregation group required docid\ hf7r0pkjtjqc3 tcxm3lt configure the relevant parameters of the dynamic aggregation group configure aggregation group member ports required docid\ hf7r0pkjtjqc3 tcxm3lt configure lacp timeout mode optional docid\ hf7r0pkjtjqc3 tcxm3lt configure lacp fallback optional docid\ hf7r0pkjtjqc3 tcxm3lt configure lacp system priority optional docid\ hf7r0pkjtjqc3 tcxm3lt configure lacp port priority optional docid\ hf7r0pkjtjqc3 tcxm3lt configure the minimum number of active lacp links optional docid\ hf7r0pkjtjqc3 tcxm3lt configure lacp system id optional docid\ hf7r0pkjtjqc3 tcxm3lt configure lacp key optional docid\ hf7r0pkjtjqc3 tcxm3lt configure lacp graceful down optional docid\ hf7r0pkjtjqc3 tcxm3lt lag default setting lag default setting the lag default setting is shown in the table below table 4 lag default setting table 4 lag default setting parameters default value lacp timeout mode for interfaces long timeout system lacp priority 65535 lacp priority for interfaces 255 minimum number of active lacp links 1 lacp system id mac address of the interface interface lacp key value 0 interface lacp fallback shutdown port id default is to add one to the interface number configure dynamic aggregation group configure dynamic aggregation group table 5 configure dynamic aggregation group table 5 configure dynamic aggregation group purpose commands description enter global configuration view configure terminal enter lag interface configuration view and create aggregation group interface link aggregation lag id aggregate group id, range 1 9999 configure dynamic aggregation mode mode dynamic can be omitted, default is dynamic submit operation commit modify the configuration and submit it for effect configure aggregation group member ports configure aggregation group member ports when adding a physical interface to an aggregation group, the interface must be in a free state, meaning it has no ip configuration, is not assigned to a vlan, and is not part of another aggregation group table 6 configuring aggregation group member ports table 6 configuring aggregation group member ports purpose commands description enter global configuration view configure terminal enter ethernet interface view interface ethernet interface name add to the lag (port priority can be specified) link aggregation group lag id \[ port priority port priority ] port priority, range 0 to 65535, default 255 configure lacp timeout mode configure lacp timeout mode when an interface is added to a link aggregation, it periodically sends lacp protocol packets to dynamically maintain the status of the link aggregation group after configuring the fast rate option with a short timeout, it sends lacp packets every 1 second in the event of a link failure, the fast rate mode can detect the problem more quickly, making it suitable for scenarios where high network availability is required in scenarios where network stability is high and the recovery time for failures is not critical, a long timeout can be used to reduce unnecessary packet overhead table 7 configure lacp fast rate timeout table 7 configure lacp fast rate timeout purpose commands description enter global configuration view configure terminal enter lag interface configuration view and create aggregation group interface link aggregation lag id configure lacp fast rate timeout lacp fast rate submit operation commit modify the configuration and submit it for effect configure lacp fallback configure lacp fallback lacp dynamically negotiates link aggregation by exchanging lacp protocol data units (lacpdus) but in some cases (such as when the peer device does not support lacp, link failure, or configuration mismatch), lacp negotiation may fail in this case, configuring the skip fallback function can force the aggregation group state to up, thereby avoiding link failure and traffic interruption, and improving reliability in addition, in scenarios where the server needs to be installed through pxe, this feature also needs to be enabled table 8 configure lacp fallback table 8 configure lacp fallback purpose commands description enter global configuration view configure terminal enter lag interface configuration view and create aggregation group interface link aggregation lag id configure lacp fallback lacp fallback submit operation commit modify the configuration and submit it for effect configure lacp system priority configure lacp system priority table 9 configure lacp system priority table 9 configure lacp system priority purpose commands description enter global configuration view configure terminal enter lag interface configuration view and create aggregation group interface link aggregation lag id configure lacp system priority lacp system priority system priority submit operation commit modify the configuration and submit it for effect configure lacp port priority configure lacp port priority table 10 configure lacp port priority table 10 configure lacp port priority purpose commands description enter global configuration view configure terminal enter ethernet interface view interface ethernet interface name enter ethernet interface view add to the lag (port priority can be specified) link aggregation group lag id \[ port priority port priority ] port priority, range 0 to 65535, default 255 configure the minimum number of active lacp links configure the minimum number of active lacp links the minimum number of active links in lacp is an important configuration parameter in link aggregation control protocol (lacp), which ensures that the minimum number of active links in the link aggregation group meets the requirements during operation when the number of active links is lower than this value, the entire aggregation group status will become down, which can ensure that the minimum available bandwidth of the aggregation group meets business requirements and prevent partial link failures from causing overload of remaining link traffic table 11 minimum number of active lacp links table 11 minimum number of active lacp links purpose commands description enter global configuration view configure terminal enter lag interface configuration view and create aggregation group interface link aggregation lag id configure lacp minimum number of active lacp links lacp min links min links submit operation commit modify the configuration and submit it for effect configure lacp system id configure lacp system id system id defaults to the interface mac address, and when manually configured, the configured address takes effect table 12 configure lacp system id table 12 configure lacp system id purpose commands description enter global configuration view configure terminal enter lag interface configuration view and create aggregation group interface link aggregation lag id configure lacp system id lacp system id hh\ hh\ hh\ hh\ hh \ hh configure lacp key configure lacp key table 13 configure lacp system id table 13 configure lacp system id purpose commands description enter global configuration view configure terminal enter lag interface configuration view and create aggregation group interface link aggregation lag id configure lacp key lacp key value configure lacp graceful down configure lacp graceful down lacp graceful down is an elegant closure mechanism used to avoid traffic interruption when actively closing the lacp aggregation link it ensures that devices at both ends of the link synchronously perceive the port closure status through protocol level coordination, thereby achieving smooth traffic switching and avoiding packet loss during traffic switching table 14 configure lacp graceful down table 14 configure lacp graceful down purpose commands description enter global configuration view configure terminal enter lag interface configuration view and create aggregation group interface link aggregation lag id configure lacp graceful down lacp graceful down general configuration of lag general configuration of lag configure load balancing algorithm for aggregation group members configure load balancing algorithm for aggregation group members the default load balancing method for members of an aggregation group is based on a five tuple hash cx864p nt supports two packet based hash algorithms round robin and random table 15 configure load balancing algorithm for aggregation group members table 15 configure load balancing algorithm for aggregation group members purpose commands description enter global configuration view configure terminal enter lag interface configuration view interface link aggregation lag id aggregate group id, range 1 9999 configure load balancing algorithm hash algorithm { random | round robin } commit configuration commit note the aggregation group mode, system lacp priority, and load balancing algorithm must be configured when creating the lag if the lag has layer 2 or layer 3 configurations or contains member ports, these configurations should be removed before modifying the attributes set the ip address for lagif set the ip address for lagif table 16 set the ip address for lagif table 16 set the ip address for lagif purpose commands description enter global configuration view configure terminal enter lag interface configuration view interface link aggregation lag id aggregate group id, range 1 9999 set the ip address of the lag interface ip address { a b c d/m | a b/m } ipv4 address with subnet mask /32 is not allowed to be configured addresses with subnet mask /31 is allowed in other subnet masks, addresses with the host portion all zeros or all ones are not allowed ipv6 address with subnet mask /127 or /128 is not allowed to be configured in other subnet masks, addresses with the host portion all zeros are not allowed, but all ones are allowed configure mtu for lagif configure mtu for lagif table 17 configure the mtu for lagif table 17 configure the mtu for lagif purpose commands description enter global configuration view configure terminal enter lag interface configuration view interface link aggregation lag id aggregate group id, range 1 9999 configure the mtu of the lag interface mtu mtu mtu range 1312 to 9216 configure mac address for lagif configure mac address for lagif by default, the mac address of the interface is dynamically assigned by the system or is the same as the mac address of the switch this series supports users to reconfigure the mac of physical interfaces, vlan interfaces and link aggregated interfaces table 18 configure mac address for lagif table 18 configure mac address for lagif purpose commands description enter global configuration view configure terminal enter lag interface configuration view interface link aggregation lag id aggregate group id, range 1 9999 configure the mac address of lagif mac address hh\ hh\ hh\ hh\ hh \ hh mac addresses are not case sensitive restore the mac address of lagif to its default value no mac address shutdown the lagif shutdown the lagif shutting down the aggregation port will cause all selected ports in the group to become unselected ports and the state of all member ports to change to down table 19 shutdown the lagif table 19 shutdown the lagif purpose commands description enter global configuration view configure terminal enter lag interface configuration view interface link aggregation lag id aggregate group id, range 1 9999 close the aggregation interface shutdown opening the aggregation interface no shutdown display and maintenance display and maintenance check the current aggregation group configuration status, display the protocol of each aggregation group of the system and ports in it table 20 lag display and maintenance table 20 lag display and maintenance purpose commands description display aggregation group related information show link aggregation summary abbreviations in table description a active, i inactive, up up, dw down, n/a not available, s selected, d deselected example 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) n/a 0100 portchannel0100 loadbalance(up) ethernet28(up) 0101 portchannel0101 loadbalance(up) ethernet41(dw) ethernet40(up) in the example, we can see that the third column of protocol is identified as lacp or loadbalance, when it is "lacp", it means that member ports are added and removed dynamically via lacp, and the addition and deletion of member ports to the chip follows the 802 1ax protocol when it is "loadbalance", it means static lag configuration, and the addition and deletion of member ports to the chip is directly dependent on manual configuration when protocol is in lacp mode, two attributes will be available the lacp operating mode and the port status lacp working mode has two states, i and a a means active mode and i means inactive mode for normal use, the active mode is not provided for the configuration interface, and active mode is used by default the other attribute indicates the port status (up/dw), with up indicating that the lag is functional and dw indicating that the lag port is not forwarding traffic properly the member port under the lacp protocol has a status attribute (s/s /d) only when it is s does it mean that the interaction with the peer is successful and the member port is correctly sent down to the chip the rest of the states are not working properly when it is s , it is most likely that there is a mismatch between the local and the peer information; when it is d, it is likely that no lacpdu packet has been received, that is, the peer has not configured the lag in the dynamic lag only if the number of the member port in the s state is not less than min links, the lag will be in the up state and can participate in forwarding when protocol is loadbalance mode, there is only one port status attribute this attribute is actually the link state of the port when the port link status is up, it means the port is working normally, and it is added to the portchannel as a member port in the chip, and can participate in the forwarding of the portchannel when the port link status is down, it means that the port is working down and not added to the lag typical configuration example typical configuration example layer 2 static aggregation layer 2 static aggregation networking requirements device a and device b are connected to each other via their respective ethernet0, 1 configure a layer 2 static link aggregation group on device a and device b and implement separate interworking of vms in vlan 10 and vlan 20 topology procedure device a \#create vlan10 and add ethernet2 to this vlan sonic# configure terminal sonic(config)# vlan 10 sonic(config vlan 10)# ex sonic(config)# interface ethernet 0/2 sonic(config if 0/2)# switchport access vlan 10 sonic(config if 0/2)# ex \#create vlan 20 and add ethernet3 to this vlan sonic(config)# vlan 20 sonic(config vlan 20)# ex sonic(config)# interface ethernet 0/3 sonic(config if 0/3)# switchport access vlan 20 sonic(config if 0/3)# ex \#create static aggregation port lag1 and add ethernet0, 1 to this aggregation group sonic(config)# interface link aggregation 1 sonic(config lagif 1)# mode static sonic(config lagif 1)# commit sonic(config lagif 1)# ex sonic(config)# interface ethernet 0/0 sonic(config if 0/0)# link aggregation group 1 sonic(config if 0/0)# ex sonic(config)# interface ethernet 0/1 sonic(config if 0/1)# link aggregation group 1 sonic(config if 0/1)# ex \#add lag1 to vlan10, 20 sonic(config)# interface link aggregation 1 sonic(config lagif 1)# switchport trunk vlan 10 sonic(config lagif 1)# switchport trunk vlan 20 device b similar to device a, the configuration process is skipped verify the configuration show link aggregation summary the vms in vlan10 and vlan20 ping each other separately and can ping through layer 2 dynamic aggregation layer 2 dynamic aggregation networking requirements device a and device b are connected to each other via their respective ethernet0, 1 configure a layer 2 dynamic link aggregation group on device a and device b and implement separate interworking of vms in vlan 10 and vlan 20 topology procedure device a \#create vlan10 and add ethernet2 to this vlan sonic# configure terminal sonic(config)# vlan 10 sonic(config vlan 10)# ex sonic(config)# interface ethernet 0/2 sonic(config if 0/2)# switchport access vlan 10 sonic(config if 0/2)# ex \#create vlan 20 and add ethernet3 to this vlan sonic(config)# vlan 20 sonic(config vlan 20)# ex sonic(config)# interface ethernet 0/3 sonic(config if 0/3)# switchport access vlan 20 sonic(config if 0/3)# ex \#create dynamic aggregation port lag1 and add ethernet0, 1 to this aggregation group sonic(config)# interface link aggregation 1 sonic(config lagif 1)# mode dynamic sonic(config lagif 1)# commit sonic(config lagif 1)# ex sonic(config)# interface ethernet 0/0 sonic(config if 0/0)# link aggregation group 1 sonic(config if 0/0)# ex sonic(config)# interface ethernet 0/1 sonic(config if 0/1)# link aggregation group 1 sonic(config if 0/1)# ex \#add portchannel0001 to vlans 10 and 20 sonic(config)# interface link aggregation 1 sonic(config lagif 1)# switchport trunk vlan 10 sonic(config lagif 1)# switchport trunk vlan 20 device b similar to device a, the configuration process is skipped verify the configuration show link aggregation summary the vms in vlan10 and vlan20 ping each other separately and can ping through layer 3 static aggregation layer 3 static aggregation networking requirements device a and device b are connected to each other via their respective ethernet0, 1 configure a layer 3 static link aggregation group with ip on device a and device b respectively topology procedure device a \#create static aggregation port lag1 and add ethernet0, 1 to this aggregation group sonic(config)# interface link aggregation 1 sonic(config lagif 1)# mode static sonic(config lagif 1)# commit sonic(config lagif 1)# ex sonic(config)# interface ethernet 0/0 sonic(config if 0/0)# link aggregation group 1 sonic(config if 0/0)# ex sonic(config)# interface ethernet 0/1 sonic(config if 0/1)# link aggregation group 1 sonic(config if 0/1)# ex \#set the ip for lag1 sonic(config)# interface link aggregation 1 sonic(config lagif 1)# ip address 100 0 0 1/24 device b similar to device a, the configuration process is skipped 4\ verify the configuration show link aggregation summary device a pinging device b can ping through layer 3 dynamic aggregation layer 3 dynamic aggregation networking requirements device a and device b are connected to each other via their respective ethernet0, 1 configure a layer 3 dynamic link aggregation group with ips on device a and device b respectively, and require a short timeout for lacp topology procedure device a \#create dynamic aggregation port lag1 and add ethernet0, 1 to this aggregation group sonic(config)# interface link aggregation 1 sonic(config lagif 1)# mode dynamic sonic(config lagif 1)# commit sonic(config lagif 1)# lacp fast rate sonic(config lagif 1)# commit sonic(config lagif 1)# ex sonic(config)# interface ethernet 0/0 sonic(config if 0/0)# link aggregation group 1 sonic(config if 0/0)# ex sonic(config)# interface ethernet 0/1 sonic(config if 0/1)# link aggregation group 1 sonic(config if 0/1)# ex \#set the ip for lag1 sonic(config)# interface link aggregation 1 sonic(config lagif 1)# ip address 100 0 0 1/24 device b similar to device a, the configuration process is skipped 4\ verify the configuration show link aggregation summary device a pinging device b can ping through
