Objective
Prevent Layer 2 loops in a redundant multi-switch topology by configuring Rapid Spanning Tree Protocol (Rapid-PVST+) and manually electing the Primary and Backup Root Bridges.
Lab Topology
Task 1 - Enable Rapid-PVST+
Configure Rapid-PVST+ mode globally on all three switches (SW1, SW2, SW3).
SW1(config)# spanning-tree mode rapid-pvst
SW2(config)# spanning-tree mode rapid-pvst
SW3(config)# spanning-tree mode rapid-pvst
Task 2 - Configure Root and Backup Root Bridges
Set SW1 as the Primary Root Bridge and SW2 as the Secondary (Backup) Root Bridge for VLAN 1.
SW1(config)# spanning-tree vlan 1 priority 4096
SW2(config)# spanning-tree vlan 1 priority 8192
Task 3 - Verification
Verify spanning-tree states and root bridge election on SW3 to confirm port roles (Root, Designated, Blocked).
SW3# show spanning-tree VLAN0001 Spanning tree enabled protocol rstp Root ID Priority 4097 Address 0001.42a1.3e01 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 0002.1b2c.4d03 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Fa0/1 Root FWD 19 128.1 P2p Fa0/2 Altn BLK 19 128.2 P2p