(Optional) Setting the Path Cost for a Port
Context
A path cost is port-specific and is used by VBST to select a link. A port in different VLANs may have different path costs on a network running VBST. Traffic from different VLANs is forwarded through different physical links by setting a proper path cost enable, therefore implementing VLAN-based load balancing.
- dot1d-1998: IEEE 802.1d standard is used to calculate the path cost.
- dot1t: IEEE 802.1T standard is used to calculate the path cost.
- legacy: Huawei calculation method is used to calculate the path cost.
After the calculation method is determined, the path cost of a port can be set. Generally, a higher path cost indicates higher probability of a port to be blocked. If the link rate of a port is small, you are advised to set a large path cost so that the port is selected as the blocking port during spanning tree calculation and its link is blocked.
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, IEEE 802.1T standard is used to calculate the path cost.
All switches on the same network must use the same path cost calculation method.
- Run interface interface-type interface-number
The view of the Ethernet interface that participates in spanning tree calculation is displayed.
- Run stp vlan vlan-id [ to vlan-id ] [ vlan-id [ to vlan-id ] ] &<1-9> cost cost
The path cost of the port in each VLAN is set.
- If Huawei calculation method is used, the path cost ranges from 1 to 200000.
- If IEEE 802.1D standard is used, the path cost ranges from 1 to 65535.
- If IEEE 802.1T standard is used, the path cost ranges from 1 to 200000000.
- Run commit
The configuration is committed.