The stp cost command sets a path cost for a spanning tree port.
The undo stp cost command restores the default path cost.
By default, the path cost of a spanning tree port is the path cost corresponding to the port rate.
Parameter | Description | Value |
---|---|---|
process process-id |
Specifies the ID of a Multiple Spanning Tree Protocol (MSTP) process. |
The value is an integer ranging from 1 to 256. |
instance instance-id |
Specifies the ID of a spanning tree instance. If instance <instance-id> is not specified, the path cost of an interface in the Common and Internal Spanning Tree (CIST) is configured. |
The value is an integer ranging from 0 to 4094, Value 0 indicates CIST. |
cost |
Specifies the path cost of an interface. |
The value varies with path cost calculation standards:
|
Usage Scenario
Port path costs are important basis for calculating a spanning tree. Path costs determine root port selection. On a spanning tree, the port with the lowest path cost to the root bridge is selected as a root port. To configure a port path cost, run the stp cost command.
If different path costs are set for a port in different spanning tree instances, traffic of different VLANs will be forwarded along different physical links and VLAN-based load balancing can be performed.Prerequisites
A path cost calculation standard has been set using the stp pathcost-standard command. By default, the IEEE 802.1T is used to calculate the path cost.
Configuration Impact
If the path cost of a port changes, the spanning tree where the port resides is recalculated.
Precautions
If the path cost calculation standard is changed using the stp pathcost-standard command, the path cost set using the stp cost command is restored to the default value.