stp root
Function
The stp root command configures a switching device as a root bridge or secondary root bridge of a spanning tree.
The undo stp root command cancels the configuration.
By default, a switching device does not function as the root bridge or secondary root bridge of a spanning tree.
Format
stp [ instance instance-id ] root { primary | secondary }
undo stp [ instance instance-id ] root
Parameters
Parameter | Description | Value |
---|---|---|
instance instance-id | Specifies the ID of a spanning tree instance. If the parameter instance instance-id is not specified, the configuration takes effect on a CIST instance. |
The value is an integer ranging from 0 to 4094. Value 0 refers to CIST. |
primary | Indicates that the switching device functions as the root bridge of a spanning tree. | - |
secondary | Indicates that the switching device functions as the secondary root bridge of a spanning tree. | - |
Usage Guidelines
Usage Scenario
On an STP/RSTP/MSTP network, each spanning tree has only one root bridge, which is responsible for sending BPDUs. Owning to the importance of the root bridge, the switching device with high performance and network hierarchy is generally chosen as a root bridge. The priority of such a device, however, may be not that high. Therefore, setting a high priority for the switching device is necessary so that the device can function as a root bridge.
To ensure nonstop traffic transmission, run the stp root command to configure the switching device as the secondary root bridge. When the root bridge is faulty or is powered off, the secondary root bridge becomes the root bridge during spanning tree calculation.
After the stp root primary command is run to set a switching device to be the primary root bridge, the priority value of the switching device is 0 in the spanning tree and the priority cannot be modified.
The secondary root bridge specified using the stp root secondary command has the priority value of 4096 and the priority cannot be modified.
Precautions
A spanning tree has only one root bridge.
A switching device in a spanning tree cannot function both as the primary root bridge and as the secondary root bridge.
If multiple secondary root bridges are set in a spanning tree, the one with the smallest MAC address functions as the secondary root bridge of the spanning tree.