How to view root path cost (STP)

tomsettomset Member Posts: 79 ■■□□□□□□□□
Anyone know how to see the "root path cost" of a switchport?

The "show spanning-tree vlan x" command only shows the path cost to the switch directly connected to it.

For instance, if a switch has 2 links to the root bridge each taking different routes to the root bridge, how can I see the difference in the root path cost between those 2 links?
Next up:
CCIP

Comments

  • MACattackMACattack Member Posts: 121
    Okay for your question, I created 2 switch with 2 connection on both side

    SW1 have to conenction to SW2

    What I did is I created a trunk ports on both side and assigne SW1 as VTP server with domain CISCO and VTP client as SW2 with same domain.


    SW1 with sh span root
    SW1#show spanning-tree root
    VLAN1
    Root ID Priority 32768
    Address cc01.0b54.0000
    This bridge is the root
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    VLAN2
    Root ID Priority 8192
    Address cc01.0b54.0001
    This bridge is the root
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    VLAN3
    Root ID Priority 32768
    Address cc01.0b54.0002
    This bridge is the root
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    For client
    SW2#show spanning-tree root
    VLAN1
    Root ID Priority 32768
    Address cc01.0b54.0000
    Cost 19
    Port 2 (FastEthernet0/1)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    VLAN2
    Root ID Priority 8192
    Address cc01.0b54.0001
    Cost 19
    Port 2 (FastEthernet0/1)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    VLAN3
    Root ID Priority 32768
    Address cc01.0b54.0002
    Cost 19
    Port 2 (FastEthernet0/1)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    As you can see VLAN 2 root bridge is SW1.

    Then I assign SW2 as root for vlan 3


    SW2#show spanning-tree root
    VLAN1
    Root ID Priority 32768
    Address cc01.0b54.0000
    Cost 19
    Port 2 (FastEthernet0/1)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    VLAN2
    Root ID Priority 8192
    Address cc01.0b54.0001
    Cost 19
    Port 2 (FastEthernet0/1)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    VLAN3
    Root ID Priority 8192
    Address cc02.0b54.0002
    This bridge is the root
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec


    Now to get the path cost you need to manually check each switch trunks and run the command sw spa root. You need to DIG to be able to get the root path cost going to the root bridge.
  • marlon23marlon23 Member Posts: 164 ■■□□□□□□□□
    shutdown one of the links and see the new root path cost icon_biggrin.gif
    LAB: 7609-S, 7606-S, 10008, 2x 7301, 7204, 7201 + bunch of ISRs & CAT switches
  • MACattackMACattack Member Posts: 121
    Or you can use
    SW1#SHOW SPanning-tree BRIEF
    VLAN1
    Spanning tree enabled protocol ieee
    Root ID Priority 32768
    Address cc01.0b54.0000
    This bridge is the root
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 32768
    Address cc01.0b54.0000
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    Aging Time 0

    Interface Designated
    Name Port ID Prio Cost Sts Cost Bridge ID Port ID

    ----
    ---


    FastEthernet0/1 128.2 128 19 FWD 0 32768 cc01.0b54.0000 128.2
    FastEthernet0/10 128.11 128 19 FWD 0 32768 cc01.0b54.0000 128.11
  • tomsettomset Member Posts: 79 ■■□□□□□□□□
    MACattack wrote:
    Or you can use
    SW1#SHOW SPanning-tree BRIEF
    VLAN1
    Spanning tree enabled protocol ieee
    Root ID Priority 32768
    Address cc01.0b54.0000
    This bridge is the root
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 32768
    Address cc01.0b54.0000
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    Aging Time 0

    Interface Designated
    Name Port ID Prio Cost Sts Cost Bridge ID Port ID

    ----
    ---


    FastEthernet0/1 128.2 128 19 FWD 0 32768 cc01.0b54.0000 128.2
    FastEthernet0/10 128.11 128 19 FWD 0 32768 cc01.0b54.0000 128.11

    I'll try this command out on my lab. From what you posted, it's only showing a cost of 19 which could just be the port cost and not the root path cost.
    Next up:
    CCIP
Sign In or Register to comment.