Configuring Dynamic Path Cost

Transmit hold count value is a counter used to limit the maximum transmission rate of the switch.

Figure 1. Topology for Configuring Dynamic Path Cost


For topology, refer to the figure above. The path cost of all ports can be calculated dynamically based on the speed of the interface. By default, dynamic path cost calculation is disabled.

Execute the following commands in the switch.

Type the following:

  • View the output before configuring the dynamic path cost in Switch A.
iS5comm# show spanning-tree
Root Id         Priority   32768
 Address    00:01:02:03:04:01
 Cost       0
Port       0 [0]
This bridge is the root
Max age 20 sec 0 cs, forward delay 15 sec 0 cs
Hello Time 2 sec 0 cs
MST00
Spanning tree Protocol Enabled.
MST00 is executing the mstp compatible Multiple Spanning Tree Protocol
Bridge Id     Priority  32768
Address  00:01:02:03:04:01
Max age is 20 sec 0 cs, forward delay is 15 sec 0 cs
Hello Time is 2 sec 0 cs
Name    Role         State        Cost     Prio   Type
----    ----         -----        ----     ----   ------
Gi0/1  Designated    Forwarding   20000    128    SharedLan
Gi0/2  Designated    Forwarding   20000    128    SharedLan
  • View the output before configuring the dynamic path cost in Switch A.
iS5comm# show spanning-tree
Root Id         Priority   32768
Address    00:01:02:03:04:01
Cost       200000
 Port       1 [Gi0/1]
 Max age 20 sec 0 cs, forward delay  15 sec 0 cs
Hello Time 2 sec 0 cs
MST00
Spanning tree Protocol Enabled.
MST00 is executing the mstp compatible Multiple Spanning Tree Protocol
Bridge Id    Priority  32768
Address  00:02:02:03:04:01
Max age is 20 sec 0 cs, forward delay is 15 sec 0 cs
Hello Time is 2 sec 0 cs
Name    Role         State        Cost     Prio   Type
----    ----         -----        ----     ----   ------
Gi0/1   Root         Forwarding   20000    128    SharedLan
Gi0/2   Alternate    Discarding   20000    128    SharedLan

To configure the dynamic path cost:

  • Enter the Global Configuration Mode.
iS5comm# configure terminal
  • Configure the dynamic path cost.
iS5comm(config)# spanning-tree pathcost dynamic
  • Reduce the speed of gigabit Ethernet 0/1 to 10 Mbps..
iS5comm(config)# interface gigabitethernet 0/1
iS5comm(config-if)# no negotiation
iS5comm(config-if)#speed 10
  • Return to the Privileged EXEC mode.
iS5comm(config)#end
  • View the spanning tree details in Switch B.
iS5comm# show spanning-tre
 Root Id         Priority   32768
Address    00:01:02:03:04:01
Cost       200000
Port       2 [Gi0/2]  
              Max age 20 sec 0 cs, forward delay 15 sec 0 cs
                Hello Time 2 sec 0 cs
MST00
Spanning tree Protocol Enabled.
MST00 is executing the mstp compatible Multiple Spanning Tree Protocol
Bridge Id   Priority  32768
            Address  00:02:02:03:04:01
            Max age is 20 sec 0 cs, forward delay is 15 sec 0 cs            Hello Time is 2 sec 0 cs
Name    Role         State        Cost     Prio   Type
----    ----         -----        ----     ----   ----
Gi0/1   Alternate    Discarding   2000000  128    P2P
Gi0/2   Root         Forwarding   20000    128    P2P
Note:

If the path cost is already configured for a CIST or an RSTP interface this command has no effect on such ports.

If the cost has been configured previously for an MST instance on a particular interface, this command has no effect on that instance in the specified interface. Whereas the path cost of all other instances on the same interface will be calculated dynamically.