Command
Spanning-Tree Guard Root
Use
This command will disable any port that a superior BPDU is received on. This is done to ensure a switch will remain root at all times.
Syntax
Switch(config-if)#spanning-tree guard root
Example
In the below example we will configure SW1’s trunk ports to use root guard. First, we will ensure SW1 is root for all possible VLANs
SW1(config)#spanning vlan 1-4094 root primary |
SW1(config-if)#do sh spanning vlan 10 VLAN0010 Bridge ID Priority 24586 (priority 24576 sys-id-ext 10) Interface Role Sts Cost Prio.Nbr Type |
Next we will configure root guard on the trunk ports.
SW1(config)#int ra fa0/19-24 |
Now we will configure SW2 to become root for all ports.
SW2(config)#spanning vlan 1-4094 root primary |
Notice that SW1 is now blocking the trunk ports.
10:08:26: %SPANTREE-2-ROOTGUARD_BLOCK: Root guard blocking port FastEthernet0/23 on VLAN0001. |
SW1(config)#do show spanning vlan 10 VLAN0010 Bridge ID Priority 24586 (priority 24576 sys-id-ext 10) Interface Role Sts Cost Prio.Nbr Type |