When a loop occurs in the network topology, STP uses path cost to determine the spanning-tree states of the ports. Path cost is obtained from the speed of the interface. You can configure a lower path cost for an interface if the port needs to be selected first, or you can configure a higher path cost if the port needs to be selected last to configure it to the forwarding state. The path cost is used to determine the topology only if the loop in the network cannot be resolved using only the bridge IDs. If all of the ports have the same path cost values, then the spanning tree puts the lowest numbered port into forwarding state.
See Topology Example for details on the topology that is referenced in the following procedure. After the topology stabilizes and switch A is elected as the root, the ports on all of the switches, except port 57 of switch C, should be in the forwarding state. Port 57 of switch C should be an alternate port and in the discarding state.
SEFOS-2 SEFOS# configure terminal SEFOS-2 SEFOS(config)# interface extreme-ethernet 0/1 SEFOS-2 SEFOS(config-if)#
Valid interfaces include physical interfaces and port-channel logical interfaces (port-channel port_channel_number).
SEFOS-2 SEFOS(config-if)# spanning-tree vlan 10 cost 2000 Pvrst Vlan Cost is set SEFOS-2 SEFOS(config-if)# end SEFOS-2 SEFOS#
For cost, the range is 0 to 200000. The default value is derived from the media speed of the interface.
TOR-1 SEFOS# show spanning-tree vlan 10 ------------------------------------------------------------------- Spanning-tree for VLAN 10 Root Id Priority 32778 Address 00:14:4f:6c:56:6f Cost 2000 Port Ex0/1 Hello Time 2 Sec, Max Age 20 Sec, Forward Delay 15 Sec Spanning Tree Enabled Protocol PVRST Bridge Id Priority 32778 Address 00:14:4f:6c:69:ed Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec Name Role State Cost Prio Type ---- ---- ----- ---- ---- ------ Ex0/1 Root Forwarding 2000 128 P2P Ex0/57 Alternate Discarding 2000 128 P2P TOR-1 SEFOS#
SEFOS-2 SEFOS# show spanning-tree vlan 10 ------------------------------------------------------------------- Spanning-tree for VLAN 10 Root Id Priority 32778 Address 00:14:4f:6c:56:6f Cost 200 Port Ex0/1 Hello Time 2 Sec, Max Age 20 Sec, Forward Delay 15 Sec Spanning Tree Enabled Protocol PVRST Bridge Id Priority 32778 Address 00:14:4f:6c:6e:0d Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec Name Role State Cost Prio Type ---- ---- ----- ---- ---- ------ Ex0/1 Root Forwarding 200 128 P2P Ex0/57 Designated Forwarding 2000 128 P2P SEFOS-2 SEFOS#
SEFOS-2 SEFOS# configure terminal SEFOS-2 SEFOS(config)# interface extreme-ethernet 0/1 SEFOS-2 SEFOS(config-if)# no spanning-tree vlan 10 cost Pvrst Vlan Cost is set SEFOS-2 SEFOS(config-if)# end SEFOS-2 SEFOS#
Port 57 should be in discarding state again.
SEFOS-2 SEFOS# show spanning-tree vlan 10 ------------------------------------------------------------------- Spanning-tree for VLAN 10 Root Id Priority 32778 Address 00:14:4f:6c:56:6f Cost 2000 Port Ex0/1 Hello Time 2 Sec, Max Age 20 Sec, Forward Delay 15 Sec Spanning Tree Enabled Protocol PVRST Bridge Id Priority 32778 Address 00:14:4f:6c:6e:0d Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec Name Role State Cost Prio Type ---- ---- ----- ---- ---- ------ Ex0/1 Root Forwarding 2000 128 P2P Ex0/57 Alternate Discarding 2000 128 P2P SEFOS-2 SEFOS#