Enabling and configuring PVST+ on a system

Follow the steps to configure PVST+ on a system.

About this task

The ports and parameters can be configured individually on a system by:
  1. Entering the commands in steps 1, and 2
  2. Running the relevant addition steps and parameter commands
  3. Verifying the result
  4. Saving the configuration

For detailed descriptions of the parameters and features, see the sections STP parameters and STP features.

Procedure

  1. Enter global configuration mode.
    device# configure terminal
    
  2. Enable PVST+.
    device(config)# protocol spanning-tree pvst
    
  3. Configure the bridge priority for the common instance.
    device(config-pvst)# bridge-priority 4096
    
    Valid values range from 0 through 61440 in multiples of 4096. Assigning a lower priority value indicates that the bridge might become root.
  4. Configure the forward delay parameter.
    device(config-pvst)# forward-delay  15
    
  5. Configure the hello time parameter.
    device(config-pvst)# hello-time 2 
    
  6. Configure the maximum age parameter.
    device(config-pvst)# max-age 20
    
  7. Add VLANs.
    1. Configure VLAN 100 with a priority of 0.
      device(config-pvst)# vlan 100 priority 0
      
      The bridge priority in configured in multiples of 4096.
    2. Configure VLAN 201 with a priority of 12288.
      device(config-pvst)# vlan 201 priority 12288
      
    3. Configure VLAN 301 with a priority of 20480.
      device(config-pvst)# vlan 301 priority 20480
      
  8. Set the switching characteristics for interface 0/3.
    1. Enter interface configuration mode.
      device(config)# interface ethernet 0/3
      
    2. Set the switching characteristics of the interface.
      device(conf-if-eth-0/3)# switchport
      
    3. Set the interface mode to trunk.
      device(conf-if-eth-0/3)# switchport mode trunk
      
    4. Add VLAN 100 as a member VLAN.
      device(conf-if-eth-0/3)# switchport trunk allowed vlan add 100  
      
    5. Add VLAN 201 as a member VLAN.
      device(conf-if-eth-0/3)# switchport trunk allowed vlan add 201  
      
    6. Add VLAN 301 as a member VLAN.
      device(conf-if-eth-0/3)# switchport trunk allowed vlan add 301  
      
    7. Enable spanning tree on the interface.
      device(conf-if-eth-0/3)# no spanning-tree shutdown  
      
    8. Return to privileged EXEC mode.
      device(conf-if-eth-0/3)# exit 
      
  9. Set the switching characteristics for interface 0/4.
    1. Enter interface configuration mode.
      device(config)# interface ethernet 0/4
      
    2. Set the switching characteristics of the interface.
      device(conf-if-eth-0/4)# switchport
      
    3. Set the interface mode to trunk.
      device(conf-if-eth-0/4)# switchport mode trunk
      
    4. Add VLAN 100 as a member VLAN.
      device(conf-if-eth-0/4)# switchport trunk allowed vlan add 100  
      
    5. Add VLAN 201 as a member VLAN.
      device(conf-if-eth-0/4)# switchport trunk allowed vlan add 201  
      
    6. Add VLAN 301 as a member VLAN.
      device(conf-if-eth-0/4)# switchport trunk allowed vlan add 301  
      
    7. Enable spanning tree on the interface.
      device(conf-if-eth-0/4)# no spanning-tree shutdown  
      
    8. Return to privileged EXEC mode.
      device(conf-if-eth-0/4)# exit  
      
  10. To interoperate with switches other than VDX switches in PVST+ mode, you must configure the interface that is connected to that switch.
    1. Enter interface configuration mode for the port that interoperates with a VDX device.
      device(config)# interface ethernet 0/12
      
    2. Specify the MAC address for the device.
      device(conf-if-eth-0/12)# spanning-tree bpdu-mac 0100.0ccc.cccd
      
    3. Enable spanning tree on the interface.
      device(conf-if-eth-0/12)# no spanning-tree shutdown  
      
    4. Return to privileged EXEC mode.
      device(conf-if-eth-0/12)# end  
      
  11. Verify the configuration.
    device# show spanning-tree 
    
    VLAN 1
    
     Spanning-tree Mode: PVST Protocol
    
     Root Id: 0001.01e0.5200.0180 (self)
     Bridge Id: 0001.01e0.5200.0180
    
     Root Bridge Forward Delay: 15; Hello Time: 2; Max Age: 20; Max-hops: 20
     Configured Forward Delay: 15; Hello Time: 2; Max Age: 20; Max-hops: 20
     Number of topology change(s): 0
    
     Bpdu-guard errdisable timeout: disabled
     Bpdu-guard errdisable timeout interval: 300 sec
    
     Port Et 0/3 enabled
        Ifindex: 201351168; Id: 8001; Role: Disabled; State: Disabled
        Designated Path Cost: 0
        Configured Path Cost: 20000000
        Designated Port Id: 0; Port Priority: 128
        Designated Bridge: 0000.0000.0000.0000
        Number of forward-transitions: 0
        Version: Per-VLAN Spanning Tree Protocol - Received None - Sent STP
        Portfast: off
        Configured Root guard: off; Operational Root guard: off
        Bpdu-guard: off
        Link-type: point-to-point
        Received BPDUs: 0; Sent BPDUs: 0
    
     Port Et 0/4 enabled
        Ifindex: 201359360; Id: 8002; Role: Disabled; State: Disabled
        Designated Path Cost: 0
        Configured Path Cost: 20000000
        Designated Port Id: 0; Port Priority: 128
        Designated Bridge: 0000.0000.0000.0000
        Number of forward-transitions: 0
        Version: Per-VLAN Spanning Tree Protocol - Received None - Sent STP
        Portfast: off
        Configured Root guard: off; Operational Root guard: off
        Bpdu-guard: off
        Link-type: point-to-point
        Received BPDUs: 0; Sent BPDUs: 0
    
    VLAN 100
    
     Spanning-tree Mode: PVST Protocol
    
     Root Id: 0064.01e0.5200.0180 (self)
     Bridge Id: 0064.01e0.5200.0180
    
     Root Bridge Forward Delay: 15; Hello Time: 2; Max Age: 20; Max-hops: 20
     Configured Forward Delay: 15; Hello Time: 2; Max Age: 20; Max-hops: 20
     Number of topology change(s): 0
    
     Bpdu-guard errdisable timeout: disabled
     Bpdu-guard errdisable timeout interval: 300 sec
    
     Port Et 0/3 enabled
        Ifindex: 201351168; Id: 8001; Role: Disabled; State: Disabled
        Designated Path Cost: 0
        Configured Path Cost: 20000000
        Designated Port Id: 0; Port Priority: 128
        Designated Bridge: 0000.0000.0000.0000
        Number of forward-transitions: 0
        Version: Per-VLAN Spanning Tree Protocol - Received None - Sent STP
        Portfast: off
        Configured Root guard: off; Operational Root guard: off
        Bpdu-guard: off
        Link-type: point-to-point
        Received BPDUs: 0; Sent BPDUs: 0
    
     Port Et 0/4 enabled
        Ifindex: 201359360; Id: 8002; Role: Disabled; State: Disabled
        Designated Path Cost: 0
        Configured Path Cost: 20000000
        Designated Port Id: 0; Port Priority: 128
        Designated Bridge: 0000.0000.0000.0000
        Number of forward-transitions: 0
        Version: Per-VLAN Spanning Tree Protocol - Received None - Sent STP
        Portfast: off
        Configured Root guard: off; Operational Root guard: off
        Bpdu-guard: off
        Link-type: point-to-point
        Received BPDUs: 0; Sent BPDUs: 0
    
    VLAN 201
    
     Spanning-tree Mode: PVST Protocol
    
     Root Id: 30c9.01e0.5200.0180 (self)
     Bridge Id: 30c9.01e0.5200.0180
    
     Root Bridge Forward Delay: 15; Hello Time: 2; Max Age: 20; Max-hops: 20
     Configured Forward Delay: 15; Hello Time: 2; Max Age: 20; Max-hops: 20
     Number of topology change(s): 0
    
     Bpdu-guard errdisable timeout: disabled
     Bpdu-guard errdisable timeout interval: 300 sec
    
     Port Et 0/3 enabled
        Ifindex: 201351168; Id: 8001; Role: Disabled; State: Disabled
        Designated Path Cost: 0
        Configured Path Cost: 20000000
        Designated Port Id: 0; Port Priority: 128
        Designated Bridge: 0000.0000.0000.0000
        Number of forward-transitions: 0
        Version: Per-VLAN Spanning Tree Protocol - Received None - Sent STP
        Portfast: off
        Configured Root guard: off; Operational Root guard: off
        Bpdu-guard: off
        Link-type: point-to-point
        Received BPDUs: 0; Sent BPDUs: 0
    
     Port Et 0/4 enabled
        Ifindex: 201359360; Id: 8002; Role: Disabled; State: Disabled
        Designated Path Cost: 0
        Configured Path Cost: 20000000
        Designated Port Id: 0; Port Priority: 128
        Designated Bridge: 0000.0000.0000.0000
        Number of forward-transitions: 0
        Version: Per-VLAN Spanning Tree Protocol - Received None - Sent STP
        Portfast: off
        Configured Root guard: off; Operational Root guard: off
        Bpdu-guard: off
        Link-type: point-to-point
        Received BPDUs: 0; Sent BPDUs: 0
    
    VLAN 301
    
     Spanning-tree Mode: PVST Protocol
    
     Root Id: 512d.01e0.5200.0180 (self)
     Bridge Id: 512d.01e0.5200.0180
    
     Root Bridge Forward Delay: 15; Hello Time: 2; Max Age: 20; Max-hops: 20
     Configured Forward Delay: 15; Hello Time: 2; Max Age: 20; Max-hops: 20
     Number of topology change(s): 0
    
     Bpdu-guard errdisable timeout: disabled
     Bpdu-guard errdisable timeout interval: 300 sec
    
     Port Et 0/3 enabled
        Ifindex: 201351168; Id: 8001; Role: Disabled; State: Disabled
        Designated Path Cost: 0
        Configured Path Cost: 20000000
        Designated Port Id: 0; Port Priority: 128
        Designated Bridge: 0000.0000.0000.0000
        Number of forward-transitions: 0
        Version: Per-VLAN Spanning Tree Protocol - Received None - Sent STP
        Portfast: off
        Configured Root guard: off; Operational Root guard: off
        Bpdu-guard: off
        Link-type: point-to-point
        Received BPDUs: 0; Sent BPDUs: 0
    
     Port Et 0/4 enabled
        Ifindex: 201359360; Id: 8002; Role: Disabled; State: Disabled
        Designated Path Cost: 0
        Configured Path Cost: 20000000
        Designated Port Id: 0; Port Priority: 128
        Designated Bridge: 0000.0000.0000.0000
        Number of forward-transitions: 0
        Version: Per-VLAN Spanning Tree Protocol - Received None - Sent STP
        Portfast: off
        Configured Root guard: off; Operational Root guard: off
        Bpdu-guard: off
        Link-type: point-to-point
        Received BPDUs: 0; Sent BPDUs: 0
    

    Observe that the settings comply with the formula set out in the STP parameters section, as:

    (2 × (forward delay - 1)) ≥ maximum age ≥ (2 × (hello time + 1))

    or in this case: 28 ≥ 20 ≥ 6.

  12. Save the configuration.
    device# copy running-config startup-config
    

Enable PVST+ on a system configuration example

device# configure terminal
device(config)# protocol spanning-tree pvst
device(config-pvst)# bridge-priority 4096
device(config-pvst)# forward-delay  15
device(config-pvst)# hello-time 2 
device(config-pvst)# max-age 20
device(config-pvst)# vlan 100 priority 0
device(config-pvst)# vlan 201 priority 12288
device(config-pvst)# vlan 301 priority 20480
device(config-pvst)# interface ethernet 0/3
device(conf-if-eth-0/3)# switchport
device(conf-if-eth-0/3)# switchport mode trunk
device(conf-if-eth-0/3)# switchport trunk allowed vlan add 100 
device(conf-if-eth-0/3)# switchport trunk allowed vlan add 201 
device(conf-if-eth-0/3)# switchport trunk allowed vlan add 301 
device(conf-if-eth-0/3)# no spanning-tree shutdown
device(conf-if-eth-0/3)# exit
device(config)# interface ethernet 0/4
device(conf-if-eth-0/4)# switchport
device(conf-if-eth-0/4)# switchport mode trunk
device(conf-if-eth-0/4)# switchport trunk allowed vlan add 100 
device(conf-if-eth-0/4)# switchport trunk allowed vlan add 201 
device(conf-if-eth-0/4)# switchport trunk allowed vlan add 301 
device(conf-if-eth-0/4)# no spanning-tree shutdown
device(conf-if-eth-0/4)# end
device# show spanning-tree 
device# copy running-config startup-config