(Optional) Configuring a Path Cost of a Port in an MSTI
Context
A path cost is port-specific and is used by MSTP to select a link.
Path costs of ports are an important metric used in spanning tree calculation and determine root port selection in an MSTI. The port with the lowest path cost to the root bridge is selected as the root port. Setting different path costs for a port in different MSTIs allows VLAN traffic to be transmitted along different physical links for load balancing.
If loops occur on a network, it is recommended that you set a large path cost for ports with low link rates.
Procedure
- Run:
system-view
The system view is displayed.
- Run:
stp pathcost-standard { dot1d-1998 | dot1t | legacy }
A path cost calculation method is configured.
By default, the IEEE 802.1t standard (dot1t) is used to calculate the path cost.
All switches on a network must use the same path cost calculation method.
- Run:
interface interface-type interface-number
The Ethernet interface view is displayed.
- Run:
stp instance instance-id cost cost
A path cost is set for the port in the current MSTI.
- When the Huawei calculation method is used, cost ranges from 1 to 200000.
- When the IEEE 802.1d standard method is used, cost ranges from 1 to 65535.
- When the IEEE 802.1t standard method is used, cost ranges from 1 to 200000000.