Configuring path costs of ports

When the path cost of a port changes, the system recalculates the role of the port and initiates a state transition.

To configure the path cost of a port:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter Layer 2 Ethernet or aggregate interface view.

interface interface-type interface-number

N/A

3. Configure the path cost of the ports.

  • In STP/RSTP mode:stp cost cost

  • In PVST mode:stp vlan vlan-id-list cost cost

  • In MSTP mode:stp [ instance instance-list ] cost cost

By default, the system automatically calculates the path cost of each port.