Command Line Reference
Layer 2 Configuration
STP
31 min
stp view stp view table 1 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 show mstp bridge \[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 show mstp brief \[{ethernet|link aggregation} 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 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 show mstp interface \[{ethernet|link aggregation} 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 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 show mstp mstconfid 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 mstconfid bridge mst configuration identifier format selector 0 configuration name test revision level 0 configuration digest f3b784b6f462ae5fe28e6578dbf77d2e show mstp status show mstp status \[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 show mstp tree 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 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 show mstp treeport {ethernet|link aggregation} 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 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 stp config stp config table 2 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 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 88 mstp enable 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 enable mstp {forward delay|hello|max age|name} 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 5 sonic(config)# mstp name region1 mstp cost interface {ethernet|link aggregation} 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 10 mstp instance 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 2 sonic(config mstp instance 2)# priority 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 2 sonic(config mstp instance 2)# priority 1 interface priority 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 2 sonic(config mstp instance 2)# interface priority 1 interface ethernet 0/0 vlan vlan vlan id (mstp instance configuration view) \[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 2 sonic(config mstp instance 2)# vlan 100 cost interface {ethernet|link aggregation} 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 0 sonic(config mstp instance 0)# cost interface ethernet 0/0 10 mstp auto edge enable interface {ethernet|link aggregation} 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 99 mstp edge port enable interface {ethernet|link aggregation} 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 99 mstp bpdu filter enable interface {ethernet|link aggregation} 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 99 mstp bpdu guard enable interface {ethernet|link aggregation} 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
