Configuring PVST+ on Cisco Switches

Per VLAN Spanning Tree Plus (PVST+) is a flavor of Spanning Tree Protocol (see prior blog, Default STP Behavior on Cisco Switches) which maintains a spanning tree instance for each VLAN in the network. This means certain VLAN trunks (using 802.1q) can be forwarded for some VLANs while being blocked for others. Further, changes in one STP domain will not effect other spanning tree instances on other VLANs. Additionally, since each VLAN is treated as a separate network, layer 2 load balancing can be accomplished by forwarding some VLANs on one trunk and other VLANs on another trunk.

In this lab I will be configuring PVST+ on three Cisco 3560 switches [IOS 12.2(25r)SEC] connected together as shown in the diagram below. I take care to setup the configuration on each switch before connecting them together. With Cisco switches, spanning tree protocol is enabled by default, however, this is not the case for all vendors.

Lab topology for configuring PVST+

Lab topology for configuring PVST+

As you can see, besides for the default VLAN, I have two other VLANs in this network: VLAN 10 and VLAN 20. I will make Switch2 the root bridge for VLAN 20 and will make Switch1 the root bridge for VLAN 10. The root bridge for the default VLAN will become Switch2 since a priority will not be set explicitly and Switch2 has the lowest MAC address of the three switches. Also, notice I only have to configure trunking on one side of the trunk links since the ports are by default set to “switchport mode dynamic”, and, once a trunk port is detected on one side, the other side of the link also goes into trunk mode.

Switch1 Configuration:

– enable
– configure terminal
– spanning-tree mode pvst
– spanning-tree vlan 10 priority 8192
– interface fastEthernet 0/1
– switchport mode access
– switchport access vlan 10
– no shutdown
– exit
– interface fastEthernet 0/2
– switchport trunk encapsulation dot1q
– switchport mode trunk
– no shutdown
– exit
– interface fastEthernet 0/3
– switchport trunk encapsulation dot1q
– switchport mode trunk
– no shutdown
– end
– write

Switch2 Configuration:

– enable
– configure terminal
– spanning-tree mode pvst
– spanning-tree vlan 20 priority 8192
– interface fastEthernet 0/1
– switchport mode access
– switchport access vlan 10
– no shutdown
– exit
– interface fastEthernet 0/2
– switchport mode access
– switchport access vlan 20
– no shutdown
– exit
– interface fastEthernet 0/3
– switchport trunk encapsulation dot1q
– switchport mode trunk
– no shutdown
– interface fastEthernet 0/4
– switchport trunk encapsulation dot1q
– switchport mode trunk
– no shutdown
– end
– write

Switch3 Configuration:

– enable
– configure terminal
– spanning-tree mode pvst
– interface fastEthernet 0/1
– switchport mode access
– switchport access vlan 20
– no shutdown
– exit
– interface fastEthernet 0/2
– switchport trunk encapsulation dot1q
– switchport mode trunk
– no shutdown
– exit
– interface fastEthernet 0/3
– switchport trunk encapsulation dot1q
– switchport mode trunk
– no shutdown
– end
– write

If you now run the “show spanning-tree” command from Switch2, you will that Switch2 is indeed the root bridge for VLAN 20. Additionally, you will see the MAC address of Switch1 listed as the root bridge for VLAN 10. You should also now be able to ping between PCs in their respective VLANs.

This entry was posted in Cisco, Labs, Networking, Protocols, Technology and tagged , , , , , , , , , , , , , . Bookmark the permalink.

6 Responses to Configuring PVST+ on Cisco Switches

Leave a Reply

Your email address will not be published. Required fields are marked *


one + = 2