Skip to content

Instantly share code, notes, and snippets.

@sems
Last active September 27, 2024 01:16
Show Gist options
  • Save sems/f3b2f10ea0fb30d6f6fade841a12dfae to your computer and use it in GitHub Desktop.
Save sems/f3b2f10ea0fb30d6f6fade841a12dfae to your computer and use it in GitHub Desktop.
Setup guide link aggregation(802.3ad) Unraid with Ubiquiti

Setup guide link aggregation Unraid with Ubiquiti

Introduction

I am writing this guide becuase I coudn't find a proper one online which contained all the information I was searching for. I will try to guide you through the process of enabling link aggregation (802.3ad) with your Ubiquiti hardware and your Unraid server. Note: not all of Ubiquiti's hardware supports link aggregation (LAG). As of the time of writing Ubiquiti states the following.

Applicable to all UniFi Switch models excluding the USW-Flex and USW-Flex-Mini.

Source: Ubiquiti

What is link aggregation

Of course, I can try to explain it in my own words, but Wikipedia is much better with such things.

In computer networking, link aggregation is the combining (aggregating) of multiple network connections in parallel by any of several methods, in order to increase throughput beyond what a single connection could sustain, to provide redundancy in case one of the links should fail, or both. A link aggregation group (LAG) is the combined collection of physical ports.

Source: Wikipedia

Personal situation

My situation was a little bit odd in my opinion. I wanted to enable link aggregation within my new Switch Lite 8 PoE (SKU: USW-Lite-8-PoE-EU), but had some problems. I followed the official guide from Ubiquiti itself listed here. But experienced some strange things after I did the proces on my switch through the Ubiquiti controller (also know as site). One of the problems was that my Unraid server couldn't get an IP from the DHCP server, so connecting through the web wasn't an option.

Hardware used

  • Ubiquiti Dream Machine (UDM)(non pro)
  • Ubiquiti Switch Lite 8 PoE (USW-Lite-8-PoE-EU)
  • Dell Poweredge R320 (Double Gigabit Ethernet)
  • Some standard CAT 5e ethernet cables

Setup

The first 11 steps go over Ubiquiti's own guide for enabling link aggregation (LAG). I will still writes the appropriate steps down, since at the time of writing the official guide only lists the old/traditional controller interface/UI. Note: make sure two ethernet cables run between your Unraid server and your ubiquiti switch.

  1. Make sure your Ubiquiti switch has been fully adopted and updated before you start. This includes a working controller.
  2. Open up your Ubiquiti controller in a browser of your choice.
  3. Navigate to UniFi Devices in the main navigation on the left side of the screen.
  4. Select the switch on which you would like to enable LAG.
  5. Go the Ports tab on the far right.
  6. Select the one of the ports which is connected to your Unraid server. It doesn't matter which one.
  7. Click on Port Profile Override, and a new dropdown opens.
  8. Change to Operations(mode) from Switching (default) to Aggregate.
  9. Now select the other port(s) which you would like to aggregate with (kind of bonding).
  10. Change the Link speed to Autonegotiation if it hasn't already.
  11. Apply the changes.
  12. Now LAG has been enabled on the switch, in the following steps we will activate it on the Unraid server.
  13. Optional: a. At the time a static IP was set for the Unraid server through the Ubiquiti controller, NOT Unraid itself. Please disable this static IP if you also set on in the past. b. To disable this, go to Clients in the Ubiquiti Controller. c. Navigate to the specific client (Unraid server). d. Go to configuration > Network and deselect Use Fixed IP Address
  14. Optional: If you have set a static IP from the Unraid itself, please disable this and use the DHCP server, before proceeding. We will turn this back on later.
  15. Connect to the WebUI of Unraid and login as root.
  16. First we need to disable Unraids Docker service and VM manager, this is needed to change Network Settings.
  17. Go to Settings > Docker > Enable Docker, and set to No.
  18. Go to Settings > VM Manager > Enable VM's, and set to No. Now we can enable link aggregation.
  19. Go to Settings > Network Settings and there shouldn't be any grayed out options. If there are, please reasure that both the Docker service and VM manager are turned off.
  20. Enable bonding if not already.
  21. Make sure all of your ethernet interfaces are Bonding members of bond0: whom you want to enable Link Aggregation on. In my case eth0 and eth1.
  22. Change the bonding mode to 802.3ad (4).
  23. Apply the changes and have a moment for the server to apply the changes correctly.
  24. After a minute or two you can try to access the server again through the web interface. This can be done by going to your given domain (default //tower or tower.local) or try looking up the new IP (given by DHCP server) by going back to the Ubiquiti controllers Clients.
  25. If you can connect great! Try to login and back to Network Settings and see if the Bonding Mode is still set to 802.3ad (4). If so, Link aggregation has been succesfully enabled. If not, proceed to the next step.
  26. If you are reading the step you probably have the same problem I had. The Unraid server doesn't have a valid IP because something went wrong with applying the changing to the network settings and driver.
  27. We need to get access to our Unraid server's UI to get it to boot into an other mode then the default. This can be done by simply connected a monitor, keyboard and mouse to the server, or in my case IDRAC which has a Virtual Console Preview build in.
  28. Now we are connected to the server physically or through a Virtual Console, we can reboot the server. Once the server is booting up the USB (with Unraid) a screen comes up for approx. 3/5 sec, where you can select boot-modes. In our case we need to select the second one, boot Unraid with GUI. This will gives use access to the Unraid, but now locally.
  29. You should see a login screen, login with your root Unraid account.
  30. Automatically a browser will open with the Unraid GUI with root logged in.
  31. Navigate to Settings > Network Settings, and you will see that the Bonding mode has been changed back to Mode 1 (active-backup) - default, which is not right. To be on the safe side, make sure IPv4 address assignment: is still on Automatic, not static! If it is still static, change it and apply!
  32. Change the bonding mode to 802.3ad (4), and apply changes.
  33. You can refresh the page or it will be. You will see that the Unraid server now got a valid IP from the DHCP server (see IPv4 address).
  34. Check if you can connect to the Unraid server by going to the IP-address in a browser. The local-domain may not work yet, or may be slow (not sure).
  35. When you are connected login as root and go to Settings > Network Settings. You will see that 802.3ad (4) is still enabled.
  36. You are doing and you have succesfully enabled Link Aggregation (802.3ad) between your Unraid Server and Ubiquiti hardware.

Last updated: 05/07/2021

@jwhitcraft
Copy link

Thanks for posting this, it helped me get mine running!

@poorbullfrog
Copy link

Thank you for this! I have been beating my head against the wall for days trying to figure this out.

@Daniel-PT
Copy link

Hi. Thanks for the nice guide! Just 2 questions:
1: Why do i need to disable static ip?
2: When i enable LAG on my Unify switch i loose connectivity with my Unraid server. Do i need to disable static ip first in Unraid? :)
Thanks!

@sems
Copy link
Author

sems commented Nov 3, 2022

@Daniel-PT

Why do i need to disable static IP?

Yes, because otherwise Unraid and the Unifi controller can not negotiate the new IP - based on LAG.

Do i need to disable static ip first in Unraid?

As steps 13, and in this case 14 implies -- Yes.

@SpaceFahad
Copy link

SpaceFahad commented Dec 13, 2022

I can confirm this guide has worked flawlessly but I did some stuff in the following order

1- setup unraid for aggregation first (static IP was set through unraid previously and was NOT disabled)
2- setup LAG in UniFi
3- rebooted unraid to make sure everything is working fine

I did it this way because when I enable LAG first, the connection to my unraid is dropped..

my only advice to anyone attempting to do changes such as this is to backup your flash externally before attempting to do so.

thank you for the instructions @sems !

my only question is how does one test the speed and confirm aggregation works as intended (other than checking the bonding mode)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment