Tuning STP: cost, port priority, per-VLAN root, PortFast and Rapid PVST+
Sign in to read this lesson
You can change the root port with "spanning-tree cost". When the costs are equal, the neighbour's port ID (port priority + port number) decides. "spanning-tree port-priority" is configured on the root bridge side, because that switch sends the BPDUs. With PVST+ you can give each VLAN a different root bridge and spread traffic over the links; you verify with show spanning-tree summary. PortFast skips the listening and learning states on host ports, but does not disable STP. Protect it with BPDU Guard. "spanning-tree mode rapid-pvst" enables Rapid PVST+.
What you will learn
spanning-tree cost 500(on an interface) changes the port's cost: the root port moves to another path. The total cost to the root is shown on the Cost line ofshow spanning-tree(19 + 19 = 38).- When the cost is equal, the neighbour's port ID (port priority.number, for example 128.15 < 128.16) decides.
spanning-tree port-priority 16is configured on the neighbour (BPDU-sending) switch. The value is a multiple of 16 (0–240). - With PVST+, a different root per VLAN:
spanning-tree vlan 10 priority 4096on A,vlan 20on B,vlan 30on C. Quick overview:show spanning-tree summary. - PortFast (
spanning-tree portfast, or globallyspanning-tree portfast default) puts a host port into forwarding immediately. It does not disable STP: when the port receives a BPDU it goes back to normal STP. Use it only on PC/server/printer ports, never on switch or hub ports. - Protect PortFast with BPDU Guard (
spanning-tree bpduguard enable): a port that receives a BPDU goes err-disabled. Rapid PVST+:spanning-tree mode rapid-pvst(on every switch).
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.