Loop Guard is a Spanning Tree Protocol feature that prevents network loops by keeping non-designated ports in a blocking state when BPDU transmissions stop while the link remains active. It is configured at the interface level using the spanning-tree guard loop command.
STP Loop Guard
Another feature that we may want to turn on on our devices is loop guard.
Here's our network diagram. We have root ports that are pointing towards the root bridge, and we see a couple of those on here. We also have designated ports, which are open and operating, and then we also have non-designated ports, which are turned off.
Let's take a look at this port specifically right here. It's a non-designated port. One of the things that's keeping it as a non-designated state is that the link is up, but it continues to receive spanning tree protocol, and based off of the information it receives in the spanning tree protocol it remains a non-designated port.
But let's say it stops receiving STP updates. In that example right there, this non-designated port would become a designated port. Now we have a designated live port and a designated live port, and now we have a loop on our network, and this can be devastating to our network.
This scenario isn't necessarily common. This link would have to stop sending out spanning tree protocol, or BPDUs, but at the same time that link is still up. So maybe it's a configuration error that has happened on this port, or perhaps it's malfunctioning in some sort of way. But it is something that can occur, and so we need to possibly guard against it.
What loop guard does is, we apply it to an interface - so we could apply it to these interfaces - and it keeps it in this non-designated state as long as it's not receiving any STP, any more BPDUs. So in the case where the link is still up but it hasn't received any new BPDUs, it's going to keep it in this non-designated state.
As you can see, there's really not any kind of violation that happens with this, or shutdown. It's already in a shutdown state because it's a non-designated port, so it's not communicating across there. This is really designed more for those trunk ports, or those that are connected to other switches, where yes, this port is participating in spanning tree protocol, and it's just to protect against certain failures that can happen.
The commands for this are really simple. All I have to do is get into the global configuration mode, and then into one of my interfaces - on this one I'm going to do 1043 - and while I'm in here I'll do a spanning-tree guard loop and hit enter. If I want to take that off, all I have to do is put a no in front of that.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →