03-Layer 2—LAN Switching Command Reference

HomeSupportResource CenterSwitchesH3C S6300 Switch SeriesH3C S6300 Switch SeriesTechnical DocumentsCommandCommand ReferencesH3C S6300 Switch Series Command References-Release 243x-6W10003-Layer 2—LAN Switching Command Reference
07-Spanning tree commands
Title Size Download
07-Spanning tree commands 220.41 KB

Spanning tree commands

active region-configuration

Use active region-configuration to activate your MST region configuration.

Syntax

active region-configuration

Views

MST region view

Predefined user roles

network-admin

Usage guidelines

When you configure MST region parameters, MSTP launches a new spanning tree calculation process that might cause network topology instability. This is most likely to occur when you configure the VLAN-to-instance mapping table. The launch occurs after you execute the active region-configuration command or the stp global enable command.

As a best practice, use the check region-configuration command to determine whether the MST region configurations to be activated are correct. Run this command only when they are correct.

Examples

# Map VLAN 2 to MSTI 1 and manually activate the MST region configuration.

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region] instance 1 vlan 2

[Sysname-mst-region] active region-configuration

Related commands

·     check region-configuration

·     instance

·     region-name

·     revision-level

·     stp global enable

·     vlan-mapping modulo

bpdu-drop any

Use bpdu-drop any to enable BPDU drop on a port.

Use undo bpdu-drop any to disable BPDU drop on a port.

Syntax

bpdu-drop any

undo bpdu-drop any

Default

BPDU drop is disabled on a port.

Views

Layer 2 Ethernet interface view

Predefined user roles

network-admin

Examples

# Enable BPDU drop on port Ten-GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] bpdu-drop any

check region-configuration

Use check region-configuration to display MST region pre-configuration information, including the region name, revision level, and VLAN-to-instance mapping settings.

Syntax

check region-configuration

Views

MST region view

Predefined user roles

network-admin

Usage guidelines

Spanning tree devices belong to the same MST region only when they are connected through a physical link and configured with the same details as follows:

·     Format selector (0 by default and not configurable).

·     MST region name.

·     MST region revision level.

·     VLAN-to-instance mapping entries in the MST region.

As a best practice, use this command to determine whether the MST region configurations to be activated are correct. Activate them only when they are correct.

Examples

# Display MST region pre-configurations.

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region] check region-configuration

 Admin Configuration

   Format selector      : 0

   Region name          : 001122334400

   Revision level       : 0

   Configuration digest : 0x3ab68794d602fdf43b21c0b37ac3bca8

 

   Instance  VLANs Mapped

   0         1, 3 to 4094

   15        2

Table 1 Command output

Field

Description

Format selector

Format selector of the MST region, which is 0 (not configurable).

Region name

MST region name.

Revision level

Revision level of the MST region.

Instance   VLANs Mapped

VLAN-to-instance mappings in the MST region.

 

Related commands

·     active region-configuration

·     instance

·     region-name

·     revision-level

·     vlan-mapping modulo

display stp

Use display stp to display spanning tree status and statistics. Based on the information, you can analyze and maintain the network topology or determine whether the spanning tree is working correctly.

Syntax

display stp [ instance instance-list | vlan vlan-id-list ] [ interface interface-list | slot slot-number ] [ brief ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

instance instance-list: Specifies a space-separated list of up to 10 MSTI items. Each item specifies an MSTI or a range of MSTIs in the form of instance-id1 [ to instance-id2 ]. The value for instance-id2 must be equal to or greater than the value for instance-id1. The value range for the instance-id argument is 0 to 4094, and the value 0 represents the CIST.

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094.

interface interface-list: Specifies a space-separated list of up to 10 interface items. Each item specifies an interface or a range of interfaces in the form of interface-type interface-number 1 [ to interface-type interface-number 2 ]. The interface number for interface-number 2 must be equal to or greater than the interface number for interface-number 1.

brief: Displays brief spanning tree status and statistics. If this keyword is not specified, the command displays the detailed spanning tree status and statistics.

slot slot-number: Specifies an IRF member device by its member ID. If this option is not specified on an IRF fabric, the command applies to all member devices.

Usage guidelines

In STP or RSTP mode, the command output is sorted by port name.

·     If you do not specify a port, this command applies to all ports.

·     If you specify a port list, this command applies to the specified ports.

In PVST mode, the command output is sorted by VLAN ID and by port name in each VLAN.

·     If you do not specify a VLAN or port, this command applies to all ports in all VLANs.

·     If you only specify a VLAN list but not a port, this command applies to all ports in the specified VLANs.

·     If you only specify a port list but not a VLAN, this command applies to the specified ports in all VLANs.

·     If you specify both a VLAN list and a port list, this command applies to the ports in the specified VLANs.

In MSTP mode, the command output is sorted by MSTI ID and by port name in each MSTI.

·     If you do not specify an MSTI or port, this command applies to all MSTIs on all ports.

·     If you specify an MSTI list but not a port, this command applies to all ports in the specified MSTIs.

·     If you specify a port list but not an MSTI, this command applies to all MSTIs on the specified ports.

·     If you specify both an MSTI list and a port list, this command applies to the specified ports in the specified MSTIs.

During network convergence, the most recent spanning tree information is not displayed.

Examples

# In MSTP mode, display the brief spanning tree status and statistics for MSTI 0 on ports Ten-GigabitEthernet 1/0/1 through Ten-GigabitEthernet 1/0/4.

<Sysname> display stp instance 0 interface ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/4 brief

 MST ID      Port                                      Role  STP State     Protection

 0           Ten-GigabitEthernet1/0/1                  ALTE  DISCARDING    LOOP

 0           Ten-GigabitEthernet1/0/2                  DESI  FORWARDING    NONE

 0           Ten-GigabitEthernet1/0/3                  DESI  FORWARDING    NONE

 0           Ten-GigabitEthernet1/0/4                  DESI  FORWARDING    NONE

# In PVST mode, display the brief spanning tree status and statistics for VLAN 2 on ports Ten-GigabitEthernet 1/0/1 through Ten-GigabitEthernet 1/0/4.

<Sysname> system-view

[Sysname] stp mode pvst

[Sysname] display stp vlan 2 interface ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/4 brief

 VLAN ID     Port                                      Role  STP State     Protection

 2           Ten-GigabitEthernet1/0/1                  ALTE  DISCARDING    LOOP

 2           Ten-GigabitEthernet1/0/2                  DESI  FORWARDING    NONE

 2           Ten-GigabitEthernet1/0/3                  DESI  FORWARDING    NONE

 2           Ten-GigabitEthernet1/0/4                  DESI  FORWARDING    NONE

Table 2 Command output

Field

Description

MST ID

MSTI ID in the MST region.

Port

Port name, corresponding to each MSTI or VLAN.

Role

Port role:

·     ALTE—The port is an alternate port.

·     BACK—The port is a backup port.

·     ROOT—The port is a root port.

·     DESI—The port is a designated port.

·     MAST—The port is a master port.

·     DISA—The port is disabled.

STP State

Spanning tree status on the port:

·     FORWARDING—The port can receive and send BPDUs and also forward user traffic.

·     DISCARDING—The port can receive and send BPDUs but cannot forward user traffic.

·     LEARNING—The port is in a transitional state. It can receive and send BPDUs but cannot forward user traffic.

Protection

Effective spanning tree protection feature on the port:

·     ROOT—Root guard.

·     LOOP—Loop guard.

·     BPDU—BPDU guard.

·     NONE—No spanning tree protection feature is configured, or the spanning tree protection is not triggered.

 

# In MSTP mode, display the detailed spanning tree status and statistics for all MSTIs on all ports.

<Sysname> display stp

-------[CIST Global Info][Mode MSTP]-------

 Bridge ID           : 32768.000f-e200-2200

 Bridge times        : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20

 Root ID/ERPC        : 0.00e0-fc0e-6554, 200200

 RegRoot ID/IRPC     : 32768.000f-e200-2200, 0

 RootPort ID         : 128.48

 BPDU-Protection     : Disabled

 Bridge Config-

 Digest-Snooping     : Disabled

 TC or TCN received  : 2

 Time since last TC  : 0 days 0h:5m:42s

 

----[Port153(Ten-GigabitEthernet1/0/1)][FORWARDING]----

 Port protocol       : Enabled

 Port role           : Designated Port (Boundary)

 Port ID             : 128.153

 Port cost(Legacy)   : Config=auto, Active=200

 Desg.bridge/port   : 32768.000f-e200-2200, 128.2

 Port edged          : Config=disabled, Active=disabled

 Point-to-Point      : Config=auto, Active=true

 Transmit limit      : 10 packets/hello-time

 TC-Restriction      : Disabled

 Role-Restriction    : Disabled

 Protection type     : Config=none, Active=none

 MST BPDU format     : Config=auto, Active=legacy

 Port Config-

 Digest-Snooping     : Disabled

 Rapid transition    : False

 Num of VLANs mapped : 1

 Port times          : Hello 2s MaxAge 20s FwdDelay 15s MsgAge 2s RemHops 20

 BPDU sent           : 186

          TCN: 0, Config: 0, RST: 0, MST: 186

 BPDU received       : 0

          TCN: 0, Config: 0, RST: 0, MST: 0

 

-------[MSTI 1 Global Info]-------

 Bridge ID         : 0.000f-e23e-9ca4

 RegRoot ID/IRPC   : 0.000f-e23e-9ca4, 0

 RootPort ID       : 0.0

 Root type         : Primary root

 Master bridge     : 32768.000f-e23e-9ca4

 Cost to master    : 0

 TC received       : 0

# In PVST mode, display the spanning tree status and statistics for all ports in all VLANs.

<Sysname> system-view

[Sysname] stp mode pvst

[Sysname] display stp

-------[VLAN 1 Global Info]-------

Protocol status     : Enabled

Bridge ID           : 32768.000f-e200-2200

Bridge times        : Hello 2s MaxAge 20s FwdDelay 15s

VlanRoot ID/RPC     : 0.00e0-fc0e-6554, 200200

RootPort ID         : 128.48

BPDU-Protection     : Disabled

TC or TCN received  : 2

Time since last TC  : 0 days 0h:5m:42s

 

 ----[Port1(Ethernet1/1)][FORWARDING]----

 Port protocol       : Enabled

 Port role           : Designated Port

 Port ID             : 128.153

 Port cost(Legacy)   : Config=auto, Active=200

 Desg. bridge/port   : 32768.000f-e200-2200, 128.2

 Port edged          : Config=disabled, Active=disabled

 Point-to-Point      : Config=auto, Active=true

 Transmit limit      : 10 packets/hello-time

 Protection type     : Config=none, Active=none

 Rapid transition    : False

 Port times          : Hello 2s MaxAge 20s FwdDelay 15s MsgAge 2s

 

-------[VLAN 2 Global Info]-------

Protocol status      : Enabled

Bridge ID            : 32768.000f-e200-2200

Bridge times         : Hello 2s MaxAge 20s FwDly 15s

VlanRoot ID/RPC      : 0.00e0-fc0e-6554, 200200

RootPort ID          : 128.48

BPDU-Protection      : Disabled

TC or TCN received   : 2

Time since last TC   : 0 days 0h:5m:42s

# In MSTP mode, display the spanning tree status and statistics when the spanning tree feature is disabled.

<Sysname> display stp

 Protocol status    : Disabled

 Protocol Std.      : IEEE 802.1s

 Version            : 3

 Bridge-Prio.  : 32768

 MAC address        : 000f-e200-8048

 Max age(s)         : 20

 Forward delay(s)   : 15

 Hello time(s)      : 2

 Max hops           : 20

 TC Snooping        : Disabled

# In PVST mode, display the spanning tree status and statistics when the spanning tree feature is disabled.

<Sysname> display stp

 Protocol status    : Disabled

 Protocol Std.      : IEEE 802.1w (pvst)

 Version            : 2

 Bridge-Prio.       : 32768

 MAC address        : 3822-d69f-0800

 Max age(s)         : 20

 Forward delay(s)   : 15

 Hello time(s)      : 2

 TC Snooping        : Disabled

Table 3 Command output

Field

Description

Bridge ID

Bridge ID, which contains the device's priority and MAC address. For example, in output 32768.000f-e200-2200, the value preceding the dot is the device's priority. The value following the dot is the device's MAC address.

Bridge times

Major parameters for the bridge:

·     Hello—Hello timer.

·     MaxAgeMaximum age timer.

·     FwdDelay—Forward delay timer.

·     MaxHopsMaximum hops within the MST region.

Root ID/ERPC

CIST root ID and external path cost (the path cost from the device to the CIST root).

RegRoot ID/IRPC

CIST regional root ID and internal path cost (the path cost from the device to the CIST regional root).

VlanRoot ID/RPC

VLAN root ID and root path cost (the path cost from the device to the VLAN root bridge).

RootPort ID

Root port ID. The value 0.0 indicates that the device is the root and there is no root port.

BPDU-Protection

Global status of the BPDU guard feature.

Bridge Config-

Digest-Snooping

Global status of Digest Snooping.

TC or TCN received

Number of TC/TCN BPDUs received in the MSTI or VLAN.

Time since last TC

Time since the latest topology change in the MSTI or VLAN.

[FORWARDING]

The port is in forwarding state.

[DISCARDING]

The port is in discarding state.

[LEARNING]

The port is in learning state.

Port protocol

Status of the spanning tree feature on the port.

Port role

Port role:

·     Alternate.

·     Backup.

·     Root.

·     Designated.

·     Master.

·     Disabled.

(Boundary)

The port is a regional boundary port.

Port cost(Legacy)

Path cost of the port. The field in parentheses indicates the standard (legacy, dot1d-1998, or dot1t) used for port path cost calculation.

·     Config—Configured value.

·     Active—Actual value.

Desg.bridge/port

Designated bridge ID and port ID of the port.

The port ID displayed is insignificant for a port which does not support port priority.

Port edged

The port is an edge port or non-edge port.

·     Config—Configured value.

·     Active—Actual value.

Point-to-Point

The port is connected to a point-to-point link or not.

·     Config—Configured value.

·     Active—Actual value.

Transmit limit

Number of BPDUs sent within each hello time.

Protection type

Whether spanning tree protection is configured on the port:

·     Config—Configured spanning tree protection feature.

·     ActiveEffective spanning tree protection feature.

Spanning tree protection features are as follows:

·     root—Root guard.

·     loop—Loop guard.

·     bpdu—BPDU guard.

·     none—No spanning tree protection feature is configured, or the spanning tree protection is not triggered.

TC-Restriction

Status of TC transmission restriction on the port.

Role-Restriction

Status of port role restriction on the port.

MST BPDU format

Format of the MST BPDUs that the port can send:

·     Config—Configured value (legacy or 802.1s).

·     Active—Actual value (legacy or 802.1s).

Port Config-

Digest-Snooping

Status of Digest Snooping on the port.

Rapid transition

Indicates whether the port rapidly transits to the forwarding state in the MSTI or VLAN.

Num of VLANs mapped

Number of VLANs that are mapped to the MSTI.

Port times

Major parameters for the port:

·     Hello—Hello timer.

·     MaxAgeMaximum age timer.

·     FwdDelay—Forward delay timer.

·     MsgAge—Message age timer.

·     RemHops—Remaining hops.

BPDU sent

Statistics on sent BPDUs.

BPDU received

Statistics on received BPDUs.

RegRoot ID/IRPC

MSTI regional root/internal path cost.

Root Type

MSTI root type:

·     Primary root.

·     Secondary root.

Master bridge

MSTI root bridge ID.

Cost to master

Path cost from the MSTI to the master bridge.

TC received

Number of received TC BPDUs.

Protocol status

Spanning tree protocol status.

Protocol Std.

Spanning tree protocol standard.

Version

Spanning tree protocol version.

Bridge-Prio.

·     In MSTP mode: Device's priority in the CIST.

·     In PVST mode: Device's priority in VLAN 1.

Max age(s)

Aging timer for BPDUs (in seconds, which is the same as the aging timer for VLAN 1 in PVST mode).

Forward delay(s)

Port state transition delay (in seconds, which is the same as the forward delay for VLAN 1 in PVST mode).

Hello time(s)

Interval for the root bridge to send BPDUs (in seconds, which is the same as the interval for VLAN 1 in PVST mode).

Max hops

Maximum hops in the MSTI.

TC Snooping

Status of TC Snooping, which can be Enabled or Disabled.

 

Related commands

reset stp

display stp abnormal-port

Use display stp abnormal-port to display history about ports that are blocked by spanning tree protection features.

Syntax

display stp abnormal-port

Views

Any view

Predefined user roles

network-admin

network-operator

Usage guidelines

In an MSTI or VLAN, this command can display a maximum of three history records for a blocked port.

Examples

# In MSTP mode, display history about ports that are blocked by spanning tree protection features.

<Sysname> display stp abnormal-port

---[Ten-GigabitEthernet1/0/1]---

    MST ID   BlockReason                     Time

    0        Loopback-Protected              07:56:44 02/01/2011

    0        Disputed                        07:56:37 02/01/2011

    0        Loop-Protected                  06:56:13 02/01/2011

# In PVST mode, display history about ports that are blocked by spanning tree protection features.

<Sysname> system-view

[Sysname] stp mode pvst

[Sysname] display stp abnormal-port

---[Ten-GigabitEthernet1/0/1]---

    VLAN ID  BlockReason                     Time

    1        Root-Protected                  14:49:17 04/15/2016

    1        Root-Protected                  14:49:15 04/15/2016

    1        Root-Protected                  14:49:12 04/15/2016

Table 4 Command output

Field

Description

MST ID

MSTI of the blocked port.

VLAN ID

VLAN of the blocked port.

Reason

Reason that the port was blocked:

·     Root-Protected—Root guard feature.

·     Loop-Protected—Loop guard feature.

·     Loopback-Protected—Self-loop protection. A port in the MSTI receives a BPDU that it sends.

·     Disputed—Dispute protection. A port receives a low-priority BPDU from a non-blocked designated port which is in forwarding or learning state.

·     InconsistentPortType-Protected—Inconsistent port type protection.

·     InconsistentPvid-Protected—Inconsistent PVID protection.

Time

Time when spanning tree protection was triggered.

 

 

display stp bpdu-statistics

Use display stp bpdu-statistics to display the BPDU statistics on ports.

Syntax

display stp bpdu-statistics [ interface interface-type interface-number [ instance instance-list ] ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

interface interface-type interface-number: Specifies an interface by its type and number.

instance instance-list: Specifies a space-separated list of up to 10 MSTI items. Each item specifies an MSTI or a range of MSTIs in the form of instance-id1 [ to instance-id2 ]. The value for instance-id2 must be equal to or greater than the value for instance-id1. The value range for the instance-id argument is 0 to 4094, and the value 0 represents the CIST.

Usage guidelines

In MSTP mode, the command output is sorted by port name and by MSTI ID on each port.

·     If you do not specify an MSTI or port, this command applies to all MSTIs on all ports.

·     If you specify a port but not an MSTI, this command applies to all MSTIs on the port.

·     If you specify both an MSTI ID and a port, this command applies to the specified MSTI on the port.

In STP, RSTP, or PVST mode, the command output is sorted by port name.

·     If you do not specify a port, this command applies to all ports.

·     If you specify a port, this command applies to the port.

Examples

# In MSTP mode, display the BPDU statistics for all MSTIs on Ten-GigabitEthernet 1/0/1.

<Sysname> display stp bpdu-statistics interface ten-gigabitethernet 1/0/1

 Port: Ten-GigabitEthernet1/0/1

 

 Instance-Independent:

 

 Type                        Count      Last Updated

 --------------------------- ---------- -----------------

 Invalid BPDUs               0

 Looped-back BPDUs           0

 Max-aged BPDUs              0

 TCN sent                    0

 TCN received                0

 TCA sent                    0

 TCA received                2          10:33:12 01/13/2011

 Config sent                 0

 Config received             0

 RST sent                    0

 RST received                0

 MST sent                    4          10:33:11 01/13/2011

 MST received                151        10:37:43 01/13/2011

 

 Instance 0:

 Type                        Count      Last Updated

 --------------------------- ---------- -----------------

 Timeout BPDUs               0

 Max-hoped BPDUs             0

 TC detected                 1          10:32:40 01/13/2011

 TC sent                     3          10:33:11 01/13/2011

 TC received                 0

# In PVST mode, display the BPDU statistics for Ten-GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] stp mode pvst

[Sysname] display stp bpdu-statistics interface ten-gigabitethernet 1/0/1

 Port: Ten-GigabitEthernet1/0/1

 

 Type                        Count      Last Updated

 --------------------------- ---------- -----------------

 Invalid BPDUs               0

 Looped-back BPDUs           0

 Max-aged BPDUs              0

 TCN sent                    0

 TCN received                0

 TCA sent                    0

 TCA received                2           10:33:12 01/13/2010

 Config sent                 0

 Config received             0

 RST sent                    0

 RST received                0

 MST sent                    4           10:33:11 01/13/2010

 MST received                151         10:37:43 01/13/2010

 Timeout BPDUs               0

 Max-hoped BPDUs             0

 TC detected                 511         10:32:40 01/13/2010

 TC sent                     8844        10:33:11 01/13/2010

 TC received                 1426        10:33:32 01/13/2010

Table 5 Command output

Field

Description

Port

Port name.

Instance-Independent

Statistics not related to any particular MSTI.

Type

Statistical item.

Looped-back BPDUs

BPDUs sent and then received by the same port.

Max-aged BPDUs

BPDUs whose max age was exceeded.

TCN sent

TCN BPDUs sent.

TCN received

TCN BPDUs received.

TCA sent

TCA BPDUs sent.

TCA received

TCA BPDUs received.

Config sent

Configuration BPDUs sent.

Config received

Configuration BPDUs sent.

RST sent

Configuration BPDUs received.

RST received

RSTP BPDUs sent.

MST sent

RSTP BPDUs received.

MST received

MSTP BPDUs sent.

Instance

Statistical information for a particular MSTI.

Timeout BPDUs

Expired BPDUs.

Max-hoped BPDUs

BPDUs whose maximum hops were exceeded.

TC detected

TC BPDUs detected.

TC sent

TC BPDUs sent.

TC received

TC BPDUs received.

 

display stp down-port

Use display stp down-port to display information about ports that were shut down by spanning tree protection features.

Syntax

display stp down-port

Views

Any view

Predefined user roles

network-admin

network-operator

Examples

# Display information about ports that were shut down by spanning tree protection features.

<Sysname> display stp down-port

 Down Port                                  Reason

 Ten-GigabitEthernet1/0/1                   BPDU-Protected

Table 6 Command output

Field

Description

Down Port

Name of a port that was shut down by the spanning tree protection features.

Reason

Reason that the port was shut down. BPDU-Protected indicates the BPDU guard feature.

 

display stp history

Use display stp history to display port role calculation history.

Syntax

display stp [ instance instance-list | vlan vlan-id-list ] history [ slot slot-number ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

instance instance-list: Specifies a space-separated list of up to 10 MSTI items. Each item specifies an MSTI or a range of MSTIs in the form of instance-id1 [ to instance-id2 ]. The value for instance-id2 must be equal to or greater than the value for instance-id1. The value range for the instance-id argument is 0 to 4094, and the value 0 represents the CIST.

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094.

slot slot-number: Specifies an IRF member device by its member ID. If this option is not specified on an IRF fabric, the command applies to all member devices.

Usage guidelines

In STP or RSTP mode, the output is sorted by port role calculation time.

In PVST mode, the command output is sorted by VLAN ID and by port role calculation time in each VLAN.

·     If you do not specify a VLAN, this command applies to all VLANs.

·     If you specify a VLAN list, this command applies to the specified VLANs.

In MSTP mode, the command output is sorted by MSTI ID and by port role calculation time in each MSTI.

·     If you do not specify an MSTI, this command applies to all MSTIs.

·     If you specify an MSTI list, this command applies to the specified MSTIs.

Examples

# In MSTP mode, display the port role calculation history for IRF member device 1 in MSTI 2.

<Sysname> display stp instance 2 history slot 1

 --------------- STP slot 1 history trace ---------------

 -------------------  Instance 2   ---------------------

Port Ten-GigabitEthernet1/0/1

   Role change         : ROOT->DESI (Aged)

   Time                : 2009/02/08 00:22:56

   Port priority       : 0.00e0-fc01-6510 0 0.00e0-fc01-6510 128.1

   Designated priority : 0.00e0-fc01-6510 0 0.00e0-fc01-6510 128.1

 Port Ten-GigabitEthernet1/0/2

   Role change         : ALTER->ROOT

   Time                : 2009/02/08 00:22:56

   Port priority       : 0.00e0-fc01-6510 0 0.00e0-fc01-6510 128.2

                         128.153

   Designated priority : 0.00e0-fc01-6510 0 0.00e0-fc01-6510 128.2

                         128.153

# In PVST mode, display the port role calculation history for IRF member device 1 in VLAN 2.

<Sysname> display stp vlan 2 history slot 1

 --------------- STP slot 1 history trace ---------------

 -------------------  VLAN 2   ---------------------

 Port Ten-GigabitEthernet1/0/1

   Role change         : ROOT->DESI (Aged)

   Time                : 2009/02/08 00:22:56

   Port priority       : 0.00e0-fc01-6510 0 0.00e0-fc01-6510 128.1

   Designated priority : 0.00e0-fc01-6510 0 0.00e0-fc01-6510 128.1

 Port Ten-GigabitEthernet1/0/2

   Role change         : ALTER->ROOT

   Time                : 2009/02/08 00:22:56

   Port priority       : 0.00e0-fc01-6510 0 0.00e0-fc01-6510 128.2

   Designated priority : 0.00e0-fc01-6510 0 0.00e0-fc01-6510 128.2

Table 7 Command output

Field

Description

Port

Port name.

Role change

Role change of the port (Aged means that the change was caused by expiration of the received configuration BPDU).

Time

Time of port role calculation.

 

display stp region-configuration

Use display stp region-configuration to display effective MST region configuration, including the following information:

·     Region name.

·     Revision level.

·     User-configured VLAN-to-instance mappings.

Syntax

display stp region-configuration

Views

Any view

Predefined user roles

network-admin

network-operator

Examples

# In MSTP mode, display effective MST region configuration.

<Sysname> display stp region-configuration

 Oper Configuration

   Format selector      : 0

   Region name          : hello

   Revision level       : 0

   Configuration digest : 0x5f762d9a46311effb7a488a3267fca9f

 

   Instance   VLANs Mapped

   0          21 to 4094

   1          1 to 10

   2          11 to 20

Table 8 Command output

Field

Description

Format selector

Format selector that is defined by the spanning tree protocol. The default value is 0, and the selector cannot be configured.

Region name

MST region name.

Revision level

Revision level of the MST region. The default value is 0, and the level can be configured by using the revision-level command.

VLANs Mapped

VLANs mapped to the MSTI.

 

Related commands

·     instance

·     region-name

·     revision-level

·     vlan-mapping modulo

display stp root

Use display stp root to display the root bridge information of spanning trees.

Syntax

display stp root

Views

Any view

Predefined user roles

network-admin

network-operator

Examples

# In MSTP mode, display the root bridge information of all spanning trees.

<Sysname> display stp root

 MST ID  Root Bridge ID        ExtPathCost IntPathCost Root Port

 0       0.00e0-fc0e-6554      200200      0           Ten-GigabitEthernet1/0/1

# In PVST mode, display the root bridge information of all spanning trees.

<Sysname> display stp root

 VLAN ID  Root Bridge ID        ExtPathCost IntPathCost Root Port

 1        0.00e0-fc0e-6554      200200      0           Ten-GigabitEthernet1/0/1

Table 9 Command output

Field

Description

ExtPathCost

External path cost. The device automatically calculates the default path cost of a port. Or, you can use the stp cost command to configure the path cost of a port.

IntPathCost

Internal path cost. The device automatically calculates the default path cost of a port. Or, you can use the stp cost command to configure the path cost of a port.

Root Port

Root port name (displayed only if a port of the device is the root port of MSTIs).

 

display stp tc

Use display stp tc to display the incoming and outgoing TC/TCN BPDU statistics for ports.

Syntax

display stp [ instance instance-list | vlan vlan-id-list ] tc [ slot slot-number ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

instance instance-list: Specifies a space-separated list of up to 10 MSTI items. Each item specifies an MSTI or a range of MSTIs in the form of instance-id1 [ to instance-id2 ]. The value for instance-id2 must be equal to or greater than the value for instance-id1. The value range for the instance-id argument is 0 to 4094, and the value 0 represents the CIST.

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094.

slot slot-number: Specifies an IRF member device by its member ID. If this option is not specified on an IRF fabric, the command applies to all member devices.

Usage guidelines

In STP or RSTP mode, the output is sorted by port name.

In PVST mode, the command output is sorted by VLAN ID and by port name in each VLAN.

·     If you do not specify a VLAN, this command applies to all VLANs.

·     If you specify a VLAN list, this command applies to the specified VLANs.

In MSTP mode, the command output is sorted by MSTI ID and by port name in each MSTI.

·     If you do not specify an MSTI, this command applies to all MSTIs.

·     If you specify an MSTI list, this command applies to the specified MSTIs.

Examples

# In MSTP mode, display the incoming and outgoing TC/TCN BPDU statistics for all ports on IRF member device 1 in MSTI 0.

<Sysname> display stp instance 0 tc slot 1

 -------------- STP slot 1 TC or TCN count -------------

 MST ID      Port                                    Receive      Send

 0          Ten-GigabitEthernet1/0/1                6            4

 0          Ten-GigabitEthernet1/0/2                0            2

# In PVST mode, display the incoming and outgoing TC/TCN BPDU statistics for all ports on IRF member device 1 in VLAN 2.

<Sysname> display stp vlan 2 tc slot 1

 -------------- STP slot 1 TC or TCN count -------------

 VLAN ID     Port                                    Receive      Send

 2           Ten-GigabitEthernet1/0/1                6            4

 2           Ten-GigabitEthernet1/0/2                0            2

Table 10 Command output

Field

Description

Port

Port name.

Receive

Number of TC/TCN BPDUs received on each port.

Send

Number of TC/TCN BPDUs sent by each port.

 

instance

Use instance to map a list of VLANs to an MSTI.

Use undo instance to remap the specified VLAN or all VLANs to the CIST (MSTI 0).

Syntax

instance instance-id vlan vlan-id-list

undo instance instance-id [ vlan vlan-id-list ]

Default

All VLANs are mapped to the CIST.

Views

MST region view

Predefined user roles

network-admin

Parameters

instance-id: Specifies an MSTI ID in the range of 0 to 4094. A value of 0 represents the CIST. The value range for the instance-id argument is 1 to 4094 for the undo instance command.

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094.

Usage guidelines

 

CAUTION

CAUTION:

Use caution with global Digest Snooping in the following situations:

·     When you modify the VLAN-to-instance mappings.

·     When you restore the default MST region configuration.

If the local device has different VLAN-to-instance mappings than its neighboring devices, loops or traffic interruption will occur.

 

If you specify no VLAN in the undo instance command, all VLANs mapped to the specified MSTI are remapped to the CIST.

You cannot map the same VLAN to different MSTIs. If you map a VLAN that has been mapped to an MSTI to a new MSTI, the old mapping is automatically removed.

You can configure VLAN-to-instance mapping for up to 65 MSTIs.

After configuring this command, run the active region-configuration command to activate the VLAN-to-instance mapping.

Examples

# Map VLAN 2 to MSTI 1.

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region] instance 1 vlan 2

Related commands

·     active region-configuration

·     check region-configuration

·     display stp region-configuration

region-name

Use region-name to configure the MST region name.

Use undo region-name to restore the default MST region name.

Syntax

region-name name

undo region-name

Default

The MST region name of a device is its MAC address.

Views

MST region view

Predefined user roles

network-admin

Parameters

name: Specifies the MST region name, a string of 1 to 32 characters.

Usage guidelines

The MST region name, the VLAN-to-instance mapping table, and the MSTP revision level of a device determine the device's MST region.

After configuring this command, run the active region-configuration command to activate the configured MST region name.

Examples

# Set the MST region name of the device to hello.

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region] region-name hello

Related commands

·     active region-configuration

·     check region-configuration

·     display stp region-configuration

·     instance

·     revision-level

·     vlan-mapping modulo

reset stp

Use reset stp to clear spanning tree statistics. The spanning tree statistics include the numbers of TCN BPDUs, configuration BPDUs, RST BPDUs, and MST BPDUs that are sent and received through the specified ports.

Syntax

reset stp [ interface interface-list ]

Views

User view

Predefined user roles

network-admin

Parameters

interface interface-list: Specifies a space-separated list of up to 10 interface items. Each item specifies an interface or a range of interfaces in the form of interface-type interface-number 1 [ to interface-type interface-number 2 ]. The interface number for interface-number 2 must be equal to or greater than the interface number for interface-number 1. If you don't specify this option, this command clears the spanning tree-related statistics information on all ports.

Examples

# Clear the spanning tree statistics on ports Ten-GigabitEthernet 1/0/1 through Ten-GigabitEthernet 1/0/3.

<Sysname> reset stp interface ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/3

Related commands

display stp

revision-level

Use revision-level to configure the MSTP revision level.

Use undo revision-level to restore the default MSTP revision level.

Syntax

revision-level level

undo revision-level

Default

The MSTP revision level is 0.

Views

MST region view

Predefined user roles

network-admin

Parameters

level: Specifies an MSTP revision level in the range of 0 to 65535.

Usage guidelines

The MSTP revision level, the MST region name, and the VLAN-to-instance mapping table of a device determine the device's MST region.

After configuring this command, run the active region-configuration command to activate the configured MST region level.

Examples

# Set the MSTP revision level of the MST region to 5.

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region] revision-level 5

Related commands

·     active region-configuration

·     check region-configuration

·     display stp region-configuration

·     instance

·     region-name

·     vlan-mapping modulo

snmp-agent trap enable stp

Use snmp-agent trap enable stp to enable SNMP notifications for new-root election events or spanning tree topology changes.

Use undo snmp-agent trap enable stp to disable SNMP notifications for new-root election events or spanning tree topology changes.

Syntax

snmp-agent trap enable stp [ new-root | tc ]

undo snmp-agent trap enable stp [ new-root | tc ]

Default

SNMP notifications are disabled for new-root election events.

In MSTP mode, SNMP notifications are enabled in MSTI 0 and disabled in other MSTIs for spanning tree topology changes.

In PVST mode, SNMP notifications are disabled for spanning tree topology changes in all VLANs.

Views

System view

Predefined user roles

network-admin

Parameters

new-root: Enables the device to send traps if the device is elected as a new root bridge. This keyword applies only to STP, MSTP, and RSTP modes.

tc: Enables the device to send traps if the device receives TCN BPDUs. This keyword applies only to PVST mode.

Usage guidelines

If no keyword is specified, the snmp-agent trap enable stp command applies to SNMP notifications for different events as follows:

·     In STP, MSTP, and RSTP modes, the command applies to SNMP notifications for new-root election events.

·     In PVST mode, the command applies to SNMP notifications for spanning tree topology changes.

Examples

# Enable SNMP notifications for new-root election events.

<Sysname> system-view

[Sysname] snmp-agent trap enable stp new-root

Related commands

stp log enable tc

stp bpdu-protection

Use stp bpdu-protection to enable BPDU guard globally.

Use undo stp bpdu-protection to disable BPDU guard globally.

Syntax

stp bpdu-protection

undo stp bpdu-protection

Default

BPDU guard is disabled globally.

Views

System view

Predefined user roles

network-admin

Examples

# Enable BPDU guard globally.

<Sysname> system-view

[Sysname] stp bpdu-protection

Related commands

·     stp edged-port

·     stp port bpdu-protection

stp bridge-diameter

Use stp bridge-diameter to specify the network diameter.

Use undo stp bridge-diameter to restore the default.

Syntax

stp [ vlan vlan-id-list ] bridge-diameter diameter

undo stp [ vlan vlan-id-list ] bridge-diameter

Default

The network diameter of the switched network is 7.

Views

System view

Predefined user roles

network-admin

Parameters

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094. If you set the STP, RSTP, or MSTP switched network diameter, do not specify this option.

diameter: Specifies the switched network diameter in the range of 2 to 7.

Usage guidelines

The switched network diameter refers to the maximum number of devices on the path for an edge device to reach another through the root bridge.

An appropriate setting of hello time, forward delay, and max age can speed up network convergence. The values of these timers are related to the network size, and you can set the timers by setting the network diameter. With the network diameter set to 7 (the default), the three timers are also set to their defaults.

In STP, RSTP, or MSTP mode, each MST region is considered a device, and the configured network diameter of the switched network takes effect only on the CIST (or the common root bridge).

In PVST mode, the configured network diameter takes effect only on the root bridges of the specified VLANs.

Examples

# In MSTP mode, set the network diameter of the switched network to 5.

<Sysname> system-view

[Sysname] stp bridge-diameter 5

# In PVST mode, set the network diameter of VLAN 2 in the switched network to 5.

<Sysname> system-view

[Sysname] stp vlan 2 bridge-diameter 5

Related commands

·     stp timer forward-delay

·     stp timer hello

·     stp timer max-age

stp compliance

Use stp compliance to configure the mode that a port uses to recognize and send MSTP BPDUs.

Use undo stp compliance to restore the default.

Syntax

stp compliance { auto | dot1s | legacy }

undo stp compliance

Default

A port automatically recognizes the formats of received MSTP packets and determines the formats of MSTP packets to be sent based on the recognized formats.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Parameters

auto: Configures the port to recognize the MSTP BPDU format automatically and determine the format of MSTP BPDUs to send.

dot1s: Configures the port to receive and send only standard-format (802.1s-compliant) MSTP BPDUs.

legacy: Configures the port to receive and send only compatible-format MSTP BPDUs.

Usage guidelines

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

Examples

# Configure Ten-GigabitEthernet 1/0/1 to send only standard-format (802.1s) MSTP packets.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] stp compliance dot1s

stp config-digest-snooping

Use stp config-digest-snooping to enable Digest Snooping.

Use undo stp config-digest-snooping to disable Digest Snooping.

Syntax

stp config-digest-snooping

undo stp config-digest-snooping

Default

Digest Snooping is disabled.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Usage guidelines

Enable this feature both globally and on ports connected to other vendors' devices. To minimize impact, enable the feature on all associated ports before you enable it globally.

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

Examples

# Enable Digest Snooping on Ten-GigabitEthernet 1/0/1 and then globally.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] stp config-digest-snooping

[Sysname-Ten-GigabitEthernet1/0/1] quit

[Sysname] stp global config-digest-snooping

Related commands

·     display stp

·     stp global config-digest-snooping

stp cost

Use stp cost to set the path cost of a port.

Use undo stp cost to restore the default.

Syntax

stp [ instance instance-list | vlan vlan-id-list ] cost cost

undo stp [ instance instance-list | vlan vlan-id-list ] cost

Default

The device automatically calculates the path costs of ports in each spanning tree based on the corresponding standard.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Parameters

instance instance-list: Specifies a space-separated list of up to 10 MSTI items. Each item specifies an MSTI or a range of MSTIs in the form of instance-id1 [ to instance-id2 ]. The value for instance-id2 must be equal to or greater than the value for instance-id1. The value range for the instance-id argument is 0 to 4094, and the value 0 represents the CIST.

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094.

cost: Specifies the path cost of the port, with an effective range that depends on the path cost calculation standard that is used.

·     When the IEEE 802.1d-1998 standard is selected for path cost calculation, the value range for the cost argument is 1 to 65535.

·     When the IEEE 802.1t standard is selected for path cost calculation, the value range for the cost argument is 1 to 200000000.

·     When the private standard is selected for path cost calculation, the value range for the cost argument is 1 to 200000.

Usage guidelines

Path cost is an important factor in spanning tree calculation. Setting different path costs for a port in MSTIs allows VLAN traffic flows to be forwarded along different physical links. This results in VLAN-based load balancing.

The path cost setting of a port can affect the role selection of the port. When the path cost of a port is changed, the system calculates the role of the port and initiates a state transition.

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, is takes effect only after the port leaves the aggregation group.

If you do not specify an MSTI or VLAN, this command sets the path cost of the ports in the MSTP CIST or in the STP or RSTP spanning tree.

Examples

# In MSTP mode, set the path cost of port Ten-GigabitEthernet 1/0/3 in MSTI 2 to 200.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/3

[Sysname-Ten-GigabitEthernet1/0/3] stp instance 2 cost 200

# In PVST mode, set the path cost of port Ten-GigabitEthernet 1/0/3 in VLAN 2 to 200.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/3

[Sysname-Ten-GigabitEthernet1/0/3] stp vlan 2 cost 200

Related commands

·     display stp

·     stp pathcost-standard

stp edged-port

Use stp edged-port to configure a port as an edge port.

Use undo stp edged-port to configure a port as a non-edge port.

Syntax

stp edged-port

undo stp edged-port

Default

All ports are non-edge ports.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Usage guidelines

A port directly connecting to a user terminal rather than another device or a shared LAN segment can be configured as an edge port. In case the network topology changes, an edge port does not cause a temporary loop. You can enable the port to transit to the forwarding state rapidly by configuring it as an edge port. As a best practice, configure ports that directly connect to user terminals as edge ports.

Typically, configuration BPDUs from other devices cannot reach an edge port, because the edge port does not connect to any other device. When BPDU guard is disabled on a port configured as an edge port, the port acts as a non-edge port if it receives configuration BPDUs.

On a port, the loop guard feature and the edge port setting are mutually exclusive.

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

Examples

# Configure Ten-GigabitEthernet 1/0/1 as an edge port.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] stp edged-port

Related commands

·     stp bpdu-protection

·     stp loop-protection

·     stp port bpdu-protection

·     stp root-protection

stp enable

Use stp enable to enable the spanning tree feature.

Use undo stp enable to disable the spanning tree feature.

Syntax

stp enable

undo stp enable

Default

The spanning tree feature is enabled on all ports.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Usage guidelines

When you enable the spanning tree feature, the device operates in STP, RSTP, PVST, or MSTP mode, depending on the spanning tree mode setting.

When you enable the spanning tree feature, the device dynamically maintains the spanning tree status of VLANs, based on received configuration BPDUs.

When you disable the spanning tree feature, the device stops maintaining the spanning tree status.

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

Examples

# In MSTP mode, disable the spanning tree feature on port Ten-GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] undo stp enable

Related commands

·     stp global enable

·     stp mode

·     stp vlan enable

stp global config-digest-snooping

Use stp global config-digest-snooping to enable Digest Snooping globally.

Use undo stp global config-digest-snooping to disable Digest Snooping globally.

Syntax

stp global config-digest-snooping

undo stp global config-digest-snooping

Default

Digest Snooping is disabled globally.

Views

System view

Predefined user roles

network-admin

Usage guidelines

Enable this feature both globally and on ports connected to other vendors' devices. To minimize impact, enable the feature on all associated ports before you enable it globally.

Examples

# Enable Digest Snooping on Ten-GigabitEthernet 1/0/1 and then globally.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] stp config-digest-snooping

[Sysname-Ten-GigabitEthernet1/0/1] quit

[Sysname] stp global config-digest-snooping

Related commands

·     display stp

·     stp config-digest-snooping

stp global enable

Use stp global enable to enable the spanning tree feature globally.

Use undo stp global enable to disable the spanning tree feature globally.

Syntax

stp global enable

undo stp global enable

Default

If the device starts up with the initial settings, the spanning tree feature is disabled globally.

If the device starts up with the factory defaults, the spanning tree feature is enabled globally.

For more information about the startup configuration, see Fundamentals Configuration Guide.

Views

System view

Predefined user roles

network-admin

Usage guidelines

When you enable the spanning tree feature, the device operates in STP, RSTP, PVST, or MSTP mode, depending on the spanning tree mode setting.

When the spanning tree feature is enabled, the device dynamically maintains the spanning tree status of VLANs based on received configuration BPDUs. When the spanning tree feature is disabled, the device stops maintaining the spanning tree status.

Examples

# Enable the spanning tree feature globally.

<Sysname> system-view

[Sysname] stp global enable

Related commands

·     stp enable

·     stp mode

stp global mcheck

Use stp global mcheck to perform the mCheck operation globally.

Syntax

stp global mcheck

Views

System view

Predefined user roles

network-admin

Usage guidelines

When a port on an MSTP, RSTP, or PVST device connects to an STP device and receives STP BPDUs, the port automatically transits to the STP mode. However, the port cannot automatically transit back to the original mode when the following conditions exist:

·     The peer STP device is shut down or removed.

·     The port cannot detect the change.

In this case, you can perform an mCheck operation to forcibly transit the port to operate in the original mode.

The device operates in STP, RSTP, PVST, or MSTP mode, depending on the spanning tree mode setting.

The stp global mcheck command takes effect only when the device operates in MSTP, RSTP, or PVST mode.

Examples

# Perform mCheck globally.

<Sysname> system-view

[Sysname] stp global mcheck

Related commands

·     stp mcheck

·     stp mode

stp log enable tc

Use stp log enable tc to enable the device to generate a log when it detects or receives a TCN BPDU in PVST mode.

Use undo stp log enable tc to restore the default.

Syntax

stp log enable tc

undo stp log enable tc

Default

In PVST mode, the device does not generate a log when it detects or receives a TCN BPDU.

Views

System view

Predefined user roles

network-admin

Usage guidelines

The command takes effect only in PVST mode.

Examples

# Enable the device to generate a log when it detects or receives a TCN BPDU in PVST mode.

<Sysname> system-view

[Sysname] stp log enable tc

Related commands

snmp-agent trap enable stp

stp loop-protection

Use stp loop-protection to enable loop guard on a port.

Use undo stp loop-protection to disable loop guard on a port.

Syntax

stp loop-protection

undo stp loop-protection

Default

Loop guard is disabled.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Usage guidelines

On a port, the loop guard feature is mutually exclusive with the root guard feature or the edge port setting.

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

Examples

# Enable loop guard on Ten-GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] stp loop-protection

Related commands

·     stp edged-port

·     stp root-protection

stp max-hops

Use stp max-hops to set the maximum number of hops for an MST region.

Use undo stp max-hops to restore the default.

Syntax

stp max-hops hops

undo stp max-hops

Default

The maximum number of hops for an MST region is 20.

Views

System view

Predefined user roles

network-admin

Parameters

hops: Sets the maximum hops in the range of 1 to 40.

Examples

# Set the maximum hops of the MST region to 35.

<Sysname> system-view

[Sysname] stp max-hops 35

Related commands

display stp

stp mcheck

Use stp mcheck to perform the mCheck operation on a port.

Syntax

stp mcheck

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Usage guidelines

When a port on an MSTP, RSTP, or PVST device connects to an STP device and receives STP BPDUs, the port automatically transits to the STP mode. However, the port cannot automatically transit back to the original mode when the following conditions exist:

·     The peer STP device is shut down or removed.

·     The port cannot detect the change.

In this case, you can perform an mCheck operation to forcibly transit the port to operation in the original mode.

For example, Device A, Device B, and Device C are connected in sequence. Device A runs STP, Device B does not run any spanning tree protocol, and Device C runs RSTP, MSTP, or PVST. When Device C receives an STP BPDU transparently transmitted by Device B, the receiving port transits to the STP mode. If you configure Device B to run RSTP, MSTP, or PVST with Device C, perform mCheck operations on the ports that connect Device B and Device C.

The device operates in STP, RSTP, PVST, or MSTP mode, depending on the spanning tree mode setting.

The stp mcheck command takes effect only when the device operates in MSTP, RSTP, or PVST mode.

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

Examples

# Perform mCheck on Ten-GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] stp mcheck

Related commands

·     stp global mcheck

·     stp mode

stp mode

Use stp mode to configure the spanning tree operating mode.

Use undo stp mode to restore the default.

Syntax

stp mode { mstp | pvst | rstp | stp }

undo stp mode

Default

A spanning tree device operates in MSTP mode.

Views

System view

Predefined user roles

network-admin

Parameters

mstp: Configures the spanning tree device to operate in MSTP mode.

pvst: Configures the spanning tree device to operate in PVST mode.

rstp: Configures the spanning tree device to operate in RSTP mode.

stp: Configures the spanning tree device to operate in STP mode.

Usage guidelines

The MSTP mode is compatible with the RSTP mode, and the RSTP mode is compatible with the STP mode.

The PVST mode's compatibility with other modes is as follows:

·     Access portThe PVST mode is compatible with other modes in any VLAN.

·     Trunk or hybrid portThe PVST mode is compatible with other modes only in VLAN 1.

Examples

# Configure the spanning tree device to operate in STP mode.

<Sysname> system-view

[Sysname] stp mode stp

Related commands

·     stp enable

·     stp global enable

·     stp global mcheck

·     stp mcheck

·     stp vlan enable

stp no-agreement-check

Use stp no-agreement-check to enable No Agreement Check on a port.

Use undo stp no-agreement-check to disable No Agreement Check on a port.

Syntax

stp no-agreement-check

undo stp no-agreement-check

Default

No Agreement Check is disabled.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Usage guidelines

This command takes effect only after you enable it on the root port.

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

Examples

# Enable No Agreement Check on Ten-GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] stp no-agreement-check

stp pathcost-standard

Use stp pathcost-standard to specify a standard for the device to use when calculating the default path costs for ports.

Use undo stp pathcost-standard to restore the default.

Syntax

stp pathcost-standard { dot1d-1998 | dot1t | legacy }

undo stp pathcost-standard

Default

The devices uses the legacy standard to calculate the default path costs for ports.  

Views

System view

Predefined user roles

network-admin

Parameters

dot1d-1998: Configures the device to calculate the default path cost for ports based on IEEE 802.1d-1998.

dot1t: Configures the device to calculate the default path cost for ports based on IEEE 802.1t.

legacy: Configures the device to calculate the default path cost for ports based on a private standard.

Usage guidelines

If you change the standard that the device uses in calculating the default path costs, you restore the path costs to the default.

Examples

# Configure the device to calculate the default path cost for ports based on IEEE 802.1d-1998.

<Sysname> system-view

[Sysname] stp pathcost-standard dot1d-1998

Related commands

·     display stp

·     stp cost

stp point-to-point

Use stp point-to-point to configure the link type of a port.

Use undo stp point-to-point to restore the default.

Syntax

stp point-to-point { auto | force-false | force-true }

undo stp point-to-point

Default

The default setting is auto, and the spanning tree device automatically detects whether a port connects to a point-to-point link.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Parameters

auto: Specifies automatic detection of the link type.

force-false: Specifies the non-point-to-point link type.

force-true: Specifies the point-to-point link type.

Usage guidelines

When connecting to a non-point-to-point link, a port is incapable of rapid state transition.

You can configure the link type as point-to-point for a Layer 2 aggregate interface or a port that operates in full duplex mode. As a best practice, use the default setting for the device to automatically detect the port link type.

The stp point-to-point force-false or stp point-to-point force-true command configured on a port in MSTP mode takes effect on all MSTIs or VLANs.

If the physical link to which the port connects is not a point-to-point link but you set it to be one, the configuration might cause a temporary loop.

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

Examples

# Configure the link that connects Ten-GigabitEthernet 1/0/3 as a point-to-point link.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/3

[Sysname-Ten-GigabitEthernet1/0/3] stp point-to-point force-true

Related commands

display stp

stp port bpdu-protection

Use stp port bpdu-protection to configure BPDU guard on an interface.

Use undo stp port bpdu-protection to restore the default.

Syntax

stp port bpdu-protection { enable | disable }

undo stp port bpdu-protection

Default

BPDU guard is not configured on a per-edge port basis. The status of BPDU guard on an interface is the same as the global BPDU guard status.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Parameters

enable: Enables BPDU guard.

disable: Disables BPDU guard.

Usage guidelines

When this command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When this command is configured in Layer 2 aggregate interface view, it takes effect only on that aggregate interface.

When this command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

Examples

# Enable BPDU guard on Ten-GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] stp port bpdu-protection enable

Related commands

·     stp bpdu-protection

·     stp edged-port

stp port priority

Use stp port priority to set the priority of a port. The port priority affects the role of a port in a spanning tree.

Use undo stp port priority to restore the default.

Syntax

stp [ instance instance-list | vlan vlan-id-list ] port priority priority

undo stp [ instance instance-list | vlan vlan-id-list ] port priority

Default

The port priority is 128.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Parameters

instance instance-list: Specifies a space-separated list of up to 10 MSTI items. Each item specifies an MSTI or a range of MSTIs in the form of instance-id1 [ to instance-id2 ]. The value for instance-id2 must be equal to or greater than the value for instance-id1. The value range for the instance-id argument is 0 to 4094, and the value 0 represents the CIST.

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094.

priority: Specifies the port priority in the range of 0 to 240 in increments of 16 (as in 0, 16, 32).

Usage guidelines

The smaller the value, the higher the port priority. If all ports on your device use the same priority value, the port priority depends on the port index. The smaller the index, the higher the priority.

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

If you do not specify an MSTI or VLAN, this command configures the priority of the ports in the MSTP CIST or in the STP or RSTP spanning tree.

Examples

# In MSTP mode, set the priority of port Ten-GigabitEthernet 1/0/3 to 16 in MSTI 2.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/3

[Sysname-Ten-GigabitEthernet1/0/3] stp instance 2 port priority 16

# In PVST mode, set the priority of port Ten-GigabitEthernet 1/0/3 to 16 in VLAN 2.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/3

[Sysname-Ten-GigabitEthernet1/0/3] stp vlan 2 port priority 16

Related commands

display stp

stp port shutdown permanent

Use stp port shutdown permanent to disable the device to reactivate the shutdown edge ports.

Use undo stp port shutdown permanent to restore the default.

Syntax

stp port shutdown permanent

undo stp port shutdown permanent

Default

The device reactivates the shutdown edge ports after a port status detection interval.

Views

System view

Predefined user roles

network-admin

Usage guidelines

This command applies to edge ports that are shut down by BPDU guard after the command is executed. To bring up these ports, use the undo shutdown command.

You can use the shutdown-interval time command to set the port status detection interval after which the device reactivates the shutdown ports. For information about the shutdown-interval time command, see Fundamentals Command Reference.

Examples

# Disable the device to reactivate shutdown edge ports.

<Sysname> system-view

[Sysname] stp port shutdown permanent

stp port-log

Use stp port-log to enable outputting port state transition information.

Use undo stp port-log to disable outputting port state transition information.

Syntax

stp port-log { all | instance instance-list | vlan vlan-id-list }

undo stp port-log { all | instance instance-list | vlan vlan-id-list }

Default

This feature is disabled.

Views

System view

Predefined user roles

network-admin

Parameters

all: Specifies all MSTIs or VLANs.

instance instance-list: Specifies a space-separated list of up to 10 MSTI items. Each item specifies an MSTI or a range of MSTIs in the form of instance-id1 [ to instance-id2 ]. The value for instance-id2 must be equal to or greater than the value for instance-id1. The value range for the instance-id argument is 0 to 4094, and the value 0 represents the CIST.

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094.

Examples

# In MSTP mode, enable outputting port state transition information for MSTI 2.

<Sysname> system-view

[Sysname] stp port-log instance 2

%Aug 16 00:49:41:856 2011 Sysname STP/3/STP_DISCARDING: Instance 2's port Ten-GigabitEthernet1/0/1 has been set to discarding state.

%Aug 16 00:49:41:856 2011 Sysname STP/3/STP_FORWARDING: Instance 2's port Ten-GigabitEthernet1/0/2 has been set to forwarding state.

The output shows that Ten-GigabitEthernet 1/0/1 in MSTI 2 transited to the discarding state and Ten-GigabitEthernet 1/0/2 in MSTI 2 transited to the forwarding state.

# In PVST mode, enable outputting port state transition information for VLAN 1 through VLAN 4094.

<Sysname> system-view

[Sysname] stp port-log vlan 1 to 4094

%Aug 16 00:49:41:856 2006 Sysname STP/3/STP_DISCARDING: VLAN 2's Ten-GigabitEthernet1/0/1 has been set to discarding state!

%Aug 16 00:49:41:856 2006 Sysname STP/3/STP_FORWARDING: VLAN 2's Ten-GigabitEthernet1/0/2 has been set to forwarding state.

The output shows that Ten-GigabitEthernet 1/0/1 in VLAN 2 transited to the discarding state and Ten-GigabitEthernet 1/0/2 in VLAN 2 transited to the forwarding state.

stp priority

Use stp priority to set the priority of the device.

Use undo stp priority to restore the default priority.

Syntax

stp [ instance instance-list | vlan vlan-id-list ] priority priority

undo stp [ instance instance-list | vlan vlan-id-list ] priority

Default

The device priority is 32768.

Views

System view

Predefined user roles

network-admin

Parameters

instance instance-list: Specifies a space-separated list of up to 10 MSTI items. Each item specifies an MSTI or a range of MSTIs in the form of instance-id1 [ to instance-id2 ]. The value for instance-id2 must be equal to or greater than the value for instance-id1. The value range for the instance-id argument is 0 to 4094, and the value 0 represents the CIST.

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094.

priority: Specifies the device priority in the range of 0 to 61440 in increments of 4096 (as in 0, 4096, 8192). You can set up to 16 priority values on the device. The smaller the value, the higher the device priority.

Usage guidelines

If you do not specify an MSTI or VLAN, this command configures the priority of the device in the MSTP CIST or in the STP or RSTP spanning tree.

Examples

# In MSTP mode, set the device priority to 4096 in MSTI 1.

<Sysname> system-view

[Sysname] stp instance 1 priority 4096

# In PVST mode, set the device priority to 4096 in VLAN 1.

<Sysname> system-view

[Sysname] stp vlan 1 priority 4096

stp region-configuration

Use stp region-configuration to enter MST region view.

Use undo stp region-configuration to restore the default MST region configurations.

Syntax

stp region-configuration

undo stp region-configuration

Default

The default settings for the MST region are as follows:

·     The MST region name of the device is the MAC address of the device.

·     All VLANs are mapped to the CIST.

·     The MSTP revision level is 0.

Views

System view

Predefined user roles

network-admin

Usage guidelines

After you enter MST region view, you can configure the MST region parameters, including the region name, VLAN-to-instance mappings, and revision level.

Examples

# Enter MST region view.

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region]

stp role-restriction

Use stp role-restriction to enable port role restriction.

Use undo stp role-restriction to disable port role restriction.

Syntax

stp role-restriction

undo stp role-restriction

Default

Port role restriction is disabled.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Usage guidelines

When port role restriction is enabled on a port, the port cannot become a root port.

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

Examples

# Enable port role restriction on interface Ten-GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] stp role-restriction

stp root primary

Use stp root primary to configure the device as the root bridge.

Use undo stp root to restore the default.

Syntax

stp [ instance instance-list | vlan vlan-id-list ] root primary

undo stp [ instance instance-list | vlan vlan-id-list ] root

Default

A device is not a root bridge.

Views

System view

Predefined user roles

network-admin

Parameters

instance instance-list: Specifies a space-separated list of up to 10 MSTI items. Each item specifies an MSTI or a range of MSTIs in the form of instance-id1 [ to instance-id2 ]. The value for instance-id2 must be equal to or greater than the value for instance-id1. The value range for the instance-id argument is 0 to 4094, and the value 0 represents the CIST.

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094.

Usage guidelines

Once you specify the device as the root bridge, you cannot change the priority of the device.

If you do not specify an MSTI or VLAN, this command configures the device as the root bridge of the MSTP CIST or of the STP or RSTP spanning tree.

Examples

# In MSTP mode, specify the device as the root bridge of MSTI 1.

<Sysname> system-view

[Sysname] stp instance 1 root primary

# In PVST mode, specify the device as the root bridge of VLAN 1.

<Sysname> system-view

[Sysname] stp vlan 1 root primary

Related commands

·     stp priority

·     stp root secondary

stp root secondary

Use stp root secondary to configure the device as a secondary root bridge.

Use undo stp root to restore the default.

Syntax

stp [ instance instance-list | vlan vlan-id-list ] root secondary

undo stp [ instance instance-list | vlan vlan-id-list ] root

Default

A device is not a secondary root bridge.

Views

System view

Predefined user roles

network-admin

Parameters

instance instance-list: Specifies a space-separated list of up to 10 MSTI items. Each item specifies an MSTI or a range of MSTIs in the form of instance-id1 [ to instance-id2 ]. The value for instance-id2 must be equal to or greater than the value for instance-id1. The value range for the instance-id argument is 0 to 4094, and the value 0 represents the CIST.

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094.

Usage guidelines

Once you specify the device as a secondary root bridge, you cannot change the priority of the device.

If you do not specify an MSTI or VLAN, this command configures a secondary root bridge for the MSTP CIST or of the STP or RSTP spanning tree.

Examples

# In MSTP mode, specify the device as a secondary root bridge in MSTI 1.

<Sysname> system-view

[Sysname] stp instance 1 root secondary

# In PVST mode, specify the device as a secondary root bridge in VLAN 1.

<Sysname> system-view

[Sysname] stp vlan 1 root secondary

Related commands

·     stp priority

·     stp root primary

stp root-protection

Use stp root-protection to enable root guard on a port.

Use undo stp root-protection to disable root guard on a port.

Syntax

stp root-protection

undo stp root-protection

Default

Root guard is disabled.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Usage guidelines

On a port, the loop guard feature and the root guard feature are mutually exclusive.

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

Examples

# Enable root guard for Ten-GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] stp root-protection

Related commands

·     stp edged-port

·     stp loop-protection

stp tc-protection

Use stp tc-protection to enable TC-BPDU attack guard for the device.

Use undo stp tc-protection to disable TC-BPDU attack guard for the device.

Syntax

stp tc-protection

undo stp tc-protection

Default

TC-BPDU attack guard is enabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

With TC-BPDU guard, you can set the maximum number of immediate forwarding address entry flushes that the device can perform every 10 seconds. For TC-BPDUs received that exceed the limit, the device performs a forwarding address entry flush when the interval elapses. This prevents frequent flushing of forwarding address entries.

Examples

# Disable TC-BPDU attack guard for the device.

<Sysname> system-view

[Sysname] undo stp tc-protection

Related commands

stp tc-protection threshold

stp tc-protection threshold

Use stp tc-protection threshold to configure the maximum number of forwarding address entry flushes that the device can perform every 10 seconds.

Use undo stp tc-protection threshold to restore the default.

Syntax

stp tc-protection threshold number

undo stp tc-protection threshold

Default

By default, the device can perform a maximum of six forwarding address entry flushes every 10 seconds.

Views

System view

Predefined user roles

network-admin

Parameters

number: Sets the maximum number of immediate forwarding address entry flushes that the device can perform every 10 seconds. The value is in the range of 1 to 255.

Examples

# Configure the device to perform up to 10 forwarding address entry flushes every 10 seconds.

<Sysname> system-view

[Sysname] stp tc-protection threshold 10

Related commands

stp tc-protection

stp tc-restriction

Use stp tc-restriction to enable TC-BPDU transmission restriction.

Use undo stp tc-restriction to disable TC-BPDU transmission restriction.

Syntax

stp tc-restriction

undo stp tc-restriction

Default

TC-BPDU transmission restriction is disabled.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Usage guidelines

When TC-BPDU transmission restriction is enabled on a port, the port does not send TC-BPDUs to the other ports. It also does not delete the MAC address entries.

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

Examples

# Enable TC-BPDU transmission restriction on Ten-GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] stp tc-restriction

stp tc-snooping

Use stp tc-snooping to enable TC Snooping.

Use undo stp tc-snooping to disable TC Snooping.

Syntax

stp tc-snooping

undo stp tc-snooping

Default

TC Snooping is disabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

TC Snooping and the spanning tree feature are mutually exclusive. You must globally disable the spanning tree feature before enabling TC Snooping.

Examples

# Globally disable the spanning tree feature and enable TC Snooping.

<Sysname> system-view

[Sysname] undo stp global enable

[Sysname] stp tc-snooping

Related commands

stp global enable

stp timer forward-delay

Use stp timer forward-delay to set the forward delay timer.

Use undo stp timer forward-delay to restore the default.

Syntax

stp [ vlan vlan-id-list ] timer forward-delay time

undo stp [ vlan vlan-id-list ] timer forward-delay

Default

The forward delay timer is 1500 centiseconds.

Views

System view

Predefined user roles

network-admin

Parameters

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094. If you set the STP, RSTP, or MSTP forward delay, do not specify this option.

time: Sets the forward delay in centiseconds, in the range of 400 to 3000 in increments of 100 (as in 400, 500, 600).

Usage guidelines

The forward delay timer determines the time interval of state transition. To prevent temporary loops, a spanning tree port goes through the learning (intermediate) state before it transits from the discarding state to the forwarding state. To stay synchronized with the remote device, the port has a wait period between transition states that is determined by the forward delay timer.

Do not set the forward delay with this command. As a best practice, specify the network diameter of the switched network by using the stp bridge-diameter command. The stp bridge-diameter command makes the spanning tree protocols automatically calculate the optimal settings for the forward delay timer. If the network diameter uses the default value, the forward delay timer also uses the default value.

Examples

# In MSTP mode, set the forward delay timer to 2000 centiseconds.

<Sysname> system-view

[Sysname] stp timer forward-delay 2000

# In PVST mode, set the forward delay timer for VLAN 2 to 2000 centiseconds.

<Sysname> system-view

[Sysname] stp vlan 2 timer forward-delay 2000

Related commands

·     stp bridge-diameter

·     stp timer hello

·     stp timer max-age

stp timer hello

Use stp timer hello to set the hello time.

Use undo stp timer hello to restore the default.

Syntax

stp [ vlan vlan-id-list ] timer hello time

undo stp [ vlan vlan-id-list ] timer hello

Default

The hello time is 200 centiseconds.

Views

System view

Predefined user roles

network-admin

Parameters

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094. If you set the STP, RSTP, or MSTP hello time, do not specify this option.

time: Sets the hello time in centiseconds, in the range of 100 to 1000 in increments of 100 (as in 100, 200, 300).

Usage guidelines

Hello time is the time interval at which spanning tree devices send configuration BPDUs to maintain the spanning tree. If a device fails to receive configuration BPDUs within the set period of time, a new spanning tree calculation process is triggered.

Do not set the hello time with this command. As a best practice, specify the network diameter of the switched network by using the stp bridge-diameter command. The stp bridge-diameter command makes the spanning tree protocols automatically calculate the optimal settings for the hello timer. If the network diameter uses the default value, the hello timer also uses the default value.

Examples

# In MSTP mode, set the hello time to 400 centiseconds.

<Sysname> system-view

[Sysname] stp timer hello 400

# In PVST mode, set the hello time for VLAN 2 to 400 centiseconds.

<Sysname> system-view

[Sysname] stp vlan 2 timer hello 400

Related commands

·     stp bridge-diameter

·     stp timer forward-delay

·     stp timer max-age

stp timer max-age

Use stp timer max-age to set the max age timer of the device.

Use undo stp timer max-age to restore the default.

Syntax

stp [ vlan vlan-id-list ] timer max-age time

undo stp [ vlan vlan-id-list ] timer max-age

Default

The max age is 2000 centiseconds.

Views

System view

Predefined user roles

network-admin

Parameters

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094. If you set the STP, RSTP, or MSTP max age, do not specify this option.

time: Sets the max age in centiseconds in the range of 600 to 4000 in increments of 100 (as in 600, 700, 800).

Usage guidelines

In the CIST of an MSTP network, the device determines whether a configuration BPDU received on a port has expired based on the max age timer. If the configuration BPDU has expired, a new spanning tree calculation process starts. The max age timer takes effect only on the CIST (or MSTI 0).

Do not set the max age timer with this command. As a best practice, specify the network diameter of the switched network by using the stp bridge-diameter command. The stp bridge-diameter command makes the spanning tree protocols automatically calculate the optimal settings for the max age timer. If the network diameter uses the default value, the max age timer also uses the default value.

Examples

# In MSTP mode, set the max age timer to 1000 centiseconds.

<Sysname> system-view

[Sysname] stp timer max-age 1000

# In PVST mode, set the max age timer for VLAN 2 to 1000 centiseconds.

<Sysname> system-view

[Sysname] stp vlan 2 timer max-age 1000

Related commands

·     stp bridge-diameter

·     stp timer forward-delay

·     stp timer hello

stp timer-factor

Use stp timer-factor to configure the timeout period by setting the timeout factor.

Timeout period = timeout factor × 3 × hello time.

Use undo stp timer-factor to restore the default.

Syntax

stp timer-factor factor

undo stp timer-factor

Default

The timeout factor of a device is set to 3.

Views

System view

Predefined user roles

network-admin

Parameters

factor: Sets the timeout factor in the range of 1 to 20.

Usage guidelines

In a stable network, each non-root-bridge forwards configuration BPDUs to surrounding devices at the interval of hello time to determine whether any link fails. If a device does not receive a BPDU from the upstream device within nine times of the hello time, it assumes that the upstream device has failed. Then it will start a new spanning tree calculation process.

As a best practice, set the timeout factor to 5, 6, or 7 in the following situations:

·     To prevent undesired spanning tree calculations. An upstream device might be too busy to forward configuration BPDUs in time, for example, many Layer 2 interfaces are configured on the upstream device. In this case, the downstream device fails to receive a BPDU within the timeout period and then starts an undesired spanning tree calculation.

·     To save network resources on a stable network.

Examples

# Set the timeout factor of the device to 7.

<Sysname> system-view

[Sysname] stp timer-factor 7

Related commands

stp timer hello

stp transmit-limit

Use stp transmit-limit to set the BPDU transmission rate of a port.

Use undo stp transmit-limit to restore the default.

Syntax

stp transmit-limit limit

undo stp transmit-limit

Default

The BPDU transmission rate of all ports is 10. Each port can send 10 BPDUs within each hello time.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Parameters

limit: Sets the BPDU transmission rate in the range of 1 to 255.

Usage guidelines

The maximum number of BPDUs a port can send within each hello time equals the BPDU transmission rate plus the hello timer value.

A larger BPDU transmission rate value requires more system resources. An appropriate BPDU transmission rate setting can prevent spanning tree protocols from using excessive bandwidth resources during network topology changes. As a best practice, use the default value.

When the command is configured in Layer 2 Ethernet interface view, it takes effect only on that interface.

When the command is configured in Layer 2 aggregate interface view, it takes effect only on the aggregate interface.

When the command is configured on a member port in an aggregation group, it takes effect only after the port leaves the aggregation group.

Examples

# Set the BPDU transmission rate of port Ten-GigabitEthernet 1/0/1 to 5.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] stp transmit-limit 5

stp transparent enable

Use stp transparent enable to enable BPDU transparent transmission on a port.

Use undo stp transparent enable to disable BPDU transparent transmission on a port.

Syntax

stp transparent enable

undo stp transparent enable

Default

The BPDU transparent transmission feature is disabled on a port.

Views

Layer 2 Ethernet interface view, Layer 2 aggregate interface view

Predefined user roles

network-admin

Usage guidelines

Whether the spanning tree protocols are enabled on a port does not affect the BPDU transparent transmission feature.

When a port is enabled with BPDU transparent transmission, its downstream port can receive the BPDUs generated by that port. This might cause network flapping. Before you enable BPDU transparent transmission on a port, disable the spanning tree protocols on that port as a best practice.

Examples

# Enable BPDU transparent transmission on a port.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] stp transparent enable

stp vlan enable

Use stp vlan enable to enable the spanning tree feature for VLANs.

Use undo stp enable to disable the spanning tree feature for VLANs.

Syntax

stp vlan vlan-id-list enable

undo stp vlan vlan-id-list enable

Default

The spanning tree feature is enabled for all VLANs.

Views

System view

Predefined user roles

network-admin

Parameters

vlan vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN or a range of VLANs in the form of vlan-id1 [ to vlan-id2 ]. The value for vlan-id2 must be equal to or greater than the value for vlan-id1. The value range for the vlan-id argument is 1 to 4094. If you do not specify this option, the command globally enables or disables the spanning tree feature (VLANs are not included).

Usage guidelines

When you enable the spanning tree feature, the device operates in STP, RSTP, PVST, or MSTP mode, depending on the spanning tree mode setting.

When you enable the spanning tree feature, the device dynamically maintains the spanning tree status of VLANs, based on received configuration BPDUs. When you disable the spanning tree feature, the device stops maintaining the spanning tree status.

Examples

# In PVST mode, globally enable the spanning tree feature, and enable the spanning tree feature in VLAN 2.

<Sysname> system-view

[Sysname] stp mode pvst

[Sysname] stp global enable

[Sysname] stp vlan 2 enable

Related commands

·     stp enable

·     stp global enable

·     stp mode

vlan-mapping modulo

Use vlan-mapping modulo to map VLANs in the MST region to MSTIs according to the specified modulo value and quickly create a VLAN-to-instance mapping table.

Syntax

vlan-mapping modulo modulo

Default

All VLANs are mapped to the CIST (MSTI 0).

Views

MST region view

Predefined user roles

network-admin

Parameters

modulo: Sets the modulo value in the range of 1 to 64.

Usage guidelines

You cannot map a VLAN to different MSTIs. If you map a VLAN that has been mapped to an MSTI to a new MSTI, the old mapping is automatically removed.

This command maps each VLAN to the MSTI with ID (VLAN ID – 1) % modulo + 1. (VLAN ID – 1) % modulo is the modulo operation for (VLAN ID – 1). If the modulo value is 15, then VLAN 1 is mapped to MSTI 1, VLAN 2 to MSTI 2, …, VLAN 15 to MSTI 15, VLAN 16 to MSTI 16, and so on.

Examples

# Map VLANs to MSTIs as per modulo 8.

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region] vlan-mapping modulo 8

Related commands

·     active region-configuration

·     check region-configuration

·     display stp region-configuration

·     region-name

·     revision-level