spanning-tree guard
To enable or disable root-guard mode or loop-guard mode on the VLANs associated with an interface, use
the spanning-tree guard command in interface configuration mode. To return to the default settings, use the
no form of this command.
spanning-tree guard {loop| root| none}
no spanning-tree guard
Syntax Description
Enables the loop-guard mode on the interface.loop
Enables root-guard mode on the interface.root
Sets the guard mode to none.none
Command Default
Root-guard mode is disabled.
Loop-guard mode is configured according to the spanning-tree loopguard default command in global
configuration mode.
Command Modes
Interface configuration
Command History
ModificationRelease
This command was introduced.Cisco IOS 15.0(2)EX
Usage Guidelines
You can enable root guard or loop guard when the switch is operating in the per-VLAN spanning-tree plus
(PVST+), rapid-PVST+, or the multiple spanning-tree (MST) mode.
You cannot enable both root guard and loop guard at the same time.
Use the spanning-tree guard loop command to override the setting of the spanning-tree loop guard default
setting.
When root guard is enabled, if spanning-tree calculations cause an interface to be selected as the root port,
the interface transitions to the root-inconsistent (blocked) state to prevent the switch from becoming the root
switch or from being in the path to the root. The root port provides the best path from the switch to the root
switch.
When the no spanning-tree guard or theno spanning-tree guard none command is entered, root guard is
disabled for all VLANs on the selected interface. If this interface is in the root-inconsistent (blocked) state,
it automatically transitions to the listening state.
Catalyst 2960-X Switch Layer 2 Command Reference, Cisco IOS Release 15.0(2)EX
86 OL-29043 -01
Layer 2 Commands
spanning-tree guard