background image
Scaling the Spanning Tree Protocol
191
mode, we can set the port costs to help the switch determine the best path to
use. Note that we are not saying you should do this; we just wanted to show
you how.
Setting the Port Cost
The parameters in this next set are used to allow the network administrator
to influence the path that spanning tree chooses when setting the port prior-
ity, port cost, and path cost.
Cisco does not recommend changing these settings unless it's absolutely
necessary. However, the best way to get a good understanding of how the
STP works is by changing the defaults. We do not recommend trying any of
this on a production network unless you have permission from the network
manager and they understand that you can bring the network down.
By changing the port cost, you can change the port ID, which means it can
be a more desirable port to the STP protocol. Remember that STP only uses
the port ID if there is more than one path to the root bridge and they are
equal cost. Path cost is the sum of the costs between a switch and the root
bridge. The STP calculates the path cost based on the media speed of the
links between the switch and the port cost of each port forwarding the
frames. In our lab, both links are 100Mbps, so the port ID is important and
will be used.
To change the path used between a switch and the root bridge, first cal-
culate the current path cost. Then change the port cost of the port you want
to use, making sure that you keep in mind the alternate paths if the primary
path fails before making any changes to your switch. Remember that ports
with a lower port cost are more likely to be chosen; this doesn't mean they
always will be chosen.
To change the port cost of a port on a 5000 series switch, use the set
spantree portcost
command:
Todd5000> (enable) set spantree portcost ?
Usage: set spantree portcost <mod_num/port_num> <cost>
set spantree portcost <trcrf> <cost>
(cost = 1..65535)
The parameters to set the cost of a port are the module and port number
and the cost you want to configure. The following example shows how to set
the port cost on port 1/1 to 10 from the default of 19:
Todd5000> (enable) set spantree portcost 1/1 10
Spantree port 1/1 path cost set to 10.
Copyright ©2000 SYBEX , Inc., Alameda, CA
www.sybex.com