Configuring RPVST+

Procedure
  1. Set RPVST+ as the spanning tree mode with the command跨越-tree mode rpvst.
  2. Enable spanning tree with the command跨越-tree.
  3. For each layer 2 interface or LAG, configure the list of VLANs that are part of the spanning tree with the command跨越-tree vlan.
  4. Set the cost and priority for each VLAN with the commands跨越-tree vlan costand跨越-tree vlan port-priority.
  5. For most deployments, the default values for the following settings do not need to be changed. If your deployment requires different settings, change the default values with the indicated commands:
    RPVST+ setting Default value Command to change it
    Include VLAN ID in spanning tree packets. Enabled. 跨越-tree extend-system-id
    Block links when VLAN mismatch is detected. 禁用。 跨越-tree ignore-pvid-inconsistency
    STP link type. Point-to-point. 跨越-tree link-type
    Support extended range of paths costs for high-speed links. Enabled. 跨越-tree pathcost-type
    Propagate topology changes to other ports. 禁用。 跨越-tree tcn-guard
  6. Review RPVST+ configuration settings with the commandshow spanning tree.

Example

This example creates the following configuration:

  • Sets the spanning tree mode torpvst.
  • Enables spanning tree.
  • Defines spanning tree support for VLANs2-5.
  • Sets the priority for each VLAN.
switch#configswitch(config)#跨越-tree mode rpvstswitch(config)#跨越-treeswitch(config)#跨越-tree vlan 2-5switch(config)#跨越-tree vlan 2 priority 5switch(config)#跨越-tree vlan 3 priority 4switch(config)#扩充树vlan 4优先3switch(config)#跨越-tree vlan 5 priority 2switch(config)#exitswitch#show spanning-treeSpanning tree status : Enabled Protocol: RPVST Extended System-id : Enabled Ignore PVID Inconsistency : Disabled Path cost method : Long VLAN2 Root ID Priority : 20480 MAC-Address: 70:72:cf:38:21:e5 This bridge is the root Hello time(in seconds):2 Max Age(in seconds):20 Forward Delay(in seconds):15 Bridge ID Priority : 20480 MAC-Address: 70:72:cf:38:21:e5 Hello time(in seconds):2 Max Age(in seconds):20 Forward Delay(in seconds):15 Port Role State Cost Priority Type ------------ -------------- ------------ ------- ---------- ---------- 1/1/1 Designated Forwarding 20000 128 point_to_point VLAN3 Root ID Priority : 16384 MAC-Address: 70:72:cf:38:21:e5 This bridge is the root Hello time(in seconds):2 Max Age(in seconds):20 Forward Delay(in seconds):15 Bridge ID Priority : 16384 MAC-Address: 70:72:cf:38:21:e5 Hello time(in seconds):2 Max Age(in seconds):20 Forward Delay(in seconds):15 Port Role State Cost Priority Type ------------ -------------- ------------ ------- ---------- ---------- 1/1/1 Designated Forwarding 20000 128 point_to_point VLAN4 Root ID Priority : 12288 MAC-Address: 70:72:cf:38:21:e5 This bridge is the root Hello time(in seconds):2 Max Age(in seconds):20 Forward Delay(in seconds):15 Bridge ID Priority : 12288 MAC-Address: 70:72:cf:38:21:e5 Hello time(in seconds):2 Max Age(in seconds):20 Forward Delay(in seconds):15 Port Role State Cost Priority Type ------------ -------------- ------------ ------- ---------- ---------- 1/1/1 Designated Forwarding 20000 128 point_to_point VLAN5 Root ID Priority : 8192 MAC-Address: 70:72:cf:38:21:e5 This bridge is the root Hello time(in seconds):2 Max Age(in seconds):20 Forward Delay(in seconds):15 Bridge ID Priority : 8192 MAC-Address: 70:72:cf:38:21:e5 Hello time(in seconds):2 Max Age(in seconds):20 Forward Delay(in seconds):15 Port Role State Cost Priority Type ------------ -------------- ------------ ------- ---------- ---------- 1/1/1 Designated Forwarding 20000 128 point_to_point