STP
STP View
Section titled “STP View”Table 1 STP View
| Command | Purpose |
|---|---|
| show mstp bridge | Display 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 mstconfid | Display summary information about the MST domain configuration currently in effect. |
| show mstp status | Display status of MSTP. |
| show mstp tree instance-id | Display MSTI status of the specified MSTP instance. |
| show mstp treeport {ethernet|link-aggregation} interface_name instance instance-id | Displays MSTI port status details. |
show mstp bridge
Section titled “show mstp bridge”[Command]
show mstp bridge
[Purpose]
Display MSTI status.
[View]
Privileged User View
[Use Cases]
sonic# show mstp bridgeBridge 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 PortChannel0111show mstp brief [{ethernet|link-aggregation} interface_name]
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]
| Parameter | Description |
|---|---|
| interface_name | interface name |
[View]
Privileged User View
[Use Cases]
sonic# show mstp briefport 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:6Dlag111 Bridge no no 8.003 no discarding Disabled 8.000.60:EB:5A:01:06:6D 0 8.000.60:EB:5A:01:06:6Dshow mstp interface [{ethernet|link-aggregation} interface_name]
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]
| Parameter | Description |
|---|---|
| interface_name | interface name |
[View]
Privileged User View
[Use Cases]
sonic# show mstp interfaceBridge: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 noshow mstp mstconfid
Section titled “show mstp mstconfid”[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 mstconfidBridge MST Configuration Identifier: Format Selector: 0 Configuration Name: test Revision Level: 0 Configuration Digest: F3B784B6F462AE5FE28E6578DBF77D2Eshow mstp status
Section titled “show mstp status”[Command]
show mstp status
[Purpose]
Display status of MSTP.
[View]
Privileged User View
[Use Cases]
sonic# show mstp statusrole Flags: Root - Root, Desg - Designated, Altn - Alternate, Back - Backup, Mstr - Master, Disa - Disabledstate Flags: disc - Discard/Blocking/Listening, lear - Learning, forw - ForwardingSpanning-tree Mode: mstpvlan mst instance port_role_state------- -------------- -------------------------------------------------------vlan10 0 lag5(Desg)(forw) lag9(Desg)(forw)vlan20 0show mstp tree instance-id
Section titled “show mstp tree instance-id”[Command]
show mstp tree instance-id
[Purpose]
Display MSTI status of the specified MSTP instance.
[Parameters]
| Parameter | Description |
|---|---|
| instance-id | MSTP instance ID. |
[View]
Privileged User View
[Use Cases]
sonic# show mstp tree 0Bridge 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 PortChannel0111sonic# show mstp tree 1Bridge 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 PortChannel0111show mstp treeport {ethernet|link-aggregation} interface_name instance instance-id
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]
| Parameter | Description |
|---|---|
| interface_name | interface name |
| instance-id | MSTP instance ID |
[View]
Privileged User View
[Use Cases]
sonic# show mstp treeport ethernet 0/64 instance 1Bridge: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.00Asonic# show mstp treeport ethernet 0/64 instance 3Bridge: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.004STP Config
Section titled “STP Config”Table 2 STP Config
| Command | Purpose |
|---|---|
| bridge mac HH:HH:HH:HH:HH:HH | Configure Bridge MAC address. |
| mstp enable | Enable MSTP globally. |
| mstp {forward_delay|hello|max_age|name} value | Set the attributes of MSTP. |
| mstp cost interface {ethernet|link-aggregation} interface_name cost_value | Set the external path cost. |
| mstp instance instance-id | Create a MSTP instance and enter MSTP Instance Configuration View. |
| priority priority | Set the priority of the MSTP instance. |
| interface priority priority interface {ethernet|link-aggregation} interface_name | Set 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_value | Set the internal path csot of the instance. |
| mstp auto-edge enable interface {ethernet|link-aggregation} interface_name | Enable MSTP auto edge for the interface. |
| mstp edge-port enable interface {ethernet|link-aggregation} interface_name | Enable MSTP manual edge for the interface. |
| mstp bpdu-filter enable interface {ethernet|link-aggregation} interface_name | Enable BPDU filtering for the interface. |
| mstp bpdu-guard enable interface {ethernet|link-aggregation} interface_name | Enable BPDU guard for the interface. |
bridge mac HH:HH:HH:HH:HH:HH
Section titled “bridge mac HH:HH:HH:HH:HH:HH”[Command]
bridge mac HH:HH:HH:HH:HH:HH
[Purpose]
Configure Bridge MAC address.
[Parameters]
| Parameter | Description |
|---|---|
| HH:HH:HH:HH:HH:HH | MAC 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:88mstp enable
Section titled “mstp enable”[Command]
mstp enable
[Purpose]
Enable MSTP globally.
[View]
Global Configuration View
[Notes]
Run command mstpdisable to disable MSTP.
[Use Cases]
sonic(config)# mstp enablemstp {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]
| Parameter | Description |
|---|---|
| forward_delay | Specify the port state changing time in seconds. The range is [4,30], and the default is 15. |
| hello | Specify the interval of sending BPDUs in seconds. The range is [1,10], and the default is 2. |
| max_age | Specify the maximum aging value in seconds. The range is [10,1000000], and the default is 20. |
| name | Specify the domain name of the Bridge in string form. |
| value | The 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 5sonic(config)# mstp name region1mstp cost interface {ethernet|link-aggregation} interface_name cost_value
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]
| Parameter | Description |
|---|---|
| interface_name | Interface name (eg.0/1) |
| cost_value | Specify 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 10mstp instance instance-id
Section titled “mstp instance instance-id”[Command]
mstp instance instance-id
[Purpose]
Create a MSTP instance and enter MSTP Instance Configuration View.
[Parameters]
| Parameter | Description |
|---|---|
| instance-id | MSTP 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 2sonic(config-mstp-instance-2)#priority priority
Section titled “priority priority”[Command]
priority priority
[Purpose]
Set the priority of the MSTP instance.
[Parameters]
| Parameter | Description |
|---|---|
| priority | Specify 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 2sonic(config-mstp-instance-2)# priority 1interface priority priority interface {ethernet|link-aggregation} interface_name
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]
| Parameter | Description |
|---|---|
| priority | Specify 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 2sonic(config-mstp-instance-2)# interface priority 1 interface ethernet 0/0vlan vlan-id
Section titled “vlan vlan-id”[Command]
vlan vlan-id
[Purpose]
Bind the VLAN to the MSTP instance.
[Parameters]
| Parameter | Description |
|---|---|
| vlan-id | VLAN 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 2sonic(config-mstp-instance-2)# vlan 100cost interface {ethernet|link-aggregation} interface_name cost_value
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]
| Parameter | Description |
|---|---|
| interface_name | Interface name (eg.0/1) |
| cost_value | Specify 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 0sonic(config-mstp-instance-0)# cost interface ethernet 0/0 10mstp auto-edge enable interface {ethernet|link-aggregation} interface_name
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]
| Parameter | Description |
|---|---|
| interface_name | Interface 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 99mstp edge-port enable interface {ethernet|link-aggregation} interface_name
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]
| Parameter | Description |
|---|---|
| interface_name | Interface 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 99mstp bpdu-filter enable interface {ethernet|link-aggregation} interface_name
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]
| Parameter | Description |
|---|---|
| interface_name | Interface 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 99mstp bpdu-guard enable interface {ethernet|link-aggregation} interface_name
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]
| Parameter | Description |
|---|---|
| interface_name | Interface 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