Skip to content
Ask AI

STP

Table 1 STP View

CommandPurpose
show mstp bridgeDisplay MSTI status.
show mstp brief [{ethernet|link-aggregation} interface_name]Display information about the port status in CIST.
show mstp interface [{ethernet|link-aggregation} interface_name]Display detailed information about the status of the ports in CIST.
show mstp mstconfidDisplay summary information about the MST domain configuration currently in effect.
show mstp statusDisplay status of MSTP.
show mstp tree instance-idDisplay MSTI status of the specified MSTP instance.
show mstp treeport {ethernet|link-aggregation} interface_name instance instance-idDisplays MSTI port status details.

[Command]

show mstp bridge

[Purpose]

Display MSTI status.

[View]

Privileged User View

[Use Cases]

sonic# show mstp bridge
Bridge CIST info
enabled yes
bridge id 8.000.00:00:01:02:03:04
designated root 8.000.00:00:01:02:03:04
regional root 8.000.00:00:01:02:03:04
root port none
path cost 0 internal path cost 0
max age 20 bridge max age 20
forward delay 15 bridge forward delay 15
tx hold count 6 max hops 20
hello time 2 ageing time 300
force protocol version mstp
time since topology change 2497
topology change count 9
topology change no
topology change port Ethernet64
last topology change port PortChannel0111
Section titled “show mstp brief [{ethernet|link-aggregation} interface_name]”

[Command]

show mstp brief [{ethernet|link-aggregation} interface_name]

[Purpose]

Display information about the status of ports in CIST.

[Parameters]

ParameterDescription
interface_nameinterface name

[View]

Privileged User View

[Use Cases]

sonic# show mstp brief
port bridge point-to-point oper-edge-port port-id enabled state role designated-bridge designated-port designated-root
--------------- -------- ---------------- ---------------- --------- --------- ---------- ---------- ----------------------- ----------------- -----------------------
0/8 Bridge yes yes 8.002 yes forwarding Designated 8.000.60:EB:5A:01:06:6D 8.002 8.000.60:EB:5A:01:06:6D
lag111 Bridge no no 8.003 no discarding Disabled 8.000.60:EB:5A:01:06:6D 0 8.000.60:EB:5A:01:06:6D
Section titled “show mstp interface [{ethernet|link-aggregation} interface_name]”

[Command]

show mstp interface [{ethernet|link-aggregation} interface_name]

[Purpose]

Display detailed information about the status of the ports in CIST.

[Parameters]

ParameterDescription
interface_nameinterface name

[View]

Privileged User View

[Use Cases]

sonic# show mstp interface
Bridge:0/2 CIST info
enabled no role Disabled
port id 8.006 state discarding
external port cost 200000000 admin external cost 0
internal port cost 200000000 admin internal cost 0
designated root 8.000.60:EB:5A:01:10:C9 dsgn external cost 0
dsgn regional root 8.000.60:EB:5A:01:10:C9 dsgn internal cost 0
designated bridge 8.000.60:EB:5A:01:10:C9 designated port 0.000
admin edge port no auto edge port yes
oper edge port no topology change ack no
point-to-point no admin point-to-point auto
restricted role no restricted TCN no
port hello time 2 disputed no
bpdu guard port no bpdu guard error no
network port no BA inconsistent no
bpdu filter port no Num RX BPDU Filtered 0
Num TX BPDU 0 Num TX TCN 0
Num RX BPDU 0 Num RX TCN 0
Num Transition FWD 0 Num Transition BLK 1
Rcvd BPDU no Rcvd STP no
Rcvd RSTP no Send RSTP yes
Rcvd TC Ack no Rcvd TCN no

[Command]

show mstp mstconfid

[Purpose]

Display summary information about the MST domain configuration currently in effect.

[View]

Privileged User View

[Use Cases]

sonic# show mstp mstconfid
Bridge MST Configuration Identifier:
Format Selector: 0
Configuration Name: test
Revision Level: 0
Configuration Digest: F3B784B6F462AE5FE28E6578DBF77D2E

[Command]

show mstp status

[Purpose]

Display status of MSTP.

[View]

Privileged User View

[Use Cases]

sonic# show mstp status
role Flags: Root - Root, Desg - Designated, Altn - Alternate, Back - Backup, Mstr - Master, Disa - Disabled
state Flags: disc - Discard/Blocking/Listening, lear - Learning, forw - Forwarding
Spanning-tree Mode: mstp
vlan mst instance port_role_state
------- -------------- -------------------------------------------------------
vlan10 0 lag5(Desg)(forw) lag9(Desg)(forw)
vlan20 0

[Command]

show mstp tree instance-id

[Purpose]

Display MSTI status of the specified MSTP instance.

[Parameters]

ParameterDescription
instance-idMSTP instance ID.

[View]

Privileged User View

[Use Cases]

sonic# show mstp tree 0
Bridge MSTI 0 info
bridge id 8.000.00:00:01:02:03:04
regional root 8.000.00:00:01:02:03:04
root port none
internal path cost 0
time since topology change 2560
topology change count 9
topology change no
topology change port Ethernet64
last topology change port PortChannel0111
sonic# show mstp tree 1
Bridge MSTI 1 info
bridge id 8.001.00:00:01:02:03:04
regional root 8.001.00:00:01:02:03:04
root port none
internal path cost 0
time since topology change 2563
topology change count 9
topology change no
topology change port Ethernet64
last topology change port PortChannel0111
Section titled “show mstp treeport {ethernet|link-aggregation} interface_name instance instance-id”

[Command]

show mstp treeport {ethernet|link-aggregation} interface_name instance instance-id

[Purpose]

Displays MSTI port status details.

[Parameters]

ParameterDescription
interface_nameinterface name
instance-idMSTP instance ID

[View]

Privileged User View

[Use Cases]

sonic# show mstp treeport ethernet 0/64 instance 1
Bridge:0/64 MSTI 1 info
role Designated port id 8.00A
state forwarding disputed no
internal port cost 200 admin internal cost 0
dsgn regional root 8.001.00:00:01:02:03:04 dsgn internal cost 0
designated bridge 8.001.00:00:01:02:03:04 designated port 8.00A
sonic# show mstp treeport ethernet 0/64 instance 3
Bridge:0/64 MSTI 3 info
role Root port id 8.00A
state forwarding disputed no
internal port cost 200 admin internal cost 0
dsgn regional root 0.003.60:EB:5A:01:14:CC dsgn internal cost 0
designated bridge 0.003.60:EB:5A:01:14:CC designated port 8.004

Table 2 STP Config

CommandPurpose
bridge mac HH:HH:HH:HH:HH:HHConfigure Bridge MAC address.
mstp enableEnable MSTP globally.
mstp {forward_delay|hello|max_age|name} valueSet the attributes of MSTP.
mstp cost interface {ethernet|link-aggregation} interface_name cost_valueSet the external path cost.
mstp instance instance-idCreate a MSTP instance and enter MSTP Instance Configuration View.
priority prioritySet the priority of the MSTP instance.
interface priority priority interface {ethernet|link-aggregation} interface_nameSet the interface priority of all member ports under the MSTP instance.
vlan vlan-id (MSTP Instance Configuration View)Bind the VLAN to the MSTP instance.
mstp cost interface {ethernet|link-aggregation} interface_name cost_valueSet the internal path csot of the instance.
mstp auto-edge enable interface {ethernet|link-aggregation} interface_nameEnable MSTP auto edge for the interface.
mstp edge-port enable interface {ethernet|link-aggregation} interface_nameEnable MSTP manual edge for the interface.
mstp bpdu-filter enable interface {ethernet|link-aggregation} interface_nameEnable BPDU filtering for the interface.
mstp bpdu-guard enable interface {ethernet|link-aggregation} interface_nameEnable BPDU guard for the interface.

[Command]

bridge mac HH:HH:HH:HH:HH:HH

[Purpose]

Configure Bridge MAC address.

[Parameters]

ParameterDescription
HH:HH:HH:HH:HH:HHMAC address.

[View]

Global Configuration View

[Notes]

The default is the MAC of the switch; Run command no bridge mac to restore the Bridge MAC address to default.

[Use Cases]

sonic(config)# bridge mac 00:44:55:66:77:88

[Command]

mstp enable

[Purpose]

Enable MSTP globally.

[View]

Global Configuration View

[Notes]

Run command mstpdisable to disable MSTP.

[Use Cases]

sonic(config)# mstp enable

mstp {forward_delay|hello|max_age|name} value

Section titled “mstp {forward_delay|hello|max_age|name} value”

[Command]

mstp {forward_delay|hello|max_age|name} value

[Purpose]

Set the attributes of MSTP.

[Parameters]

ParameterDescription
forward_delaySpecify the port state changing time in seconds. The range is [4,30], and the default is 15.
helloSpecify the interval of sending BPDUs in seconds. The range is [1,10], and the default is 2.
max_ageSpecify the maximum aging value in seconds. The range is [10,1000000], and the default is 20.
nameSpecify the domain name of the Bridge in string form.
valueThe value of the attribute.

[View]

Global Configuration View

[Notes]

MSTP should be enabled before configuration. Run command no mstp {forward_delay|hello|max_age|name} to restore to default configuration.

[Use Cases]

sonic(config)# mstp hello 5
sonic(config)# mstp name region1
Section titled “mstp cost interface {ethernet|link-aggregation} interface_name cost_value”

[Command]

mstp cost interface {ethernet|link-aggregation} interface_name cost_value

[Purpose]

Set the external path cost.

[Parameters]

ParameterDescription
interface_nameInterface name (eg.0/1)
cost_valueSpecify the cost, and the range is [1,200000000]

[View]

Global Configuration View

[Notes]

MSTP should be enabled before configuration. The default cost can be calculated as: cost = 200000000 / link speed (in 100Kbps). Run command no mstp cost interface {ethernet|link-aggregation} interface_name to restore to default cost.

[Use Cases]

sonic(config)# mstp cost interface ethernet 0/0 10

[Command]

mstp instance instance-id

[Purpose]

Create a MSTP instance and enter MSTP Instance Configuration View.

[Parameters]

ParameterDescription
instance-idMSTP instance ID, the range is [0,63].

[View]

Global Configuration View

[Notes]

MSTP should be enabled before configuration. Instance 0 is the default instance, cannot be created or deleted. Run command no mstp instance instance-id to delete MSTP instance.

[Use Cases]

sonic(config)# mstp instance 2
sonic(config-mstp-instance-2)#

[Command]

priority priority

[Purpose]

Set the priority of the MSTP instance.

[Parameters]

ParameterDescription
prioritySpecify the priority of the instance, the range is [0,15]. The default is 8. The smaller the value, the higher the priority.

[View]

MSTP Instance Configuration View

[Notes]

MSTP should be enabled before configuration. Run command no priority to restore to default priority.

[Use Cases]

sonic(config)# mstp instance 2
sonic(config-mstp-instance-2)# priority 1
Section titled “interface priority priority interface {ethernet|link-aggregation} interface_name”

[Command]

interface priority priority interface {ethernet|link-aggregation} interface_name

[Purpose]

Set the interface priority under the MSTP instance.

[Parameters]

ParameterDescription
prioritySpecify the priority of the interfaces, the range is [0,15]. The default is 8. The smaller the value, the higher the priority.

[View]

MSTP Instance Configuration View

[Notes]

MSTP should be enabled before configuration. Run command no interface priority interface {ethernet|link-aggregation} interface_name to restore to default priority.

[Use Cases]

sonic(config)# mstp instance 2
sonic(config-mstp-instance-2)# interface priority 1 interface ethernet 0/0

[Command]

vlan vlan-id

[Purpose]

Bind the VLAN to the MSTP instance.

[Parameters]

ParameterDescription
vlan-idVLAN ID, the range is [1,4094].

[View]

MSTP Instance Configuration View

[Notes]

MSTP should be enabled before configuration. Run command no vlan vlan-id to unbind the VLAN from the MSTP instance.

[Use Cases]

sonic(config)# mstp instance 2
sonic(config-mstp-instance-2)# vlan 100
Section titled “cost interface {ethernet|link-aggregation} interface_name cost_value”

[Command]

cost interface {ethernet|link-aggregation} interface_name cost_value

[Purpose]

Set the internal path csot of the instance.

[Parameters]

ParameterDescription
interface_nameInterface name (eg.0/1)
cost_valueSpecify the cost, and the range is [1,200000000]

[View]

MSTP Instance Configuration View

[Notes]

MSTP should be enabled before configuration. The default cost can be calculated as: cost = 200000000 / link speed (in 100Kbps). Run command no cost interface {ethernet|link-aggregation} interface_nam to restore to default cost.

[Use Cases]

sonic(config)# mstp instance 0
sonic(config-mstp-instance-0)# cost interface ethernet 0/0 10
Section titled “mstp auto-edge enable interface {ethernet|link-aggregation} interface_name”

[Command]

mstpauto-edge enable interface {ethernet|link-aggregation} interface_name

[Purpose]

Enable MSTP auto edge for the interface.

[Parameters]

ParameterDescription
interface_nameInterface name (eg.0/1)

[View]

Global Configuration View

[Notes]

The auto-edge interface feature is enabled by default on all Layer 2 ports. An interface with auto-edge enabled does the following things when its state changes from down to up: waiting for 3 seconds and trying to receive BPDUs; If no BPDU is received, it becomes an edge port and will lose edge port role the first time it receives a BPDU thereafter. Run command mstp auto-edge disable interface {ethernet|link-aggregation} interface_name to disable auto edge port, after that, if you do not assign it as a manual edge port, it will lose edge port role.

[Use Cases]

sonic(config)# mstp auto-edge enable interface link-aggregation 99
Section titled “mstp edge-port enable interface {ethernet|link-aggregation} interface_name”

[Command]

mstp edge-port enable interface {ethernet|link-aggregation} interface_name

[Purpose]

Enable MSTP manual edge for the interface.

[Parameters]

ParameterDescription
interface_nameInterface name (eg.0/1)

[View]

Global Configuration View

[Notes]

Manual edge port is disabled by default on all Layer 2 ports. When a manual edge port is enabled on an interface, it immediately becomes an edge port until it receives a BPDU message. The priority of manual edge port configuration is higher than auto edge port, that is, when manual edge port is enabled, auto edge port configuration is invalid. Run command mstp edge-port disable interface {ethernet|link-aggregation} interface_name to disable MSTP manual edge port feature.

[Use Cases]

sonic(config)# mstp edge-port enable interface link-aggregation 99
Section titled “mstp bpdu-filter enable interface {ethernet|link-aggregation} interface_name”

[Command]

mstp bpdu-filter enable interface {ethernet|link-aggregation} interface_name

[Purpose]

Enable BPDU filtering for the interface.

[Parameters]

ParameterDescription
interface_nameInterface name (eg.0/1)

[View]

Global Configuration View

[Notes]

This command will enable MSTP at interface level and determines whether the interface participates in MSTP protocol operation. The interface to be operated should be a Layer 2 port, and MSTP should be enabled before configuration. By default, MSTP is enabled on all Layer 2 interfaces. After this function is enabled, the interface will not participate in MSTP protocol operation, and there will be a risk of loops, therefore, please take caution. Run command mstp bpdu-filter disable interface {ethernet|link-aggregation} interface_name to disable BPDU filtering.

[Use Cases]

sonic(config)# mstp bpdu-filter enable interface link-aggregation 99
Section titled “mstp bpdu-guard enable interface {ethernet|link-aggregation} interface_name”

[Command]

mstp bpdu-guard enable interface {ethernet|link-aggregation} interface_name

[Purpose]

Enable BPDU guard for the interface.

[Parameters]

ParameterDescription
interface_nameInterface name (eg.0/1)

[View]

Global Configuration View

[Notes]

When the interface is enabled with BPDU message protection, it will be admin down if received a BPDU. Run command mstp bpdu-guard disable interface {ethernet|link-aggregation} interface_name to disable BPDU guard.

[Use Cases]

sonic(config)# mstp bpdu-guard enable interface link-aggregation 99