Enabling Path Cost Re-calculation on Port Speed Change

The path cost of a port channel is the path cost corresponding to the aggregated speed of all member ports of the port channel.

The path cost of a port channel will be recalculated whenever a port becomes Active/In-Active in the channel group.

For setup, refer to Figure Topology for Configuring Dynamic Path Cost. P1 and P2 are aggregated into a port channel interface.

  1. Execute the following commands in the switch.

    Type the following:

    • View the output before configuring the dynamic path cost on speed change 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: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   Designated   Forwarding   20000    128    SharedLan
    Gi0/2   Designated   Discarding   20000    128    SharedLan

    Output before configuring the dynamic path cost on speed change in Switch B

    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
  2. Configuration of dynamic cost calculation for Lagg

    Type the following:

    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • Configure the dynamic path cost lag-speed.
    iS5comm(config)# spanning-tree pathcost dynamic lag-speed
    • Create and enable port channel in both the switches.
    iS5comm(config)# set port-channel enable
    iS5comm(config)# interface port-channel 1
    iS5comm(config-if)# no shutdown
    iS5comm(config-if)# exit
    iS5comm(config)# interface gigabitethernet 0/1
    iS5comm(config-if)# channel-group 1 mode on
    iS5comm(config-if)# exit
    • Return to the Privileged EXEC mode.
    iS5comm(config-if)#end
    • View the output in Switch B using the following command.
    iS5comm# show spanning-tre
     Root Id         Priority   32768
    Address    00:01:02:03:04:01
    Cost 99900
    Port 25 [po1] 
                  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
    ----    ----         -----        ----     ----   ------
    po1     Root         Forwarding   200000   128    P2P
  3. Make Port 2 as member of Port Channel on both switches.

    Type the following:

    iS5comm# configure terminal
    iS5comm(config)# interface gigabitethernet 0/2
    iS5comm(config-if)# channel-group 1 mode on
    iS5comm(config-if)# exit
  4. View the output in Switch B.

    Type the following:

    • View the default output in Switch B.
    iS5comm# show spanning-tree
    Root Id         Priority   32768
                    Address    00:01:02:03:04:01
                    Cost 100000
                    Port 25 [po1]
    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
    ----    ----         -----        ----     ----   ------
    po1     Designated   Forwarding   100000   128    P2P
  5. Remove Port 2 from Port Channel on both the switches.

    Type the following:

    iS5comm# configure terminal
    iS5comm(config)# interface gigabitethernet 0/2
    iS5comm(config-if)# no channel-group
    iS5comm(config-if)# exit
  6. View the output in Switch B.

    Type the following:

    • View the default output in Switch B.
    iS5comm# show spanning-tree
    Root Id         Priority   32768
                    Address    00:01:02:03:04:01
                    Cost 100000
                    Port 25 [po1]
    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/2   Alternate    Discarding   20000    128    SharedLan
    po1     Designated   Forwarding   20000    128    P2P
  7. Execute the no spanning-tree pathcost dynamic lag-speed Global Configuration command to disable dynamic pathcost calculation on aggregated port speed change.

    Type the following:

    iS5comm(config)# no spanning-tree pathcost dynamic lag-speed
    Note: On disabling dynamic pathcost calculation on speed change the calculated pathcost value for Port channel will not be re-calculated. There after the value will be recalculated for the port channel as the Dynamic Path Cost calculation is explained in Section “Configuring Dynamic Path cost in Aggregate Port”