TechKnowSurge
Cisco CCNA 2.5 Cisco CCNA 5.7
VideoNetworkFree

DEMO: Loopguard

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.

Complete this video to capture a CTF flag worth 1 point.

About this video

Loop Guard is a Spanning Tree Protocol (STP) enhancement that addresses a specific and potentially damaging failure scenario in switched networks. Under normal STP operation, a non-designated port remains in a blocking state because it continuously receives BPDUs from an upstream switch. If BPDU transmission stops on a link that is still physically active — whether from a misconfiguration or a device malfunction — standard STP will interpret the silence as a topology change and transition the previously blocked port into a designated forwarding state. With two ports on the same segment now forwarding, a bridging loop forms, which can rapidly consume network bandwidth and degrade or completely disrupt traffic across the entire network. Loop Guard prevents this scenario by holding any non-designated port in a loop-inconsistent blocking state whenever BPDUs are no longer received on an active link. Because the port is already in a non-forwarding state, there is no disruption to normal traffic; the feature simply ensures the port cannot make an unauthorized transition to forwarding. This protection is most relevant on trunk ports connecting switches together, where unidirectional link failures or software faults could otherwise trigger the problematic state transition that Loop Guard is designed to block. Configuring Loop Guard is straightforward. From global configuration mode, navigating to the target interface and issuing the spanning-tree guard loop command enables the feature on that port. Removing it is equally simple by prepending no to the same command. Because it operates quietly in the background and requires minimal configuration, Loop Guard is a practical addition to any environment where STP stability and loop prevention are operational priorities.

What you'll learn

What's covered

STP Loop Guard

Aligned to

Cisco CCNA
2.5 Interpret basic operations of Rapid PVST+ Spanning Tree Protocol
5.7 Configure and verify Layer 2 security features

Key terms

Spanning Tree Protocol
STP
A network protocol that prevents loops in Ethernet networks by creating a loop-free logical topology.
Bridge Protocol Data Unit
BPDU
A data message exchanged between switches running Spanning Tree Protocol to detect network loops and elect a root bridge. BPDUs contain the sending switch's BID and path cost information used to build the loop-free spanning tree.
Loop Guard
An STP feature applied to switch interfaces that prevents a non-designated port from transitioning to a designated port when BPDUs are no longer received, protecting against bridging loops.
Non-Designated Port
An STP port role that is blocked to prevent loops, maintained in a non-forwarding state based on STP information received from neighboring switches.
Switch
A network device that connects devices within a LAN and forwards traffic based on MAC addresses.

Topics

Spanning Tree Protocol Loop Guard Network Switching Bpdu Cisco Ios Networking

Transcript

Another feature that we may want to turn on on our devices is loop guard.

The scenario loop guard protects against

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

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

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.

About TechKnowSurge

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 →