73To do… Use the command… RemarksConfigure the path cost of the ports• In STP/RSTP mode:stp cost cost• In PVST mode:stp vlan vlan-list cost cost• In MSTP mode:stp [ instance instance-id ] cost costRequiredUse one of the commands.By default, the systemautomatically calculates thepath cost of each port.NOTE:When the path cost of a port changes, the system re-calculates the role of the port and initiates a statetransition.Configuration example# In MSTP mode, specify the device to use IEEE 802.1d-1998 to calculate the default path costs of its ports,and set the path cost of GigabitEthernet 1/0/3 to 200 on MSTI 2. system-view[Sysname] stp pathcost-standard dot1d-1998[Sysname] interface gigabitethernet 1/0/3[Sysname-GigabitEthernet1/0/3] stp instance 2 cost 200# In PVST mode, specify the device to use IEEE 802.1d-1998 to calculate the default path costs of its ports,and set the path cost of GigabitEthernet 1/0/3 to 2000 on VLANs 20 through 30. system-view[Sysname] stp mode pvst[Sysname] stp pathcost-standard dot1d-1998[Sysname] interface gigabitethernet 1/0/3[Sysname-GigabitEthernet1/0/3] stp vlan 20 to 30 cost 2000Configuring the port priorityThe priority of a port is an important factor in determining whether the port can be elected as the rootport of a device. If all other conditions are the same, the port with the highest priority will be elected asthe root port.On a spanning tree device, a port can have different priorities and play different roles in differentspanning trees, so that data of different VLANs can be propagated along different physical paths,implementing per-VLAN load balancing. You can set port priority values based on the actual networkingrequirements.Follow these steps to configure the priority of a port or a group of ports:To do… Use the command… RemarksEnter system view system-view —Enter interface view or portgroup view• Enter Ethernet interface view or Layer 2aggregate interface view:interface interface-type interface-number• Enter port group view:port-group manual port-group-nameRequiredUse one of the commands.