Pcornel
H3 · Practical network exams · Cisco IOS / IOS XE

STP · Finals

Configuration first, verification second, theory third. Reference templates require task-specific adaptation.

Content version 1.1-draft

Keyboard shortcuts

/ Finals search · Ctrl K global command palette · Alt E Exam Mode · Alt G Golden Scripts · Alt T Exam Topics · Alt V Verify · Esc close dialog.

Case Skills Exam

Quick explanation

Spanning Tree prevents Layer 2 loops by electing a root bridge and selecting forwarding and non-forwarding ports. PVST+ and Rapid PVST+ maintain per-VLAN spanning-tree instances.

Configuration

Replace highlighted placeholders. Configure only the variants required by the task.

Prerequisites and dependency links
  • Identify the desired root and secondary root for each VLAN.
  • Ensure the relevant VLANs and links exist.
Rapid PVST+ Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode. Section link

Alternative group: stp-method. Select the applicable method; do not apply mutually exclusive variants in sequence.

enable
configure terminal
spanning-tree mode rapid-pvst
end
PVST+ Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode. Section link

Alternative group: stp-method. Select the applicable method; do not apply mutually exclusive variants in sequence.

enable
configure terminal
spanning-tree mode pvst
end
Root primary Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode. Section link

Alternative group: stp-method. Select the applicable method; do not apply mutually exclusive variants in sequence.

enable
configure terminal
spanning-tree vlan [VLAN-ID] root primary
end
Command parameters
[VLAN-ID]
VLAN identifier.
Root secondary Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode. Section link

Alternative group: stp-method. Select the applicable method; do not apply mutually exclusive variants in sequence.

enable
configure terminal
spanning-tree vlan [VLAN-ID] root secondary
end
Command parameters
[VLAN-ID]
VLAN identifier.
Explicit bridge priority Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode. Section link

Alternative group: stp-method. Select the applicable method; do not apply mutually exclusive variants in sequence.

  • Use an allowed multiple of 4096; a lower bridge ID is preferred.
enable
configure terminal
spanning-tree vlan [VLAN-ID] priority [BRIDGE-PRIORITY]
end
Command parameters
[VLAN-ID]
VLAN identifier.
[BRIDGE-PRIORITY]
STP bridge priority, normally a multiple of 4096.
Explicit port cost Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode. Section link

Alternative group: stp-method. Select the applicable method; do not apply mutually exclusive variants in sequence.

enable
configure terminal
interface [INTERFACE]
 spanning-tree vlan [VLAN-ID] cost [STP-COST]
 exit
end
Command parameters
[INTERFACE]
Local interface name including type and number, or an SVI as appropriate.
[VLAN-ID]
VLAN identifier.
[STP-COST]
Spanning-tree port path cost.
Explicit port priority Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode. Section link

Alternative group: stp-method. Select the applicable method; do not apply mutually exclusive variants in sequence.

  • Port priority is an additional tie-breaker; select a supported increment.
enable
configure terminal
interface [INTERFACE]
 spanning-tree vlan [VLAN-ID] port-priority [PORT-PRIORITY]
 exit
end
Command parameters
[INTERFACE]
Local interface name including type and number, or an SVI as appropriate.
[VLAN-ID]
VLAN identifier.
[PORT-PRIORITY]
STP port priority using a supported increment.

Show / Verify

Primary verification Section link
show spanning-tree vlan [VLAN-ID]
Example output
This bridge is the root

On the intended root, this bridge should be the root for the selected VLAN.

Detailed verification Section link
show spanning-tree
Example output
Gi0/1   Root FWD   4   128.1   P2p

Check the port role, forwarding state and path cost.

Detailed verification Section link
show spanning-tree summary
Example output
Switch is in rapid-pvst mode

Confirm the configured spanning-tree mode.

Connectivity verification

Layer 2 endpoint test

After sending traffic between the intended hosts, verify that the expected MAC addresses are learned on the correct VLAN and interface.

show mac address-table vlan [VLAN-ID]
show interfaces [INTERFACE] switchport

Common mistakes

  • Wrong VLAN in the root command.
  • Wrong root placement due to lower priority elsewhere.
  • Treating a deliberately blocking or discarding redundant path as a fault.
  • Changing mode may cause reconvergence.

Quick reference and default values

STP roles and states
Role or stateMeaning
RootBest path toward root bridge
DesignatedForwarding port for a segment
AlternateAlternative root path
BackupAlternative segment port
DiscardingRSTP non-forwarding state
LearningLearning MAC addresses
ForwardingForwarding traffic
Blocking / ListeningTraditional STP non-forwarding states
STP priorities
SettingReference
Bridge priority32768 commonly; increments of 4096
Port priority128 commonly; increments of 16
Root electionLowest bridge ID wins
Root pathLowest total path cost wins

Configuration comparison

PVST+ vs Rapid PVST+ — Both are per-VLAN; Rapid PVST+ uses rapid spanning-tree convergence and port roles.

Remove configuration — separate, potentially disruptive actions

Restore default VLAN priority

May trigger a different root election.

enable
configure terminal
no spanning-tree vlan [VLAN-ID] priority
end

Remove explicit port cost

May change the forwarding topology.

enable
configure terminal
interface [INTERFACE]
 no spanning-tree vlan [VLAN-ID] cost
 exit
end

Related reference

Networking technical reference · Interface types · Connectivity verification
Documentation references consulted

Reset checklist?

Command block

Back to Top

Confirmation

Confirm action

Continue?