spanning-tree loop-guard


spanning-tree loop-guard

no spanning-tree loop-guard


Enables the loop guard on the interface. STP loop guard is best applied on blocking or forwarding ports.

The no form of the command sets the loop guard status to the default of disabled on the interface.

Command context



Administrators or local user group members with execution rights for this command.


Occasionally a hardware or software failure can cause MSTP to fail, creating forwarding loops that can cause network failures where unidirectional links are used. The non-designated port transitions in a faulty manner because the port is no longer receiving MSTP BPDUs.

Loop guard causes the non-designated port to go into the MSTP loop inconsistent state instead of the forwarding state. In the loop inconsistent state the port prevents data traffic and BPDU transmission through the link, therefore avoiding the loop creation. When BPDUs again are received on the inconsistent port, it resumes normal MSTP operation automatically.

In this example, the transmission from switch 1 port 10 to switch 2 prt 20 is blocked due to a hardware failure. Switch 2 port 2 does not recieve BPDUs and goes into a forwarding state, creating a loop.

When loop guard is configured for switch 2 port 20, this port goes from a forwarding state to an inconsistent state, and does not forward the traffic through the link, thus avoiding loop creation.


Enabling the loop guard on interface 1/1/1:

switch(config)# interface 1/1/1
switch(config-if)# spanning-tree loop-guard

Disabling loop guard on interface 1/1/1:

switch(config)# interface 1/1/1
switch(config-if)# no spanning-tree loop-guard