# spanning-tree mst root

## Command Name

spanning-tree mst

## Synopsis

This **spanning-tree mst** command configures a network switch to become the primary or secondary root bridge for a specified Multiple Spanning Tree (MST) instance.

## Description

The spanning-tree mst command with the <mark style="color:blue;">`root`</mark> option is used to designate a switch as either the primary or secondary root bridge within a specific Multiple Spanning Tree Protocol (MSTP) instance. MSTP allows for multiple spanning tree instances within a network, each potentially having its own root bridge. Setting a switch as the primary root bridge aims to make it the preferred bridge for that MST instance. Setting it as the secondary root bridge establishes it as a backup, should the primary become unavailable.

## Syntax

<mark style="color:blue;">**`spanning-tree mst {instance-id <instance-id(1-16)>} root {primary | secondary}`**</mark>

## Parameters

* **`instance-id <instance-id(1-16)>`**: Specifies the MST instance for which the switch is to be configured as primary or secondary root.
* **`root {primary | secondary}`**: Designates the switch as the primary or secondary root bridge for the specified MST instance.

## Options

* **`instance-id`**: Identifies the MST instance.
* **`root`**: Determines the root bridge role (primary or secondary).

## Examples

* **Configure a switch as the primary root for an MST instance:**

  ```markup
  spanning-tree mst instance-id 2 root primary

  ```
* **Set a switch as the secondary root for an MST instance:**

  ```markup
  spanning-tree mst instance-id 3 root secondary

  ```

## Command Mode

Global Configuration Mode

***

## **Summary**

Configuring a switch as the primary or secondary root bridge in MST is crucial for optimal network performance and redundancy. The primary root bridge acts as the focal point for that MST instance, handling all path selections and spanning tree calculations. The secondary root bridge serves as a backup, ready to take over should the primary fail. This role designation ensures efficient traffic flow and enhances network stability and resilience. It's particularly important in complex networks where different segments or VLANs may require distinct spanning trees to optimize traffic paths and reduce congestion.
