Path Cost
Cheat sheet · https://pcornel.dk/topic.php?topic=1022
Answer
Path cost is the STP cost of a port, based on its speed. The root path cost is the sum of the port costs from a switch to the root, and decides root and designated ports.
Remember
Short method (default on older IOS): 10 Mb/s = 100, 100 Mb/s = 19, 1 Gb/s = 4, 10 Gb/s = 2. Long method (spanning-tree pathcost method long) scales to faster links: 1 Gb/s = 20 000, 10 Gb/s = 2 000. Use the same method on every switch. An EtherChannel's cost depends on its bandwidth.
First checks
show spanning-tree vlan <id>— root ID, local bridge ID, and each port's role, state and cost.show spanning-tree root— the root bridge, root cost and root port per VLAN.show spanning-tree vlan <id> detail— BPDUs sent and received, topology changes and their source.show spanning-tree summary— mode, enabled features and port counts per state.show spanning-tree inconsistentports— ports blocked by root guard, loop guard or type inconsistency.
Commands
spanning-tree vlan <vlan-list> cost <cost>- Changes STP path cost on an interface for selected VLANs.
show spanning-tree vlan <vlan>show spanning-tree vlan <id>
Verify in this order
port speed → port cost (short or long method) → costs summed towards the root → lowest root path cost decides root and designated ports
Where it usually breaks
physical link → switchport/bundle membership → VLAN/instance state → STP/LAG decision → MAC forwarding → end-to-end frame path
Path Cost operational reference
| Cost decision | Known-good | Failure signature | Next boundary |
|---|---|---|---|
| Root bridge | Intended root fixed | Wrong root invalidates comparison | Bridge priority |
| Local port cost | Matches design/operational link | Unexpected override/speed | Interface config |
| Total root cost | Preferred path lower | Higher path selected | Tie-break/state |
| Equal-cost tie | Deterministic IDs decide | Assumed random behavior | Bridge/port ID |
| Forwarding path | Matches selected tree | STP correct, traffic differs | MAC/L3 path |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=1022