Guide - Create a fully Loop-Resistant network [Switches]
This guide will show you how to properly set up rSTP on Omada L2+ / L3 switches to prevent a network loop causing a cascading total network failure
Prerequisits - At least one Full Omada L2+ / L3 Switch (not applicable to ES switches)
All screenshots taken from Controller v6, the same basics apply to Controller 5.15 and earlier
If you have, by necessity, a network switch exposed to users for them to freely use, or you have a complex network, or simply want to learn how to properly use rSTP this guide is for you.
The Problem
A network loop - a link between two switch ports or between switches when not intended, can cause a broadcast storm which will quickly crash the entire network until it is corrected.
What is rSTP?
rSTP is "Rapid Spanning Tree" and is used by switches to build a map of inter-switch links defined by priority. If a loop occurs, rSTP will intervene and block one of the ports involved in the loop. This can also help you identify which port at least one end of the loop is on.
How to Configure
The first thing to do is identify which switch is your "Root" - if you only have one switch this is easy. If you have multiple switches, choose the one closest to the gateway and carries the main Uplink to the gateway. If you have multiple switches cascading from the gateway directly, all of these can be set as the "Root"
Go into the switch settings, and enable the following features. For the "Root" switch or switches, choose 4096 as the CIST priority value

Now, configure the remaining switches in the same way, setting the CIST value to 32768

Now, we need to set up the port profiles. I recommend you set these as a profile rather than "profile override per-port"
Configure a profile for switch<>switch and switch<>gateway links. These need to have the lowest priority value - i recommend 64. Leave the rest of the spanning tree options at their default. You should also apply the same settings to the "All" profile if you use that.

Now, you also need to set up the remaining profiles you are using for your access ports - ports for end-devices, EAPs, servers, PCs etc...
Choose the Priority value of 128 and tick EDGE port

Recommended for all profiles - Enable Storm Control with the following values

Now, Make sure the port profiles with the Spanning Tree settings are applied to ALL switch ports. Uplinks, Downlinks, LAGs, Access ports....

Testing
Create a network loop, and you will see that rSTP will block one of the ports. The network will be completely unaffected

