PVST+ and Rapid PVST+ Configuration on Cisco Switches

Aisyah Aldina

Cartoon pair of different colored rail tracks branching from one station for a PVST+ and Rapid PVST+ guide

In this lab we configure PVST+ and Rapid PVST+ on Cisco switches in Cisco Packet Tracer. PVST+ (Per VLAN Spanning Tree Plus) is Cisco’s version of STP that runs a separate spanning tree for every VLAN. Each VLAN can have its own root bridge and its own path.

That is what lets us load balance: VLAN 10 uses one cable, VLAN 20 uses the other, and each acts as the backup for the other. I also compare how fast plain PVST+ and Rapid PVST+ recover when an uplink dies. The difference is big. Everything was done in Cisco Packet Tracer 8.2.1.

Download the Packet Tracer lab file
Opens in Cisco Packet Tracer 8.2.1 or newer · 3 switches 2960, 4 PCs · VLAN 10/20, a root per VLAN, and Rapid PVST+ already set
Download .pkt

Lab Topology and Devices

The topology mirrors a common three-tier campus design. Two distribution switches (DIST1 and DIST2) at the top are linked to each other, and one access switch (ACCESS) below connects to both. That makes a triangle, so there is a loop STP must break.

Each VLAN has two PCs. One sits on ACCESS and the other on a distribution switch, so traffic from ACCESS has to go up through one of the uplinks.

DIST1 top left, DIST2 top right, ACCESS at the bottom

Triangle topology of DIST1, DIST2, and ACCESS with four PCs in Cisco Packet Tracer

Dashed lines are trunk links between switches.

Switch links (all trunks)
DIST1 Gig0/1  <->  DIST2 Gig0/1
DIST1 Fa0/1   <->  ACCESS Fa0/1
DIST2 Fa0/1   <->  ACCESS Fa0/2

PC     Switch / Port     VLAN   IP
PC0    ACCESS Fa0/3      10     192.168.10.10/24
PC1    ACCESS Fa0/4      20     192.168.20.10/24
PC2    DIST2 Fa0/2       10     192.168.10.20/24
PC3    DIST1 Fa0/2       20     192.168.20.20/24

Root bridge
VLAN 10: DIST1 (root primary), DIST2 backup (root secondary)
VLAN 20: DIST2 (root primary), DIST1 backup (root secondary)

There is no router, so PCs in different VLANs cannot ping each other. What we test here is the path inside each VLAN.

Crossover cables between switches

Zoomed crossover trunk cable from DIST1 to ACCESS marked with a red box

All three switch links use Copper Cross-Over. The DIST1 to DIST2 link uses the GigabitEthernet ports for extra bandwidth. PCs connect with Copper Straight-Through.

Setting the PC IP Addresses

All four PCs get a static IP with no gateway. Make sure PC0 and PC2 are on 192.168.10.x, and PC1 and PC3 are on 192.168.20.x.

The steps are the same on every PC, so I only show PC0.

Open PC0

PC0 under the ACCESS switch circled in red

Click PC0 under the ACCESS switch.

PC0 IP

PC0 IP Configuration 192.168.10.10 mask 255.255.255.0

Desktop tab, IP Configuration, Static, then 192.168.10.10 with subnet mask 255.255.255.0. Repeat on the other PCs using the table.

DIST1: Root for VLAN 10, Backup for VLAN 20

spanning-tree vlan 10 root primary makes the switch set a priority low enough to win the VLAN 10 root election. root secondary sets a priority just above that, so the switch takes over if the primary root fails.

That is the heart of PVST+: one switch can be the root for one VLAN and the backup for another.

Open DIST1

DIST1 switch at the top left circled in red

Click Switch0 at the top left, then the CLI tab. Answer no if the initial configuration dialog appears.

enable
configure terminal
hostname DIST1
vlan 10
 name STAFF
vlan 20
 name GUEST
exit
interface range g0/1 , fa0/1
 switchport mode trunk
interface fa0/2
 switchport mode access
 switchport access vlan 20
exit
spanning-tree vlan 10 root primary
spanning-tree vlan 20 root secondary
end
write memory

DIST1 configuration saved

DIST1 with spanning-tree vlan 10 root primary and vlan 20 root secondary

interface range g0/1 , fa0/1 (with a comma) selects two different port types at once. Both become trunks because they carry VLAN 10 and VLAN 20.

DIST2: Root for VLAN 20, Backup for VLAN 10

DIST2 is the mirror image of DIST1. It is the root for VLAN 20 and the backup for VLAN 10.

PC2 on DIST2 sits in VLAN 10, on purpose on the switch that is not the VLAN 10 root. That forces VLAN 10 traffic from ACCESS to pass through DIST1 before it reaches PC2.

Open DIST2

DIST2 switch at the top right circled in red

Click Switch1 at the top right, then the CLI tab.

enable
configure terminal
hostname DIST2
vlan 10
 name STAFF
vlan 20
 name GUEST
exit
interface range g0/1 , fa0/1
 switchport mode trunk
interface fa0/2
 switchport mode access
 switchport access vlan 10
exit
spanning-tree vlan 20 root primary
spanning-tree vlan 10 root secondary
end
write memory

DIST2 configuration saved

DIST2 with spanning-tree vlan 20 root primary and vlan 10 root secondary

Same as DIST1, only the VLAN numbers are swapped.

Configuring the ACCESS Switch

The ACCESS switch needs no STP settings at all. It simply follows the root bridge decisions made on the distribution switches.

Both uplinks become trunks, PC0’s port goes into VLAN 10, and PC1’s port into VLAN 20.

Open ACCESS

ACCESS switch at the bottom centre circled in red

Click Switch2 at the bottom centre, then the CLI tab.

enable
configure terminal
hostname ACCESS
vlan 10
 name STAFF
vlan 20
 name GUEST
exit
interface range fa0/1 - 2
 switchport mode trunk
interface fa0/3
 switchport mode access
 switchport access vlan 10
interface fa0/4
 switchport mode access
 switchport access vlan 20
end
write memory

Proving Per-VLAN Load Balancing

If everything is right, ACCESS uses a different uplink for each VLAN. We check that with show spanning-tree vlan followed by the VLAN number.

Wait about 50 seconds after the last change so STP finishes converging.

VLAN 10 goes through Fa0/1 to DIST1

show spanning-tree vlan 10 on ACCESS with root port Fa0/1 and Fa0/2 Altn BLK
show spanning-tree vlan 10

The Root ID has priority 24586 and DIST1’s address. The root port is Fa0/1 (to DIST1), and Fa0/2 (to DIST2) is Altn BLK. 24586 comes from the 24576 set by root primary plus VLAN number 10.

VLAN 20 goes through Fa0/2 to DIST2

show spanning-tree vlan 20 on ACCESS with root port Fa0/2 and Fa0/1 Altn BLK
show spanning-tree vlan 20

For VLAN 20 it is the other way round. The root port is Fa0/2 (to DIST2), and Fa0/1 is Altn BLK. Both uplinks are in use: Fa0/1 carries VLAN 10 and Fa0/2 carries VLAN 20. With classic single-tree STP, one uplink would sit idle for every VLAN.

PC0 pings PC2 in VLAN 10

PC0 pinging PC2 at 192.168.10.20 with 0% loss
ping 192.168.10.20

PC0 to PC2 works with 0% loss. The packets travel ACCESS Fa0/1, DIST1, then Gig0/1 to DIST2.

Cable Failure Test with Plain PVST+

Now we test how fast the network recovers when the VLAN 10 uplink dies. To ping straight from the switch, I gave ACCESS an IP in VLAN 10.

configure terminal
interface vlan 10
 ip address 192.168.10.5 255.255.255.0
 no shutdown
end

Then Fa0/1 is shut down and the ping to PC2 is repeated a few times. Each switch ping sends 5 packets with a 2 second timeout.

The ping fails first, then recovers

After Fa0/1 shutdown the first ping is 0/5 and later pings succeed with PVST+
configure terminal
interface fa0/1
 shutdown
end
ping 192.168.10.20
ping 192.168.10.20

The first ping after the shutdown fails completely, Success rate 0 percent (0/5). Only the next ping succeeds. For roughly 30 seconds VLAN 10 was down. That is because Fa0/2 has to go through listening (15 seconds) and learning (15 seconds) before it may forward.

Switching to Rapid PVST+

Rapid PVST+ is PVST+ running RSTP (Rapid STP, the 802.1w standard). The backup port is prepared in advance as an alternate, so when the root port dies, the alternate moves to forwarding right away instead of waiting 30 seconds.

The command is a single line, but it has to go on every switch. I also brought Fa0/1 on ACCESS back up.

configure terminal
spanning-tree mode rapid-pvst
end
write memory

On ACCESS also add interface fa0/1 and no shutdown.

Cable Failure Test with Rapid PVST+

We repeat the same test. Before pulling the uplink, we make sure the protocol has changed.

In show spanning-tree, the Spanning tree enabled protocol line now says rstp instead of ieee.

Rapid PVST+ recovers instantly

Rapid PVST+ showing protocol rstp and a 5/5 ping right after Fa0/1 shutdown

Before the test, VLAN 10 shows protocol rstp, Fa0/1 Root FWD, and Fa0/2 Altn BLK. After Fa0/1 is shut down, the very first ping is Success rate 100 percent (5/5). Not a single packet was lost in this test.

Fa0/2 becomes the root port immediately

Fa0/2 immediately becomes Root FWD after Fa0/1 goes down

With Fa0/1 down, Fa0/2 is immediately Root FWD. Fa0/1 drops off the list because a shut-down port is not part of STP. After the test I brought Fa0/1 back with no shutdown.

My experience: This difference really shows on a live network. VoIP calls, video meetings, or point-of-sale transactions that freeze for 30 seconds will get complaints. That is why modern Cisco switches are usually set to spanning-tree mode rapid-pvst from day one.

STP vs PVST+ vs Rapid PVST+

All three modes prevent loops. They differ in how many spanning trees run and how fast they recover.

This table sums up the lab results.

Mode            STP trees        VLAN load balancing   Recovery (this lab)
STP (802.1D)    1 for all        No                    about 30-50 seconds
PVST+           1 per VLAN       Yes                   about 30 seconds
Rapid PVST+     1 per VLAN       Yes                   no ping lost

In Packet Tracer the 2960 runs PVST+ by default. Rapid PVST+ has to be turned on by hand.

Common Problems and Fixes

PVST+ problems usually come from inconsistent root settings or VLANs missing from a trunk. The result is no load balancing or a VLAN that goes dark.

Make a habit of checking show spanning-tree vlan for every VLAN, not just VLAN 1.

Both VLANs use the same uplink

Root primary for both VLANs is on the same switch. Make sure VLAN 10 and VLAN 20 have their root on different distribution switches.

PCs in the same VLAN cannot ping

The VLAN is missing on a switch or a switch link is not a trunk. Check show vlan brief and show interfaces trunk.

Rapid PVST+ is still slow

The new mode is only on some switches. Rapid PVST+ must run on every switch to negotiate quickly.

show spanning-tree vlan shows protocol ieee

That switch is still running plain PVST+. Run spanning-tree mode rapid-pvst on it.

We have now split VLAN traffic across two uplinks with PVST+, proved each uplink backs up the other, and measured the recovery gap between PVST+ and Rapid PVST+ ourselves. To fine-tune STP paths port by port, see STP port priority and port cost configuration. For links between offices over serial cables, move on to PPP PAP configuration on Cisco routers. If something breaks while you follow along, leave a comment below.

Leave a Comment