spanning-tree cost
To set the path cost of the interface for Spanning Tree Protocol (STP) calculations, use the spanning-tree
cost command in interface configuration mode. To revert to the default value, use the no form of this command.
spanning-tree [vlan vlan-id] cost cost
no spanning-tree cost
Syntax Description
(Optional) Specifies the VLAN range associated with the spanning-tree instance.
The range of VLAN IDs is 1 to 4094.
vlan vlan-id
The path cost; valid values are from 1 to 200000000.
cost
Command Default
The default path cost is computed from the bandwidth setting of the interface. Default path costs are:
•
1 Gb/s: 4
•
100 Mb/s: 19
•
10 Mb/s: 100
Command Modes
Interface configuration
Command History
ModificationRelease
This command was introduced.Cisco IOS 15.0(2)EX
Usage Guidelines
When you specify VLANs associated with a spanning tree instance, you can specify a single VLAN identified
by a VLAN ID number, a range of VLANs separated by a hyphen, or a series of VLAN IDs separated by a
comma.
When you specify a value for the cost argument, higher values indicate higher costs. This range applies
regardless of the protocol type specified.
Examples
This example shows how to set the path cost on an interface to a value of 250:
Switch(config)# interface gigabitethernet2/0/1
Switch(config-if)# spanning-tree cost 250
This example shows how to set the path cost to 300 for VLANS 10, 12 to 15, and 20:
Switch(config-if)# spanning-tree vlan 10,12-15,20 cost 300
Catalyst 2960-X Switch Layer 2 Command Reference, Cisco IOS Release 15.0(2)EX
OL-29043 -01 81
Layer 2 Commands
spanning-tree cost