03-Layer 2-LAN Switching Command Reference

HomeSupportResource CenterH3C S6850 & S9850 Switch Series Command References-Release 655x-6W10103-Layer 2-LAN Switching Command Reference
13-Spanning tree commands
Title Size Download
13-Spanning tree commands 276.87 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 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 Twenty-FiveGigE 1/0/1.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/0/1] bpdu-drop any

check region-configuration

Use check region-configuration to display MST region pre-configuration information.

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.

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 detailed spanning tree status and statistics.

slot slot-number: Specifies an IRF member device by its member ID. If you do not specify a member device, this command displays information for 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.

Examples

# In MSTP mode, display the brief spanning tree status and statistics for MSTI 0 on port Twenty-FiveGigE 1/0/1.

<Sysname> display stp instance 0 interface Twenty-FiveGigE 1/0/1 brief

 MST ID      Port                         Role  STP State     Protection

 0           0           Twenty-FiveGigE1/0/1         ALTE  DISCARDING    LOOP

# In PVST mode, display the brief spanning tree status and statistics for VLAN 2 on port Twenty-FiveGigE 1/0/1.

<Sysname> system-view

[Sysname] stp mode pvst

[Sysname] display stp vlan 2 interface twenty-fivegige 1/0/1 brief

 VLAN ID     Port                         Role  STP State     Protection

 2           Twenty-FiveGigE1/0/1         ALTE  DISCARDING    LOOP

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.

If no spanning tree protection feature is configured or spanning tree protection is not triggered, this field displays NONE.

# 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.0001-0000-0000

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

 Root ID/ERPC        : 32768.0001-0000-0000, 0

 RegRoot ID/IRPC     : 32768.0001-0000-0000, 0

 RootPort ID         : 0.0

 BPDU-Protection     : Disabled

 Bridge Config-

 Digest-Snooping     : Disabled

 TC or TCN received  : 2

 Time since last TC  : 0 days 0h:0m:58s

 

----[Port1(Twenty-FiveGigE1/0/1)][FORWARDING]----

 Port protocol       : Enabled

 Port role           : Designated Port (Boundary)

 Port ID             : 128.3

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

 Desg.bridge/port    : 32768.0001-0000-0000, 128.3

 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=802.1s

 Port Config-

 Digest-Snooping     : Disabled

 Rapid transition    : True

 Num of VLANs mapped : 0

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

 BPDU sent           : 32

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

 BPDU received       : 2

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

 

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

 Bridge ID           : 32768.0001-0000-0000

 RegRoot ID/IRPC     : 32768.0001-0000-0000, 0

 RootPort ID         : 0.0

 Master bridge       : 32768.0001-0000-0000

 Cost to master      : 0

 TC received         : 0

 

----[Port1(Twenty-FiveGigE1/0/1)][FORWARDING]----

 Port protocol       : Enabled

 Port role           : Designated Port (Boundary)

 Port ID             : 128.3

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

 Desg.bridge/port    : 32768.0001-0000-0000, 128.3

 Protection type     : Config=none, Active=none

 Rapid transition    : True

 Num of VLANs mapped : 64

 Port times          : RemHops 20

# 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(Twenty-FiveGigE1/0/1)][FORWARDING]----

 Port protocol       : Enabled

 Port role           : Designated Port

 Port ID             : 128.153

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

 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 its 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.

·     MaxAge—Maximum age timer.

·     FwdDelay—Forward delay timer.

·     MaxHops—Maximum 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.

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

Maximum number of BPDUs sent by a port within each hello time.

Protection type

Whether spanning tree protection is configured on the port:

·     Config—Configured spanning tree protection feature.

·     Active—Effective spanning tree protection feature.

Spanning tree protection features are as follows:

·     ROOT—Root guard.

·     LOOP—Loop guard.

·     BPDU—BPDU guard.

·     PVST BPDU—PVST BPDU guard.

If no spanning tree protection feature is configured or spanning tree protection is not triggered, this field displays NONE.

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.

·     MaxAge—Maximum 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 port state transition 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: 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 port that is blocked by spanning tree protection features.

Examples

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

---[Twenty-FiveGigE1/0/1]---

    MST ID   BlockReason                     Time

    0        Root-Protected                  14:39:04 04/15/2016

    0        Root-Protected                  14:39:02 04/15/2016

    0        Root-Protected                  14:39:00 04/15/2016

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

---[Twenty-FiveGigE1/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 a blocked port.

VLAN ID

VLAN of a blocked port.

BlockReason

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 sent by itself.

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

·     InconsistentPortType-Protected—Inconsistent port type protection.

·     InconsistentPvid-Protected—Inconsistent PVID protection.

Time

Protection feature trigger time.

display stp bpdu-statistics

Use display stp bpdu-statistics to display the BPDU statistics for 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 Twenty-FiveGigE 1/0/1.

<Sysname> display stp bpdu-statistics interface twenty-fivegige 1/0/1

 Port: Twenty-FiveGigE1/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 Twenty-FiveGigE 1/0/1.

<Sysname> system-view

[Sysname] stp mode pvst

[Sysname] display stp bpdu-statistics interface twenty-fivegige 1/0/1

 Port: Twenty-FiveGigE1/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

 PVID inconsistency BPDUs    0

Table 5 Command output

Field

Description

Port

Port name.

Instance-Independent

Statistics not related to a specific MSTI.

Type

Statistical item.

Looped-back BPDUs

Number of BPDUs sent and then received by the same port.

Max-aged BPDUs

Number of BPDUs whose max age was exceeded.

TCN sent

Number of sent TCN BPDUs.

TCN received

Number of received TCN BPDUs.

TCA sent

Number of sent TCA BPDUs.

TCA received

Number of received TCA BPDUs.

Config sent

Number of sent configuration BPDUs.

Config received

Number of received configuration BPDUs.

RST sent

Number of sent RSTP BPDUs.

RST received

Number of received RSTP BPDUs.

MST sent

Number of sent MSTP BPDUs.

MST received

Number of received MSTP BPDUs.

Instance

Statistics for a specific MSTI.

Timeout BPDUs

Number of expired BPDUs.

Max-hoped BPDUs

Number of BPDUs whose maximum hops were exceeded.

TC detected

Number of detected topology changes.

TC sent

Number of sent TC BPDUs.

TC received

Number of received TC BPDUs.

PVID inconsistency BPDUs

Number of received PVST BPDUs with a PVID inconsistent with the incoming port.

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

 Twenty-FiveGigE1/0/1          BPDU protection

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 protection—Indicates the BPDU guard feature.

·     PVST BPDU protection—Indicates the PVST 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 you do not specify a member device, this command displays information for all member devices.

Usage guidelines

In STP or RSTP mode, the command 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 on the specified slot in MSTI 2.

<Sysname> display stp instance 2 history slot 1

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

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

Port Twenty-FiveGigE1/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 Twenty-FiveGigE1/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 on the specified slot in VLAN 2.

<Sysname> display stp vlan 2 history slot 1

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

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

 

 Port Twenty-FiveGigE1/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 Twenty-FiveGigE1/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.

Port priority

Port priority formed by the root bridge ID, root path cost, designated bridge ID, and designated port ID which are separated by spaces.

Designated priority

Designated priority formed by the root bridge ID, root path cost, designated bridge ID, and designated port ID which are separated by spaces.

display stp region-configuration

Use display stp region-configuration to display effective MST region configuration.

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           Twenty-FiveGigE1/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           Twenty-FiveGigE1/0/1

Table 9 Command output

Field

Description

ExtPathCost

External path cost. The path cost of a port is either automatically calculated by the device or manually configured by using the stp cost command.

IntPathCost

Internal path cost. The path cost of a port is either automatically calculated by the device or manually configured by using the stp cost command.

Root Port

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

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 you do not specify a member device, this command displays information for all member devices.

Usage guidelines

In STP or RSTP mode, the command 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 slot 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           Twenty-FiveGigE1/0/1       6            4

 0           Twenty-FiveGigE1/0/2       0            2

 

# In PVST mode, display the incoming and outgoing TC/TCN BPDU statistics for all ports on slot 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           Twenty-FiveGigE1/0/1       6            4

 2           Twenty-FiveGigE1/0/2       0            2

Table 10 Command output

Field

Description

Port

Port name.

Receive

Number of TC/TCN BPDUs received on a port.

Send

Number of TC/TCN BPDUs sent by a 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 do not specify any VLANs in the undo instance command, all VLANs mapped to the specified MSTI are remapped to the CIST.

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 deleted.

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 the 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, execute 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 the spanning tree statistics.

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 do not specify this option, this command clears the spanning tree statistics on all ports.

Examples

# Clear the spanning tree statistics on ports Twenty-FiveGigE 1/0/1 through Twenty-FiveGigE 1/0/3.

<Sysname> reset stp interface twenty-fivegige 1/0/1 to twenty-fivegige 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, execute 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 notifications 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 notifications 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

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 globally disabled.

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 set the network diameter. 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.

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

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 as a device. 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 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

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

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

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

Examples

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

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/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

For Digest Snooping to take effect, you must enable Digest Snooping both globally and on associated ports. As a best practice, first enable Digest Snooping on ports connected to third-party vendor devices and then enable the feature globally. Digest Snooping takes effect on the ports simultaneously, which reduces impact on the network.

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

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

If 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 Digest Snooping on Twenty-FiveGigE 1/0/1 and then globally.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/0/1] stp config-digest-snooping

[Sysname-Twenty-FiveGigE1/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-value

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-value: Specifies the path cost of the port, with an effective range that varies by 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.

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

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

If this 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 a port in the MSTP CIST or in the STP or RSTP spanning tree.

Examples

# In MSTP mode, set the path cost to 200 for Twenty-FiveGigE 1/0/1 in MSTI 2.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/0/1] stp instance 2 cost 200

# In PVST mode, set the path cost to 200 for Twenty-FiveGigE 1/0/1 in VLAN 2.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/0/1] stp vlan 2 cost 200

Related commands

display stp

stp pathcost-standard

stp dispute-protection

Use stp dispute-protection to enable dispute guard.

Use undo stp dispute-protection to disable dispute guard.

Syntax

stp dispute-protection

undo stp dispute-protection

Default

Dispute guard is enabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

Dispute guard blocks a port to prevent loops when a unidirectional link is detected on the port by the spanning tree feature.

In some VLAN networks, an uplink port on a downstream device is configured to deny packets from the PVID. As a result, the downstream device cannot receive BPDUs of the PVID from the upstream device. However, the upstream device can receive BPDUs from the downstream device. In this case, dispute guard blocks the receiving port on the upstream device, which causes traffic interruption.

To ensure service continuity and prevent the link from being blocked, you can disable dispute guard by using the undo stp dispute-protection command.

Examples

# Disable dispute guard.

<Sysname> system-view

[Sysname] undo stp dispute-protection

stp edged-port

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

Use undo stp edged-port to restore the default.

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.

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

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

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

Examples

# Configure Twenty-FiveGigE 1/0/1 as an edge port.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/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.

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

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

If this 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 Twenty-FiveGigE 1/0/1.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/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

For Digest Snooping to take effect, you must enable Digest Snooping both globally and on associated ports. As a best practice, first enable Digest Snooping on ports connected to third-party vendor devices and then enable the feature globally. Digest Snooping takes effect on the ports simultaneously, which reduces impact on the network.

Examples

# Enable Digest Snooping on Twenty-FiveGigE 1/0/1 and then globally.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/0/1] stp config-digest-snooping

[Sysname-Twenty-FiveGigE1/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

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

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

For more information about the initial settings and factory defaults, 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 mCheck 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 ignore-pvid-inconsistency

Use stp ignore-pvid-inconsistency to disable inconsistent PVID protection.

Use undo stp ignore-pvid-inconsistency to enable inconsistent PVID protection.

Syntax

stp ignore-pvid-inconsistency

undo stp ignore-pvid-inconsistency

Default

Inconsistent PVID protection is enabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

This command takes effect only when the device is operating in PVST mode.

Disabling inconsistent PVID protection might cause spanning tree calculation errors. To avoid such errors, make sure the following requirements are met:

·     Make sure the VLANs on one device do not use the same ID as the PVID of its peer port (except the default VLAN) on another device.

·     If the local port or its peer is a hybrid port, do not configure the local and peer ports as untagged members of the same VLAN.

·     Disable inconsistent PVID protection on both the local device and the peer device.

Examples

# In PVST mode, disable the inconsistent PVID protection feature.

<Sysname> system-view

[Sysname] stp mode pvst

[Sysname] stp ignore-pvid-inconsistency

stp log enable tc

Use stp log enable tc to enable the device to log events of detecting or receiving TC BPDUs.

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 logs when it detects or receives TC BPDUs.

Views

System view

Predefined user roles

network-admin

Usage guidelines

This command applies only to PVST mode.

Examples

# In PVST mode, enable the device to log events of detecting or receiving TC BPDUs.

<Sysname> system-view

[Sysname] stp log enable tc

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.

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

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

If 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 loop guard on Twenty-FiveGigE 1/0/1.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/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: Specifies 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 mCheck 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.

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

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

If this 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 Twenty-FiveGigE 1/0/1.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/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 port—The PVST mode is compatible with other modes in any VLAN.

·     Trunk or hybrid port—The PVST mode is compatible with other modes only in the default VLAN.

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.

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

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

If 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 No Agreement Check on Twenty-FiveGigE 1/0/1.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/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 default standard used by the device is legacy.

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 to let the device automatically detect the port link type.

In MSTP or PVST mode, the stp point-to-point force-false or stp point-to-point force-true command configured on a port takes effect on all MSTIs or VLANs.

Before you set the link type of a port to point-to-point, make sure the port is connected to a point-to-point link. Otherwise, a temporary loop might occur.

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

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

If this 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 type of Twenty-FiveGigE 1/0/1 as point-to-point.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/0/1] 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

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

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

If 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 Twenty-FiveGigE 1/0/1.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/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.

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

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

If this 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 port priority of Twenty-FiveGigE 1/0/1 to 16 in MSTI 2.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/0/1] stp instance 2 port priority 16

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

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/0/1] stp vlan 2 port priority 16

Related commands

display stp

stp port shutdown permanent

Use stp port shutdown permanent to disable the device from reactivating edge ports shut down by BPDU guard.

Use undo stp port shutdown permanent to restore the default.

Syntax

stp port shutdown permanent

undo stp port shutdown permanent

Default

The device reactivates an edge port shut down by BPDU guard after the port status detection timer expires.

Views

System view

Predefined user roles

network-admin

Usage guidelines

This command takes effect only on edge ports shut down by BPDU guard after this command is configured. The device does not bring up the shutdown ports if you execute the undo stp port shutdown permanent command. To bring up these ports, you must use the undo shutdown command.

For more information about the port status detection timer, see device management configuration in Fundamentals Configuration Guide.

Examples

# Disable the device from reactivating edge ports shut down by BPDU guard.

<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

Outputting port state transition information 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 Twenty-FiveGigE1/0/1 has been set to discarding state.

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

The output shows that Twenty-FiveGigE 1/0/1 in MSTI 2 transited to the discarding state and Twenty-FiveGigE 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 Twenty-FiveGigE1/0/1 has been set to discarding state.

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

The output shows that Twenty-FiveGigE 1/0/1 in VLAN 2 transited to the discarding state and Twenty-FiveGigE 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.

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 pvst-bpdu-protection

Use stp pvst-bpdu-protection to enable PVST BPDU guard.

Use undo stp pvst-bpdu-protection to disable PVST BPDU guard.

Syntax

stp pvst-bpdu-protection

undo stp pvst-bpdu-protection

Default

PVST BPDU guard is disabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

PVST BPDU guard enables an MSTP-enabled device to shut down a port if the port receives PVST BPDUs. The shutdown port is brought up after a detection timer expires. To set the detection timer, use the shutdown-interval command.

Examples

# In MSTP mode, enable PVST BPDU guard.

<Sysname> system-view

[Sysname] stp pvst-bpdu-protection

Related commands

shutdown-interval (For more information, see Fundamentals Command Reference.)

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 an MST region are as follows:

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

·     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 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.

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

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

If 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 port role restriction on Twenty-FiveGigE 1/0/1.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/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

The 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

The 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 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.

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

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

If 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 root guard on Twenty-FiveGigE 1/0/1.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/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 set 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 6 forwarding address entry flushes every 10 seconds.

Views

System view

Predefined user roles

network-admin

Parameters

number: Specifies 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 other ports. It also does not delete MAC address entries.

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

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

If 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 TC-BPDU transmission restriction on Twenty-FiveGigE 1/0/1.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/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: Specifies 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 that is determined by the forward delay timer between transition states.

As a best practice, do not set the forward delay with this command. Instead, you can specify the network diameter of the switched network by using the stp bridge-diameter command. This 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: Specifies 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 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.

As a best practice, do not set the hello time with this command. Instead, you can specify the network diameter of the switched network by using the stp bridge-diameter command. This 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.

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: Specifies 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).

As a best practice, do not set the max age timer with this command. Instead, you can specify the network diameter of the switched network by using the stp bridge-diameter command. This 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 the device is set to 3.

Views

System view

Predefined user roles

network-admin

Parameters

factor: Specifies 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.

Views

Layer 2 Ethernet interface view

Layer 2 aggregate interface view

Predefined user roles

network-admin

Parameters

limit: Specifies 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.

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

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

If this 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 Twenty-FiveGigE 1/0/1 to 5.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/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.

If this feature and the spanning tree protocol are enabled on a port which is inferior to its downstream port, the downstream port can receive BPDUs from that port. To prevent network flapping caused by this problem, disable the spanning tree protocol before you enable BPDU transparent transmission on the port.

Examples

# Enable BPDU transparent transmission on Twenty-FiveGigE 1/0/1.

<Sysname> system-view

[Sysname] interface twenty-fivegige 1/0/1

[Sysname-Twenty-FiveGigE1/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 in 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.

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 then enable the spanning tree feature for 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 an 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: Specifies the modulo value. The value range for this argument is 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 deleted.

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