This guide covers what port aggregation / link aggregation (LAG) is and how to enable and use it within UniFi. We'll also explore what benefits it provides and whether you should be looking at enabling it in your network.
What Is Link Aggregation (LAG)?
Simply put, link aggregation is the the aggregation or combination of two or more ports. Once this is enabled, the devices or switch connected to each end of the cables have multiple physical connections between each other. This can be between many network devices, such as a PC with multiple NICs installed, NAS servers, or network switches.
With UniFi switches, there is a requirement to use sequential ports. Below is an example of a LAG setup that would not work, due to the port numbers not being in sequential order. I have ports 2 and 4 on Switch 1 connecting to 1 and 3 on Switch 2.
Next, there is an example of a correct set up, with ports 2 and 3 linked together on both Switch 1 and Switch 2.
What Benefit Does LAG Provide?
Once you have two or more network cables between switches or devices, this can allow for greater network redundancy and increased maximum throughput. To fully utilize all available bandwidth, it usually requires traffic from multiple devices to be passing through the LAG connection. This is due to how UniFi implements LAG and balances traffic across the multiple physical ports.
For example, with a standard gigabit Ethernet switch, a single port can handle 1 Gbps of traffic in either direction. Theoretically, you can have 1 Gbps of traffic flowing from the device, and 1 Gbps of traffic flowing to the device at the same time. That results in a total of 2 Gbps of throughput.
By combining two gigabit Ethernet ports in a LAG, you can have a maximum of 2 Gbps in one direction, or 4 Gbps in total. To break beyond the gigabit barrier and make use of the doubled capacity, usually multiple devices will need to be sending and receiving traffic. A single device may still see a maximum of 1 Gbps in a single direction, as UniFi doesn't load balance or split TCP connections over both links.
So LAG provides benefits for improved network capacity and greater network redundancy, but the effectiveness depends on your network setup and use case.
What Doesn't Work?
There are a number of things that is required for LAG to work and some things that UniFi doesn't support.
Ports must be sequential in number, and the same link speed.
For starters, the ports used must be sequential in number. For example, if you want four ports to be aggregated together, then on one switch you would have to use ports 5,6, 7 and 8. You can't use 1, 2, 7, and 8. On the other side of the LAG, it doesn't need to be the same ports - just any four in sequential order.
Another complication is that you can't mix link speeds. Even if the ports are in sequential order, you can't make a LAG with gigabit Ethernet ports and 10 Gbps SFP+ slots. You can combine 10 Gbps interfaces or 1 Gbps interfaces, but you can't mix them.
Ubiquiti also mentions a few other limitations of LAG in UniFI:
Static LAG configurations are not supported, only LACP (802.3ad).
Multi-chassis Link Aggregation Group (MLAG) is not supported.
What UniFi Devices Can Use LAG?
Ubiquiti has said any 1st generation UniFi Switch (models beginning with US-) or 2nd generation (models beginning with USW-) can use LAG. There are two exceptions, though, the USW-Flex and USW-Flex-Mini do not support LAG and some other advanced features.
Additionally, any UniFi access point with multiple Ethernet ports can use LAG. These are the models with multiple Ethernet ports:
UAP-AC-Pro
UAP-AC-Mesh-Pro
UAP-AC-HD
UAP-AC-SHD
Unfortunately, all UniFi gateways including the USG, USG-Pro, UDM-Pro, UDM-SE, and UXG-Pro do not support LAG operation.
UniFi devices that support LAG:
All 1st generation UniFi switches (US-)
All 2nd generation UniFi switches (USW-) besides the USW-Flex and USW-Flex-Mini
UniFi APs with two gigabit Ethernet ports
UAP-AC-Pro
UAP-AC-Mesh-Pro
UAP-AC-HD
UAP-AC-SHD
UniFi devices that do not support LAG:
USW-Flex
USW-Flex-Mini
All other UniFi APs
All UniFi gateways
USG
USG-Pro
UDR
UDM
UDM-Pro
UDM-SE
UXG-Pro
How To Enable Link Aggregation (LAG) in UniFi
Before you get started, you will need two compatible UniFi devices, connected with a single cable and adopted into your UniFi controller. In this example, we have two US-8-150W switches. For now, they are connected with a single gigabit Ethernet connection.
We also have both devices adopted to our HostiFi controller and on the latest firmware version available for these switches. For reliable LAG operation, it's important to have the latest firmware installed.
As a general rule, it's best to work on the furthest device away from the gateway before anything else. In our simple example, we don't have to worry about that. For larger networks with multiple switches, this can cause issues.
To configure the LAG, click on the furthest away switch in the list of devices, then click on 'Ports'
Next, click on 'Port Management', which is the new way to manage switch port configurations in UniFi version 7.2 and newer.
In the list of ports, decide which two (or more) ports you are going to be using for the link aggregation. In this example, we are going to be combining ports 3 and 4 on our furthest away switch.
Click on the first port you wish to use.
Next, click on the drop down box labelled 'Operation'
In this dropdown, select 'Aggregate'
Once aggregate is selected a new drop down will appear asking you to select which other port you wish to combine with the first port.
In this example, we are using ports 3 and 4 on both switches to link them together. So in this drop down, select which ever port you need.
The next step will look like this. Once everything is as it should be, click 'Apply Changes'
Once this is completed on the furthest away switch, the exact same process will need to be completed on the switch it's forming the LAG with. Once both switches have the same configuration, the next thing to do add the additional Ethernet or fiber connections for the other interfaces.
Once this is done, visit the port management section on one of the switches and you'll be able to see what is going on. In the below screenshot, it is showing ports 3-4 are aggregated, with port 3 being the parent port and port 4 slightly greyed out to show it is the child port.
This means that both switches are now linked together and we have improved network resiliency and capacity.
HostiFi
HostiFi provides hosting for both Ubiquiti and TP-Link software-defined-networking (SDN) applications, with servers for UniFi, UISP and Omada. We also offer professional networking consulting, with HostiFi Pro.
If you run into any issues, contact us via live chat or submit a ticket.