How do I configure the path cost of an STP port on an S series switch

2

To configure the path cost of an STP port on an S (except the S1700) or E series switch, run the following commands:
Run the stp cost command in the interface view.
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] stp cost 10000
For other configuration commands, visit "Common STP/RSTP Operations" in Common Operation Guide to view the related document.
Common STP/RSTP operations are the same for all switch models.

Other related questions:
How can I configure the path cost of an interface on a CE switch running STP/MSTP
Path costs determine root interface selection during spanning tree calculation. In a spanning tree, the interface with the lowest path cost to the root bridge is selected as a root interface.

You can run the stp [ process process-id ] [ instance instance-id ] cost cost command in the interface view to configure the path cost of an interface. It is recommended that the path cost of an interface be set smaller within the specified range if the rate of the link on the interface is greater.

# Set the path cost of 10GE1/0/1 to 200.
system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] stp cost 200
[*HUAWEI-10GE1/0/1] commit Description: 
The path cost of an interface is related to the algorithm for calculating path costs. If the path cost calculation algorithm is changed using the stp pathcost-standard command, the interface path cost configured through this command will be restored to the default value.

Globally configure STP on the S1728GWR-4P switch
Configure STP on an S1728GWR-4P switch globally as follows: 1. Choose Spanning Tree > STP. 2. Select Configure Global from the Step drop-down list box. 3. Select Configure from the Action drop-down list box. 4. Configure the parameters such as Spanning Tree Status, Spanning Tree Type, Priority, and Path Cost Method. 5. Click Apply.

How to prevent network flapping caused by changes of Eth-Trunk member interfaces on CE switches
The path cost of Eth-Trunks change when Eth-Trunk member interfaces go Up or Down. In this case, STP recalculates the path cost and spanning tree, causing network topology changes and network flapping. You can run the stp [ process process-id ] [ instance instance-id ] cost cost command in the Eth-Trunk interface view to set the path cost of Eth-Trunks to a fixed value. In this way, the changes of Eth-Trunk member interfaces do not affect the path cost, preventing network topology changes. For example, set the path cost of Eth-Trunk 1 to 200. system-view [~HUAWEI] interface eth-trunk 1 [*HUAWEI-Eth-Trunk1] stp cost 200 [*HUAWEI-Eth-Trunk1] commit

OSPF cost of S series switches
The ospf cost command can be executed on an S series switch that supports OSPF to configure the cost required for running the OSPF protocol on an interface. Application scenario: The interface cost can be automatically calculated by OSPF based on the interface bandwidth or manually configured by using the ospf cost command. If the costs and destination IP addresses of multiple routes discovered by one routing protocol are the same, load balancing can be implemented among the routes. Modify interface costs to implement load balancing as required. Configuration impact: If no interface cost is configured by using the ospf cost command, OSPF automatically calculates the interface cost based on the interface bandwidth. The calculation formula is as follows: Cost of the interface = Bandwidth reference value/Interface bandwidth. The integer of the calculated result is the cost of the interface. If the calculated result is smaller than 1, the cost value is 1. Changing the bandwidth reference value can change the cost of an interface. By default, the bandwidth reference value is 100 Mbit/s. Therefore, the default cost value of an Ethernet (100 Mbit/s) interface is 1 (100,000,000/the interface bandwidth). Example: Set the cost required by VLANIF 100 for running OSPF to 65. [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] ospf cost 65 Set the cost required by GE0/0/1 for running OSPF to 65. [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] undo portswitch [HUAWEI-GigabitEthernet0/0/1] ospf cost 65 Note: The cost calculated by OSPF is the cost of the route to the outbound interface of the destination network.

Display global STP configuration of the S1728GWR-4P switch
Display the global STP configuration of an S1728GWR-4P switch as follows: 1. Choose Spanning Tree > STP. 2. Select Configure Global from the Step drop-down list box. 3. Select Show Information from the Action drop-down list box. 4. The configured parameters (such as Spanning Tree Status, Spanning Tree Type, Designated Root, Root Path Cost, and Bridge ID) are displayed.

If you have more questions, you can seek help from following ways:
To iKnow To Live Chat
Scroll to top