Loop guard, root guard
You cannot enable root guard and loop guard on the same port, because they protect opposite promises. Root guard is for a port the root must never be behind: a superior BPDU there puts the port in the root-inconsistent state. Loop guard is for a port held back by BPDUs it keeps receiving: if they stop, the port goes loop-inconsistent rather than forwarding.
By Arif, founder of Daveth · Updated
The full 6 min walkthrough is in Daveth Pro (Network). See what the plan opens
What this page answers
What is the difference between root guard and loop guard?
Root guard blocks a port as root-inconsistent if it would become the root port, protecting a designated port from a superior BPDU. Loop guard holds a non-designated port loop-inconsistent if its BPDUs stop, so silence does not let it forward. Read it in “Root guard: the root must never be this way”
Can root guard and loop guard be enabled together?
No. You cannot enable both on the same interface at the same time: each is chosen by the role the port is meant to hold. Read it in “One port cannot hold two opposite promises”
One port cannot hold two opposite promises
On an interface you can type either of these.
DIST-1(config)# interface GigabitEthernet1/0/24 DIST-1(config-if)# spanning-tree guard root
DIST-1(config)# interface GigabitEthernet1/0/24 DIST-1(config-if)# spanning-tree guard loop
You cannot enable both root guard and loop guard at the same time.
At first that is strange. Both features protect spanning tree. Both can stop user traffic on a port. Both put that port into a state called inconsistent. The sensible-sounding instinct is belt and braces: two protections, so enable both. The platform refuses. So why make you choose?
Because the two commands describe opposite expectations for the port. Root guard says: this port must stay Designated: the root is never reached this way. Loop guard says: this port may legitimately be Root or Alternate, and if the BPDUs that justify that role disappear, silence must not promote it to Designated.
The root guard is used on designated ports, and it does not allow the port to become non-designated. The loop guard works on non-designated ports and does not allow the port to become designated through the expiration of max_age.
Read those two sentences again. One forbids a Designated port from becoming anything else. The other forbids a non-designated port from becoming Designated. Same role, opposite directions, and the rule stops looking arbitrary.
Three ports, three expectations
ROOT-1 is the root at priority 4096. DIST-1 and DIST-2 are each one gigabit link from it, so on the link between them the tie goes to the better bridge, DIST-2 at 8192. That leaves DIST-1 holding all three roles at once.

DIST-1# show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol rstp Root ID Priority 4106 Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi1/0/1 Root FWD 20000 128.1 P2p Gi1/0/2 Altn BLK 20000 128.2 P2p ! Alternate and discarding: DIST-2 is designated on this link. Gi1/0/24 Desg FWD 20000 128.24 P2p
The guard follows the role the port is meant to hold, not a ranking of which guard is stronger. Gi1/0/24 faces CUST-1, and the campus root must never appear through it. Gi1/0/2 may become the path to the root one day, and must not decide that just because it stopped hearing anything. Rapid PVST+, VLAN 10, for the whole page.
Root guard: the root must never be this way
CUST-1 is a customer switch, and the design says it is downstream. Then somebody on the customer side does this:
CUST-1(config)# spanning-tree vlan 10 priority 0
ROOT-1 is at 4096, so CUST-1 now advertises the better root. Spanning tree has no concept of but that switch belongs to a customer. It compares BPDUs, and a superior BPDU is superior information.
DIST-1# show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol rstp Root ID Priority 10 ! 10 is priority 0 plus the VLAN number. The root is now CUST-1. Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi1/0/1 Desg FWD 20000 128.1 P2p Gi1/0/2 Desg FWD 20000 128.2 P2p Gi1/0/24 Root FWD 20000 128.24 P2p ! The customer port is now DIST-1's root port.
Nothing malfunctioned. Every switch did what the protocol says with what it was told. So CUST-1 is set back, and the design becomes configuration:
DIST-1(config)# interface GigabitEthernet1/0/24 DIST-1(config-if)# spanning-tree guard root
Enables root-guard mode on the interface. If spanning-tree calculations cause an interface in the customer network to be selected as the root port, root guard then places the interface in the root-inconsistent (blocked) state to prevent the customer's switch from becoming the root switch or being in the path to the root.
Notice the last clause of that second quotation: not only becoming the root switch, but being in the path to the root. The port stays in spanning tree. What changes is what it may become.
DIST-1# show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol rstp Root ID Priority 4106 ! Still ROOT-1's 4096 plus the VLAN. Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi1/0/1 Root FWD 20000 128.1 P2p Gi1/0/2 Altn BLK 20000 128.2 P2p Gi1/0/24 Desg BKN*20000 128.24 P2p *ROOT_Inc ! Blocked, and marked as root-inconsistent.
Root guard is not BPDU guard, and the difference fits in two lines. BPDU guard, from 1.1.e.iii: a BPDU arrives at all, and the port is err-disabled. Root guard: a BPDU arrives that would make this port non-designated, and the port is blocked while that lasts.
BPDU guard disables the port upon BPDU reception
Ordinary BPDUs do not trip root guard. That is what makes it right for a link to a real switch that is allowed to take part in spanning tree and is not allowed to win. It is also the risk:
Misuse of the root guard feature can cause a loss of connectivity.
Root guard has no idea which superior BPDU is legitimate. It knows only the direction you said the root must never be. Put it on Gi1/0/1, facing ROOT-1, and that port blocks the moment ROOT-1's BPDUs arrive: DIST-1 falls back to the longer path through DIST-2, and a switch with only that one uplink would be cut off from its own root.
Loop guard: silence is not permission
Go back to Gi1/0/2. Why is it not forwarding? Because DIST-2 is the better bridge on that link and keeps saying so.
The designated port transmits BPDUs, and the non-designated port receives BPDUs.
So the port's role rests on one assumption: those BPDUs keep arriving. Break only that.
Scene 1: BPDUs arriving; Gi1/0/2 is alternate.

Scene 2: one direction of the fibre fails; carrier stays up.

The link is not down. DIST-1's transmissions still reach DIST-2; only the strand the other way has failed. And nothing changes yet: the port keeps acting on the last information it received until that information ages out.
Scene 3: the information ages out.

DIST-1# show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol rstp Root ID Priority 4106 Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi1/0/1 Root FWD 20000 128.1 P2p Gi1/0/2 Desg FWD 20000 128.2 P2p ! Designated and forwarding, and DIST-2's end is forwarding too. Gi1/0/24 Desg FWD 20000 128.24 P2p
With nothing better heard on that link, DIST-1 concludes it is the best bridge there. Alternate becomes Designated becomes forwarding, and because the other direction still works, frames go DIST-1 → DIST-2 → ROOT-1 → DIST-1 and round again. Cisco's note describes the expiry with the max_age timer; this page does not put a number on it.
Now the same failure, with one command added. The strand is repaired, Gi1/0/2 is alternate again, and:
DIST-1(config)# interface GigabitEthernet1/0/2 DIST-1(config-if)# spanning-tree guard loop
Enables the loop-guard mode on the interface.
Scene 4: the same failure, the same expiry, with loop guard.

DIST-1# show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol rstp Root ID Priority 4106 Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi1/0/1 Root FWD 20000 128.1 P2p Gi1/0/2 Altn BKN*20000 128.2 P2p *LOOP_Inc ! The reference defines BKN* and *LOOP_Inc but does not show which role IOS prints beside them. The role here is the one the port was protecting. Gi1/0/24 Desg FWD 20000 128.24 P2p
The transition is intercepted. The port would have become Designated for exactly the same reason, and loop guard holds it loop-inconsistent instead. No forwarding on that port, no loop.
Loop guard is not protecting a port because it is blocked. It is protecting the network from the reason that blocked port might stop being blocked.
There is also a global form, which enables loop guard as the default on the switch:
DIST-1(config)# spanning-tree loopguard default
The individual loop-guard port configuration overrides this command. Loop guard operates only on interfaces that are considered point-to-point by the spanning tree.
So the default reaches every point-to-point port, and an interface's own spanning-tree guard setting wins over it. Before switching it on, know which of your ports are Root and Alternate: those are the ones it is for.
Continue the lesson
The whole lesson, with its drawings and its questions. 5 more sections after the ones above.






