STP and HSRP Incongruence

Can someone please elaborate (with diagrams or drawings please) why it’s important that the STP root and HSRP Active router be aligned when using multilayer switches? Thank you.

Hello Mike

It’s a good idea to set up your HSRP devices such that the STP root of a particular VLAN is also the active HSRP gateway device for that same VLAN. Although it is a good idea, it is by no means obligatory. A network will function just fine even if this is not the case.

Now remember that STP is a L2 feature and will only affect an HSRP setup if the HSRP devices themselves are part of a L2 loop. This will only happen if the connection between the two HSRP devices is indeed an L2 connection. So for HSRP scenarios where there is an L3 connection between the HSRP devices, or no connection at all, where the STP root is will have no affect on the functionality of the topology.

In the case where the HSRP devices are indeed connected via an L2 connection, it makes sense to have the active HSRP device for a particular VLAN also be the STP root bridge for that same VLAN. This will ensure that all traffic to that primary default gateway will reach it directly and not via the other HSRP device over the L2 connection. This is because a root bridge will never have blocked ports and neither will the root ports of all other switches have blocked ports.

Essentially, this will result in an optimized network. Keep in mind however, that only under circumstances of network congestion will there be any perceivable difference in the network performance.

I hope this has been helpful!


PS I didn’t include diagrams as I believe the explanation to be quite clear. However, if you require a more detailed explanation that includes diagrams, let me know and I can comply.

Thank you for the response! if you don’t mind, would you please include a diagram showing how this works and how problems could occur? I just learn better when I have a visual. Thanks.

Hello Mike.

First of all, STP will never be involved in the configuration of HSRP if the two devices being configured with HSRP are routers. Routers cannot create L2 loops. If the two devices are layer 3 switches, then STP is still not involved unless certain circumstances are met.

The following two HSRP topologies do not require any special STP configuration since no layer 2 loops can occur.
The first has no physical path for a loop to occur, the second has a physical path but is interrupted by a layer 3 link, so no L2 loops can be created.

The only situation in which STP is involved in an HSRP configuration is the following topology:
Here, a layer 2 loop can occur between the three switches.

Now this setup can POTENTIALLY result in a path taken by frames similar to this:

IF the root bridge is the non-active router and IF the port of the active router is chosen as a blocked port, then traffic from users can potentially go to the root bridge, be transferred over the L2 link and reach the active router as the default gateway to be sent to the Internet. You will notice that there are a lot of ifs involved and it also depends on the actual topology of the whole L2 network.

By making the active router the STP root bridge, this will never occur because the STP root bridge will never have any blocked ports.

If this is your setup, its always good practice to force the STP root bridge to be the active router for the VLAN in question so that the L2 link will not be a potential bottleneck in your topology. If this does occur, it’s quite hard to troubleshoot and to determine this as the problem, so setting it up as best practice from the beginning is always better and gives you peace of mind.

I hope this has been helpful!


Very helpful. Thank you sir!

1 Like