spanning-tree vlan [id] priority [value]
Sets the bridge priority for a specific VLAN to influence the root bridge election in Spanning Tree Protocol (STP).
spanning-tree vlan [id] priority [value]When to Use This Command
- Ensuring a specific switch becomes the root bridge for a VLAN to optimize traffic flow.
- Configuring a backup root bridge with a higher priority value for redundancy.
- Adjusting priority to force a different switch to become root after a failure.
- Troubleshooting STP convergence issues by manually controlling root bridge selection.
Command Examples
Set priority to 4096 for VLAN 10 to make switch root bridge
spanning-tree vlan 10 priority 4096No output is displayed upon successful configuration. Use 'show spanning-tree vlan 10' to verify the new priority.
Verify priority change with show spanning-tree
show spanning-tree vlan 10VLAN0010
Spanning tree enabled protocol ieee
Root ID Priority 4096
Address 0011.2233.4455
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 4096 (priority 4096 sys-id-ext 10)
Address 0011.2233.4455
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi0/0 Desg FWD 4 128.1 P2p
Gi0/1 Desg FWD 4 128.2 P2pThe 'Root ID' shows priority 4096 and the MAC address of this switch, confirming it is the root. 'This bridge is the root' indicates root status. 'Bridge ID' shows the configured priority (4096) plus the VLAN ID (10) as sys-id-ext. Interface roles: Desg (designated) and FWD (forwarding) are normal for root ports.
Understanding the Output
The 'show spanning-tree vlan [id]' command displays STP information for a specific VLAN. The 'Root ID' section shows the current root bridge's priority and MAC address. If 'This bridge is the root' appears, the local switch is the root. The 'Bridge ID' section shows the local switch's priority (including the VLAN ID as sys-id-ext). Lower priority values (multiples of 4096) are better for becoming root. Interface roles: Root (R) for best path to root, Designated (Desg) for forwarding on segment, Alternate (Altn) or Backup (Back) for blocked ports. State: FWD (forwarding), BLK (blocking), LRN (learning), LIS (listening). Cost is the path cost to root. Watch for unexpected root changes or blocked ports indicating loops.
CCNA Exam Tips
Priority values must be in increments of 4096 (0, 4096, 8192, etc.) on Cisco switches; other values are rejected.
The root bridge is the switch with the lowest bridge ID (priority + MAC address). Changing priority can force a new root election.
In CCNA, know that the default priority is 32768, and setting it to 0 makes the switch likely root.
The 'sys-id-ext' automatically adds the VLAN ID to the priority, so effective priority = configured priority + VLAN ID.
Common Mistakes
Using a priority value not a multiple of 4096 (e.g., 100), which is rejected by IOS.
Forgetting to specify the VLAN ID, causing the command to apply to all VLANs (if supported) or fail.
Setting priority on a switch that already has a lower priority elsewhere, not changing root election.
Related Commands
show spanning-tree
Displays the Spanning Tree Protocol (STP) state and configuration for all VLANs or a specific VLAN, used to verify root bridge, port roles, and STP topology.
spanning-tree vlan [id] root primary
This command configures a switch as the root bridge for a specific VLAN by setting its bridge priority to 24576 (or lower if another switch has a lower priority), ensuring it becomes the root bridge in the Spanning Tree Protocol (STP) topology.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions