03-Layer 2 - LAN Switching Command Reference

HomeSupportResource CenterRoutersH3C SR8800 Series RoutersH3C SR8800Technical DocumentsCommandCommand ReferenceH3C SR8800 Command Reference-Release3347-6W10303-Layer 2 - LAN Switching Command Reference
03-Spanning Tree Commands
Title Size Download
03-Spanning Tree Commands 259.08 KB

active region-configuration

Syntax

active region-configuration

View

MST region view

Default level

2: System level

Parameters

None

Description

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

When you configure MST region–related parameters, MSTP launches a new spanning tree calculation process that may cause network topology instability. This is most likely to occur when you configure the VLAN-to-instance mapping table. The launch will occur only after the MST region–related parameters are activated with the active region-configuration command, or you enable the spanning tree feature with the stp enable command.

H3C recommends that you use the check region-configuration command to determine whether the MST region configurations to be activated are correct and that you run this command only if they are correct.

Related commands: instance, region-name, revision-level, vlan-mapping modulo, and check region-configuration.

Examples

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

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region] instance 1 vlan 2

[Sysname-mst-region] active region-configuration

check region-configuration

Syntax

check region-configuration

View

MST region view

Default level

2: System level

Parameters

None

Description

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

Two or more spanning tree routers belong to the same MST region only if they are configured to have the same format selector (0 by default, not configurable), MST region name, MST region revision level, and the same VLAN-to-instance mapping entries in the MST region, and if they are interconnected via a physical link.

H3C recommends that you use this command to determine whether the MST region configurations to be activated are correct and that you activate them only if they are correct.

Related commands: instance, region-name, revision-level, vlan-mapping modulo, and active region-configuration.

Examples

# View the pre-configuration information of the MST region.

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region] check region-configuration

 Admin configuration

   Format selector      :0

   Region name          :00e0fc62709d

   Revision level       :0

   Configuration digest :0x41b5018aca57daa8dcfdba2984d99d06

 

   Instance   Vlans Mapped

      0       1 to 4094

Table 1 Output description

Field

Description

Format selector

Format selector of the MST region. The value is 0 and 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.

 

display stp

Syntax

display stp [ instance instance-id ] [ interface interface-list | slot slot-number ] [ brief ] [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

instance instance-id: Displays the status and statistics of a particular MSTI. The instance-id argument ranges from 0 to 47, where 0 represents the common internal spanning tree (CIST).

interface interface-list: Displays the spanning tree status and statistics on the ports specified by a port list, in the format of interface-list = { interface-type interface-number [ to interface-type interface-number ] }&<1-10>, where &<1-10> indicates that you can specify up to 10 ports or port ranges.

slot slot-number: Displays the spanning tree status and statistics on the specified card. The slot-number argument represents the number of the slot that houses the card. If this parameter is not specified, the command displays the spanning tree status and statistics on all cards.

brief: Displays brief spanning tree status and statistics.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display stp command to view the spanning tree status and statistics.

Based on the spanning tree status and statistics, you can analyze and maintain the network topology or check whether spanning tree protocols are working normally.

In STP/RSTP mode:

·           If you do not specify any port, this command displays the spanning tree information for all ports. The displayed information is sorted by port name.

·           If you specify a port list, this command displays the spanning tree information for the specified ports. The displayed information is sorted by port name.

In MSTP mode:

·           If you do not specify any MSTI or port, this command displays the spanning tree information of all MSTIs on all ports. The displayed information is sorted by MSTI ID and by port name in each MSTI.

·           If you specify an MSTI but not a port, this command displays the spanning tree information on all ports in that MSTI. The displayed information is sorted by port name.

·           If you specify some ports but not an MSTI, this command displays the spanning tree information of all MSTIs on the specified ports. The displayed information is sorted by MSTI ID and by port name in each MSTI.

·           If you specify both an MSTI ID and a port list, this command displays the spanning tree information on the specified ports in the specified MSTI. The displayed information is sorted by port name.

The spanning tree status information includes the following information:

·           CIST global parameters:

¡  Protocol work mode

¡  Router priority in the CIST

¡  MAC address

¡  Hello time

¡  Max age

¡  Forward delay

¡  Maximum hops

¡  Common root bridge of the CIST

¡  External path cost from the router to the CIST common root

¡  Regional root

¡  Internal path cost from the router to the regional root

¡  CIST root port of the router

¡  Status of the BPDU guard function (enabled or disabled)

¡  Status of the Digest Snooping function

·           CIST port parameters:

¡  Port status

¡  Role

¡  Priority

¡  Path cost

¡  Designated bridge

¡  Designated port

¡  Edge port/non-edge port

¡  Connecting to a point-to-point link or not

¡  Maximum transmission rate (transmit limit)

¡  Status of the root guard function (enabled or disabled)

¡  BPDU format

¡  Boundary port/non-boundary port

¡  Hello time

¡  Max age

¡  Forward delay

¡  Message age

¡  Remaining hops

¡  Status of rapid state transition (enabled or disabled) for designated ports

·           MSTI global parameters:

¡  MSTI ID

¡  Bridge priority of the MSTI

¡  Regional root

¡  Internal path cost

¡  MSTI root port

¡  Master bridge

·           MSTI port parameters:

¡  Port status

¡  Role

¡  Priority

¡  Path cost

¡  Designated bridge

¡  Designated port

¡  Remaining hops

¡  Status of rapid state transition (enabled or disabled) for designated ports

The statistics include:

·           The number of TCN BPDUs, configuration BPDUs, RST BPDUs and MST BPDUs sent from each port

·           The number of TCN BPDUs, configuration BPDUs, RST BPDUs, MST BPDUs and wrong BPDUs received on each port

·           The number of BPDUs discarded on each port

Related commands: reset stp.

Examples

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

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

 MSTID      Port                         Role  STP State     Protection

   0        GigabitEthernet4/1/1         ALTE  DISCARDING    LOOP

   0        GigabitEthernet4/1/2         DESI  FORWARDING    NONE

   0        GigabitEthernet4/1/3         DESI  FORWARDING    NONE

   0        GigabitEthernet4/1/4         DESI  FORWARDING    NONE

Table 2 Output description

Field

Description

MSTID

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

Protection type on the port:

·       ROOT—Root guard.

·       LOOP—Loop guard.

·       BPDU—BPDU guard.

·       NONE—No protection.

 

# View the spanning tree status and statistics about interface Bridge-Aggregation 22.

<Sysname> display stp interface Bridge-Aggregation 22

 

----[CIST][Port2371(Bridge-Aggregation22)][DOWN]----

 Port Protocol       :enabled

 Port Role           :CIST Disabled Port

 Port Priority       :128

 Port Cost(Legacy)   :Config=auto / Active=200000

 Desg. Bridge/Port   :32768.000f-e250-8f7e / 128.2371

 Port Edged          :Config=disabled / Active=disabled

 Point-to-point      :Config=auto / Active=false

 Transmit Limit      :10 packets/hello-time

 Protection Type     :None

 MST BPDU Format     :Config=auto / Active=legacy

 Port Config-

 Digest-Snooping     :disabled

 Num of Vlans Mapped :1

 PortTimes           :Hello 2s MaxAge 20s FwDly 15s MsgAge 0s RemHop 20

 BPDU Sent           :0

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

 BPDU Received       :0

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

Table 3 Output description

Field

Description

Port Protocol

Indicates whether a spanning tree protocol is enabled on the port.

Port Role

Port role (Alternate, Backup, Root, Designated, Master, or Disabled).

Port Cost(Legacy)

Path cost of the port. The field in the bracket 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 that does not support port priority.

Port Edged

Indicates whether the port is an edge port.

·       Config—Configured value.

·       Active—Actual value.

Point-to-point

Indicates whether the port is connected to a point-to-point link.

·       Config—Configured value.

·       Active—Actual value.

Transmit Limit

The maximum number of packets sent within each hello time.

Protection Type

Protection type on the port:

·       RootRoot guard.

·       LoopLoop guard.

·       BPDU—BPDU guard.

·       None—No protection.

MST BPDU Format

Format of the MST BPDUs that the port can send, legacy or 802.1s.

·       Config—Configured value.

·       Active—Actual value.

Port Config-

Digest-Snooping

Indicates whether Digest Snooping is enabled on the port.

Num of Vlans Mapped

Number of VLANs mapped to the MSTI.

PortTimes

Major parameters for the port:

·       HelloHello timer.

·       MaxAgeMax Age timer.

·       FWDlyForward delay timer.

·       MsgAgeMessage Age timer.

·       Remain Hop—Remaining hops.

BPDU Sent

Statistics on sent BPDUs.

BPDU Received

Statistics on received BPDUs.

 

# View the brief spanning tree status and statistics on the router when spanning tree protocols are disabled.

<Sysname>display stp brief

 Protocol Status    :disabled

 Protocol Std.      :IEEE 802.1s

 Version            :0

 Bridge-Prio.       :32768

 MAC address        :0023-8957-b800

 Max age(s)         :20

 Forward delay(s)   :15

 Hello time(s)      :2

 Max hops           :20   

Table 4 Output description (the spanning tree protocols are disabled)

Field

Description

Protocol Status

Spanning tree protocol status.

Protocol Std.

Spanning tree protocol standard.

Version

Spanning tree protocol version.

Bridge-Prio.

The router’s priority in the CIST.

MAC address

MAC address of the router.

Max age(s)

Aging timer (in seconds) for BPDUs.

Forward delay(s)

Port state transition delay (in seconds).

Hello time(s)

Interval (in seconds) for the root bridge to send BPDUs.

Max hops

Maximum hops in the MSTI.

 

display stp abnormal-port

Syntax

display stp abnormal-port [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display stp abnormal-port command to view the information about ports blocked by spanning tree protection functions.

Examples

# Display information about ports blocked by spanning tree protection functions.

<Sysname> display stp abnormal-port

MSTID       Blocked Port                     Reason

  1         GigabitEthernet4/1/1             ROOT-Protected

  2         GigabitEthernet4/1/2             LOOP-Protected   

  2         GigabitEthernet4/1/3             Formatcompatibility–Protected

Table 5 Output description

Field

Description

MSTID

ID of the MSTI to which a port blocked by spanning tree protection functions belongs.

Blocked Port

Name of a blocked port.

Reason

Reason that caused abnormal blocking of the port:

·       ROOT-Protected—Root guard function.

·       LOOP-Protected—Loop guard function.

·       Formatcompatibility-Protected—MSTP BPDU format incompatibility protection function.

·       InconsistentPortType-Protected—Port type inconsistent protection function.

·       InconsistentPvid-Protected—PVID inconsistent protection function.

 

display stp bpdu-statistics

Syntax

display stp bpdu-statistics [ interface interface-type interface-number [ instance instance-id ] ] [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

interface interface-type interface-number: Displays the BPDU statistics on a specified port, where interface-type interface-number indicates the port type and number.

instance instance-id: Displays the BPDU statistics of a specified MSTI on a specified port. The instance-id argument ranges from 0 to 47, where 0 represents the CIST.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

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

In MSTP mode:

·           If you do not specify any MSTI or port, this command displays the BPDU statistics of all MSTIs on all ports. The displayed information is sorted by port name and by MSTI ID on each port.

·           If you specify a port but not an MSTI, this command displays the BPDU statistics of all MSTIs on the specified port. The displayed information is sorted by MSTI ID.

·           If you specify both an MSTI ID and a port, this command displays the BPDU statistics of a specified MSTI on a specified port.

In STP/RSTP mode:

·           If you do not specify any port, this command displays the BPDU statistics of on all ports. The displayed information is sorted by port name.

·           If you specify a port, this command displays the BPDU statistics on the port.

Examples

# Display the BPDU statistics of MSTI 1 on GigabitEthernet 2/1/1.

<Sysname> display stp bpdu-statistics interface gigabitethernet 2/1/1 instance 1

 Port: GigabitEthernet2/1/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/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

 

 Instance 1:

 

 Type                        Count      Last Updated

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

 Timeout BPDUs               0

 MAX-hoped BPDUs             0

 TC detected                 0

 TC sent                     0

 TC received                 0

Table 6 Output description

Field

Description

Port

Port name.

Instance-independent

Statistics not related to any particular MSTI.

Type

Statistical item.

Looped-back BPDUs

BPDUs that were looped back, that is, BPDUs that were sent and then received by the same port.

Max-Aged BPDUs

BPDUs whose max age was exceeded.

TCN Sent

TCN BPDUs sent.

TCN Received

TCN BPDUs received.

TCA Sent

TCA BPDUs sent.

TCA Received

TCA BPDUs received.

Config Sent

Configuration BPDUs sent.

Config Received

Configuration BPDUs received.

RST Sent

RSTP BPDUs sent.

RST Received

RSTP BPDUs received.

MST Sent

MSTP BPDUs sent.

MST Received

MSTP BPDUs received.

Instance

Statistical information for a particular MSTI.

Timeout BPDUs

Expired BPDUs.

Max-Hoped BPDUs

BPDUs whose maximum hops were exceeded.

TC Detected

TC BPDUs detected.

TC Sent

TC BPDUs sent.

TC Received

TC BPDUs received.

 

display stp down-port

Syntax

display stp down-port [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display stp down-port command to display information about the ports shut down by spanning tree protection functions.

Examples

# Display information about the ports shut down by spanning tree protection functions.

<Sysname> display stp down-port

Down Port                            Reason

GigabitEthernet4/1/1              BPDU-Protected

GigabitEthernet4/1/2              Formatfrequency-Protected

Table 7 Output description

Field

Description

Down Port

Name of a port shut down by the spanning tree protection functions.

Reason

Reason that caused the port was shut down.

·       BPDU-Protected—BPDU guard function.

·       Formatfrequency-Protected—MSTP BPDU format frequent change protection function.

 

display stp history

Syntax

display stp [ instance instance-id ] history [ slot slot-number ] [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

0: Visit level

Parameters

instance instance-id: Displays the historical port role calculation information of a particular MSTI. The instance-id argument ranges from 0 to 47, where 0 represents the CIST.

slot slot-number: Displays the historical port role calculation information on the specified card. slot-number represents the number of the slot that houses the card.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display stp history command to view the historical port role calculation information of the specified MSTI or all MSTIs.

If you do not specify an MSTI ID, this command displays the historical port role calculation information of all MSTIs. The displayed information is sorted by MSTI ID and by port role calculation time in each MSTI.

If you specify an MSTI ID, this command displays the historical port role calculation information of only this specified MSTI by the sequence of port role calculation time.

Examples

# View the historical port role calculation information of the card on slot 1 in MSTI 2.

<Sysname> display stp instance 2 history slot 1

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

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

 Port GigabitEthernet4/1/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

 

 Port GigabitEthernet4/1/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

Table 8 Output description

Field

Description

Port

Port name

Role change

A role change of the port (“Age” means that the change was caused by expiry of the received configuration BPDU)

Time

Time of port role calculation

Port priority

Port priority

 

display stp ignored-vlan

Syntax

display stp ignored-vlan [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display stp ignored-vlan command to display VLAN Ignore-enabled VLANs.

Examples

# Display VLAN Ignore-enabled VLANs.

<Sysname> display stp ignored-vlan

STP-Ignored VLAN: 1 to 2

Table 9 Output description

Field

Description

STP-Ignored VLAN

List of VLAN Ignore-enabled VLANs. A value of NONE for this field indicates that no VLAN is enabled with the VLAN Ignore feature.

 

display stp region-configuration

Syntax

display stp region-configuration [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display stp region-configuration command to view the effective configuration information of the MST region, including the region name, revision level, and user-configured VLAN-to-instance mappings.

Related commands: instance, region-name, revision-level, and vlan-mapping modulo.

Examples

# View the effective MST region configuration information.

<Sysname> display stp region-configuration

 Oper configuration

   Format selector      :0

   Region name          :00e0fc62709d

   Revision level       :0

   Configuration digest :0x5f762d9a46311effb7a488a3267fca9f

   Instance   Vlans Mapped

      0       1 to 4094

Table 10 Output description

Field

Description

Format selector

Format selector 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. It can be configured by using the revision-level command and the default value is 0.

Instance   Vlans Mapped

VLAN-to-instance mappings in the MST region.

 

display stp root

Syntax

display stp root [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display stp root command to view the root bridge information of all MSTIs.

Examples

# View the root bridge information of all MSTIs.

<Sysname> display stp root

MSTID    Root Bridge ID       ExtPathCost  IntPathCost     Root Port

0        0.0013.1923.da80         0              0  

Table 11 Output description

Field

Description

Root Bridge ID

Root bridge ID, comprising the bridge priority and the MAC address

ExtPathCost

External path cost. The router can automatically calculate the default path cost of a port, or alternatively, you can use the stp cost command to configure the path cost of a port.

IntPathCost

Internal path cost. The router can automatically calculate the default path cost of a port, or alternatively, you can use the stp cost command to configure the path cost of a port.

Root Port

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

 

display stp tc

Syntax

display stp [ instance instance-id ] tc [ slot slot-number ] [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

0: Visit level

Parameters

instance instance-id: Displays the statistics of TC/TCN BPDUs received and sent by all ports in the specified MSTI. The instance-id argument ranges from 0 to 47, where 0 represents the CIST.

slot slot-number: Displays the statistics of TC/TCN BPDUs received and sent by all ports in the specified MSTI on the specified card. slot-number represents the number of the slot that houses the card.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display stp tc command to view the statistics of TC/TCN BPDUs received and sent by all ports in an MSTI or all MSTIs.

If you do not specify an MSTI ID, this command displays the statistics of TC/TCN BPDUs received and sent by all ports in all MSTIs. The displayed information is sorted by MSTI ID and by port name in each MSTI.

If you specify an MSTI ID, this command displays the statistics of TC/TCN BPDUs received and sent by all ports in the specified MSTI, in port name order.

Examples

# View the statistics of TC/TCN BPDUs received and sent by all ports on the card on slot 1 in MSTI 0.

<Sysname> display stp instance 0 tc slot 1

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

 MSTID      Port                       Receive      Send

   0        GigabitEthernet4/1/1          6          4

   0        GigabitEthernet4/1/2          0          2

Table 12 Output description

Field

Description

MSTID

MSTI ID

Port

Port name

Receive

Number of TC/TCN BPDUs received on each port

Send

Number of TC/TCN BPDUs sent by each port

 

instance

Syntax

instance instance-id vlan vlan-list

undo instance instance-id [ vlan vlan-list ]

View

MST region view

Default level

2: System level

Parameters

instance-id: MSTI ID. The value ranges from 0 to 47, where 0 represents the CIST.

vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id2 ] }&<1-10>, where vlan-id represents the VLAN ID ranging from 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.

Description

Use the instance command to map the specified VLANs to the specified MSTI.

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

By default, all VLANs are mapped to the CIST.

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

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

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

Related commands: display stp region-configuration, check region-configuration, and active region-configuration.

Examples

# Map VLAN 2 to MSTI 1.

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region] instance 1 vlan 2

region-name

Syntax

region-name name

undo region-name

View

MST region view

Default level

2: System level

Parameters

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

Description

Use the region-name command to configure the MST region name.

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

By default, the MST region name of a router is its MAC address.

The MST region name, the VLAN-to-instance mapping table and the MSTP revision level of a router determine the MST region to which the router belongs.

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

Related commands: instance, revision-level, vlan-mapping modulo, display stp region-configuration, check region-configuration, and active region-configuration.

Examples

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

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region] region-name hello

reset stp

Syntax

reset stp [ interface interface-list ]

View

User view

Default level

1: Monitor level

Parameters

interface interface-list: Clears the spanning tree statistics on the Ethernet ports specified in the format of interface-list = { interface-type interface-number [ to interface-type interface-number ] }&<1-10>, where &<1-10> indicates that you can specify up to 10 ports or port ranges.

Description

Use the reset stp command to clear the spanning tree statistics.

The spanning tree statistics includes the numbers of TCN BPDUs, configuration BPDUs, RST BPDUs and MST BPDUs sent/received through the specified ports.

This command clears the spanning tree-related statistics on the specified ports if you specify the interface-list argument; otherwise, this command clears the spanning tree-related statistics on all ports.

Related commands: display stp.

Examples

# Clear the spanning tree statistics on Ethernet ports GigabitEthernet 4/1/1 through GigabitEthernet 4/1/3.

<Sysname> reset stp interface GigabitEthernet 4/1/1 to GigabitEthernet 4/1/3

revision-level

Syntax

revision-level level

undo revision-level

View

MST region view

Default level

2: System level

Parameters

level: MSTP revision level, ranging from 0 to 65535.

Description

Use the region-level command to configure the MSTP revision level.

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

By default, the MSTP revision level is 0.

The MSTP revision level, the MST region name and the VLAN-to-instance mapping table of a router determine the MST region to which the router belongs. When the MST region name and VLAN-to-instance mapping table are both the same for two MST regions, you can still tell them apart by their MSTP revision levels.

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

Related commands: instance, region-name, vlan-mapping modulo, display stp region-configuration, check region-configuration, and active region-configuration.

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

stp bpdu-protection

Syntax

stp bpdu-protection

undo stp bpdu-protection

View

System view

Default level

2: System level

Parameters

None

Description

Use the stp bpdu-protection command to enable the BPDU guard function for the router.

Use the undo stp bpdu-protection command to disable the BPDU guard function.

By default, the BPDU guard function is disabled.

Examples

# Enable the BPDU guard function for the router.

<Sysname> system-view

[Sysname] stp bpdu-protection

stp bridge-diameter

Syntax

stp bridge-diameter diameter

undo stp bridge-diameter

View

System view

Default level

2: System level

Parameters

diameter: Specifies the switched network diameter, ranging from 2 to 7.

Description

Use the stp bridge-diameter command to specify the network diameter, namely the maximum possible number of stations between any two terminal devices on the switched network.

Use the undo stp bridge-diameter command to restore the default.

By default, the network diameter of the switched network is 7.

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 timer are also set to their defaults.

Each MST region is considered as a device, and the configured network diameter of the switched network is only effective for the CIST (or the common root bridge), not for MSTIs.

Related commands: stp timer forward-delay, stp timer hello, and stp timer max-age.

Examples

# Set the network diameter of the switched network to 5.

<Sysname> system-view

[Sysname] stp bridge-diameter 5

stp compliance

Syntax

stp compliance { auto | dot1s | legacy }

undo stp compliance

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

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

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

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

Description

Use the stp compliance command to configure the mode the specified ports will use to recognize and send MSTP BPDUs.

Use the undo stp compliance command to restore the default.

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

Configured in Ethernet interface view, the setting takes effect on the interface only.

Configured in port group view, the setting takes effect on all ports in the port group.

Configured in Layer 2 aggregate interface view, the setting takes effect only on the aggregate interface. Configured on a member port in an aggregation group, the setting can take effect only after the port leaves the aggregation group.

Examples

# Configure port GigabitEthernet 4/1/1 to receive and send only standard-format (802.1s) MSTP packets.

<Sysname> system-view

[Sysname] interface GigabitEthernet 4/1/1

[Sysname-GigabitEthernet4/1/1] stp compliance dot1s

stp config-digest-snooping

Syntax

stp config-digest-snooping

undo stp config-digest-snooping

View

System view, Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

None

Description

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

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

The feature is disabled by default.

Configured in system view, the setting takes effect globally.

Configured in interface view, the setting takes effect on the interface only.

Configured in port group view, the setting takes effect on all ports in the port group.

Configured in Layer 2 aggregate interface view, the setting takes effect only on the aggregate interface. Configured on a member port in an aggregation group, the setting can take effect only after the port leaves the aggregation group.

You must enable this feature both globally and on ports connected to third-party network devices to make it take effect. H3C recommends that you enable the feature on all associated ports first and then globally, thus making all configured ports take effect at the same time to minimize the impact on the network.

Related commands: display stp.

Examples

# Enable Digest Snooping on port GigabitEthernet 4/1/1 and then globally.

<Sysname> system-view

[Sysname] interface GigabitEthernet 4/1/1

[Sysname-GigabitEthernet4/1/1] stp config-digest-snooping

[Sysname-GigabitEthernet4/1/1] quit

[Sysname] stp config-digest-snooping

stp cost

Syntax

stp [ instance instance-id ] cost cost

undo stp [ instance instance-id ] cost

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

instance instance-id: Sets the path cost of the ports in a particular MSTI. The instance-id argument ranges from 0 to 47, where 0 represents the CIST.

cost: Path cost of the port, with an effective range of that depends on the path cost calculation standard adopted.

·           With the IEEE 802.1d-1998 standard selected for path cost calculation, the cost argument ranges from 1 to 65535.

·           With the IEEE 802.1t standard selected for path cost calculation, the cost argument ranges from 1 to 200000000.

·           With the private standard selected for path cost calculation, the cost argument ranges from 1 to 200000.

Description

Use the stp cost command to set the path cost of the ports in the specified MSTI or all MSTIs.

Use the undo stp cost command to restore the default.

By default, the router automatically calculates the path costs of ports in each MSTI based on the corresponding standard.

Configured in Ethernet interface view, the setting takes effect on the interface only.

Configured in port group view, the setting takes effect on all ports in the port group.

Configured in Layer 2 aggregate interface view, the setting takes effect only on the aggregate interface. Configured on a member port in an aggregation group, the setting can take effect only after the port leaves the aggregation group.

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, thus achieving 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, MSTP will re-compute the role of the port and initiate a state transition.

Related commands: display stp and stp pathcost-standard.

Examples

# Set the path cost of port GigabitEthernet 4/1/3 in MSTI 2 to 200.

<Sysname> system-view

[Sysname] interface GigabitEthernet 4/1/3

[Sysname-GigabitEthernet4/1/3] stp instance 2 cost 200

stp edged-port

Syntax

stp edged-port { enable | disable }

undo stp edged-port

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

enable: Configures the ports as edge ports.

disable: Configures the ports as non-edge ports.

Description

Use the stp edged-port enable command to configure the ports as edge ports.

Use the stp edged-port disable command to configure the ports as non-edge ports.

Use the undo stp edged-port command to restore the default.

By default, all ports are non-edge ports.

Configured in Ethernet interface view, the setting takes effect on the interface only.

Configured in port group view, the setting takes effect on all ports in the port group.

Configured in Layer 2 aggregate interface view, the setting takes effect only on the aggregate interface. Configured on a member port in an aggregation group, the setting can take effect only after the port leaves the aggregation group.

If a port directly connects to a user terminal rather than another bridge or a shared LAN segment, this port is regarded as an edge port. When the network topology changes, an edge port will not cause a temporary loop. Therefore, configuring a port as an edge port can enable the port to transition to the forwarding state rapidly. H3C recommends that you configure a port directly connecting to a user terminal as an edge port to enable it to transition to the forwarding state rapidly.

Normally, configuration BPDUs from other bridges will not be received by an edge port because it does not connect to any other bridge. Before the BPDU guard function is enabled, if a port receives a configuration BPDU, the port is working actually as a non-edge port even if you have configured it as an edge port.

Among loop guard, root guard and edge port settings, only one function (whichever is configured the earliest) can take effect on a port at the same time.

Related commands: stp loop-protection and stp root-protection.

Examples

# Configure GigabitEthernet 4/1/1 as an edge port.

<Sysname> system-view

[Sysname] interface GigabitEthernet 4/1/1

[Sysname-GigabitEthernet4/1/1] stp edged-port enable

stp enable

Syntax

stp enable

undo stp enable

View

System view, Ethernet interface view, Layer 2 aggregate interface view, port group view

Default level

2: System level

Parameters

None

Description

Use the stp command to enable the spanning tree feature globally or on ports.

Use the undo stp command to disable the spanning tree feature globally or on ports.

By default, the spanning tree feature is enabled on all ports and disabled globally.

After you enable the spanning tree feature, the router determines whether to work in STP-compatible mode, RSTP mode, or MSTP mode according to your MSTP work mode setting. When the spanning tree feature is disabled, the router becomes a transparent bridge.

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

Configured in system view, the setting is effective for the router globally.

Configured in Ethernet interface view, the setting is effective on the port only.

Configured in port group view, the setting is effective on all ports in the port group.

Configured in Layer 2 aggregate interface view, the setting takes effect only on the aggregate interface. Configured on the member port in an aggregation group, the setting can take effect only after the port leaves the aggregation group.

Related commands: stp mode.

Examples

# In MSTP mode, enable the spanning tree feature globally.

<Sysname> system-view

[Sysname] stp enable

# In MSTP mode, disable the spanning tree feature on GigabitEthernet 4/1/1.

<Sysname> system-view

[Sysname] interface GigabitEthernet 4/1/1

[Sysname-GigabitEthernet4/1/1] stp disable

stp ignored vlan

Syntax

stp ignored vlan vlan-list

undo stp ignored vlan vlan-list

View

System view

Default level

2: System level

Parameters

vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id2 ] }&<1-10>, where vlan-id represents the VLAN ID ranging from 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.

Description

Use the stp ignored vlan command to enable VLAN Ignore for the specified VLANs.

Use the undo stp ignored vlan command to disable VLAN Ignore for the specified VLANs.

By default, VLAN Ignore is disabled for a VLAN.

Related commands: display stp ignored-vlan.

Examples

# Enable VLAN Ignore for VLAN 2.

<Sysname> system-view

[Sysname] stp ignored vlan 2

# Enable VLAN Ignore for VLANs 1 through 10.

[Sysname] stp ignored vlan 1 to 10

stp loop-protection

Syntax

stp loop-protection

undo stp loop-protection

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

None

Description

Use the stp loop-protection command to enable the loop guard function on the ports.

Use the undo stp loop-protection command to restore the default.

By default, the loop guard function is disabled.

Configured in Ethernet interface view, the setting takes effect on the interface only.

Configured in port group view, the setting takes effect on all ports in the port group.

Configured in Layer 2 aggregate interface view, the setting takes effect only on the aggregate interface. Configured on a member port in an aggregation group, the setting can take effect only after the port leaves the aggregation group.

Among loop guard, root guard and edge port settings, only one function (whichever is configured the earliest) can take effect on a port at any point in time.

Related commands: stp edged-port and stp root-protection.

Examples

# Enable the loop guard function on GigabitEthernet 4/1/1.

<Sysname> system-view

[Sysname] interface GigabitEthernet 4/1/1

[Sysname-GigabitEthernet4/1/1] stp loop-protection

stp max-hops

Syntax

stp max-hops hops

undo stp max-hops

View

System view

Default level

2: System level

Parameters

hops: Maximum hops, ranging from 1 to 40.

Description

Use the stp max-hops command to set the maximum hops of the MST region.

Use the undo stp max-hops command to restore the maximum hops to the default setting.

By default, the maximum number of hops of an MST region is 20.

Setting the maximum hops of MST regions is to limit the sizes of MST regions.

Related commands: display stp.

Examples

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

<Sysname> system-view

[Sysname] stp max-hops 35

stp mcheck

Syntax

stp mcheck

View

System view, Ethernet interface view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

None

Description

Use the stp mcheck command to perform the mCheck operation globally or on the port.

If a port on a bridge running MSTP (or RSTP) connects to a bridge running STP, this port will automatically migrate to the STP-compatible mode. However, it will not be able to migrate automatically back to the MSTP (or RSTP) mode, but will remain working in the STP-compatible mode under the following circumstances:

·           The bridge running STP is shut down or removed.

·           The bridge running STP migrates to the MSTP (or RSTP) mode.

Then you can perform an mCheck operation to force the port to migrate to the MSTP (or RSTP) mode.

The router works in STP-compatible mode, RSTP mode or MSTP mode depending on the spanning tree work mode.

The stp mcheck command is effective only when the router works in RSTP or MSTP mode.

Configured in system view, the setting takes effect globally.

Configured in Ethernet interface view, the setting takes effect on the interface only.

Configured in Layer 2 aggregate interface view, the setting takes effect only on the aggregate interface. Configured on a member port in an aggregation group, the setting can take effect only after the port leaves the aggregation group.

Related commands: stp mode.

Examples

# Perform mCheck on GigabitEthernet 4/1/1.

<Sysname> system-view

[Sysname] interface GigabitEthernet 4/1/1

[Sysname-GigabitEthernet4/1/1] stp mcheck

stp mode

Syntax

stp mode { stp | rstp | mstp }

undo stp mode

View

System view

Default level

2: System level

Parameters

stp: Configures the MSTP-enabled router to work in STP-compatible mode.

rstp: Configures an MSTP-enabled router to work in RSTP mode.

mstp: Configures an MSTP-enabled router to work in MSTP mode.

Description

Use the stp mode command to configure the spanning tree work mode of the router.

Use the undo stp mode command to restore the default.

By default, an MSTP-enabled router works in MSTP mode.

Related commands: stp mcheck and stp enable.

Examples

# Configure the MSTP-enabled router to work in STP-compatible mode.

<Sysname> system-view

[Sysname] stp mode stp

stp no-agreement-check

Syntax

stp no-agreement-check

undo stp no-agreement-check

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

None

Description

Use the stp no-agreement-check command to enable No Agreement Check on the ports.

Use the undo stp no-agreement-check command to disable No Agreement Check on the ports.

By default, No Agreement Check is disabled.

Configured in Ethernet interface view, the setting takes effect on the interface only.

Configured in port group view, the setting takes effect on all member ports in the port group.

Configured in Layer 2 aggregate interface view, the setting takes effect only on the aggregate interface. Configured on a member port in an aggregation group, the setting can take effect only after the port leaves the aggregation group.

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

Examples

# Enable No Agreement Check on GigabitEthernet 4/1/1.

<Sysname> system-view

[Sysname] interface GigabitEthernet 4/1/1

[Sysname-GigabitEthernet4/1/1] stp no-agreement-check

stp pathcost-standard

Syntax

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

undo stp pathcost-standard

View

System view

Default level

2: System level

Parameters

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

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

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

Description

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

Use the undo stp pathcost-standard command to restore the default.

By default, the router uses a private standard to calculate the default path cost for ports.

If you change the standard that the router uses in calculating the default path costs, you restore the path costs to the default value based on the current standard.

Related commands: stp cost and display stp.

Examples

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

<Sysname> system-view

[Sysname] stp pathcost-standard dot1d-1998

stp point-to-point

Syntax

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

undo stp point-to-point

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

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.

Description

Use the stp point-to-point command to configure the link type of the ports.

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

The default setting is auto, which specifies that the MSTP-enabled router automatically detects whether a port connects to a point-to-point link.

Configured in Ethernet interface view, the setting takes effect on the interface only.

Configured in port group view, the setting takes effect on all member ports in the port group.

Configured in Layer 2 aggregate interface view, the setting takes effect only on the aggregate interface. Configured on a member port in an aggregation group, the setting can take effect only after the port leaves the aggregation group.

When connecting to a non-point-to-point link, a port cannot perform rapid state transition.

You can configure the link type as point-to-point for a Layer 2 aggregate interface or a port that works in full duplex mode. H3C recommends that you use the default setting to let the router automatically detect the port link type.

The stp point-to-point force-false or stp point-to-point force-true command configured on a port in MSTP mode is effective for all MSTIs.

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

Related commands: display stp.

Examples

# Configure the link connecting GigabitEthernet 4/1/3 as a point-to-point link.

<Sysname> system-view

[Sysname] interface GigabitEthernet 4/1/3

[Sysname-GigabitEthernet4/1/3] stp point-to-point force-true

stp port priority

Syntax

stp [ instance instance-id ] port priority priority

undo stp [ instance instance-id ] port priority

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

instance instance-id: Sets the priority of the ports in a particular MSTI. The instance-id argument ranges from 0 to 47, where 0 represents the CIST.

priority: Port priority, ranging from 0 to 240 in steps of 16 (as in 0, 16, 32).

Description

Use the stp port priority command to set the priority of the ports.

Use the undo stp port priority command to restore the default.

Port priority affects the role of a port in an MSTI.

By default, the port priority is 128.

Configured in Ethernet interface view, the setting takes effect on the interface only.

Configured in port group view, the setting takes effect on all ports in the port group.

Configured in Layer 2 aggregate interface view, the setting takes effect only on the aggregate interface. Configured on a member port in an aggregation group, the setting can take effect only after the port leaves the aggregation group.

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

If you execute this command without specifying instance instance-id, this command applies to the CIST only.

Related commands: display stp.

Examples

# Set the priority of port GigabitEthernet 4/1/3 in MSTI 2 to 16.

<Sysname> system-view

[Sysname] interface GigabitEthernet 4/1/3

[Sysname-GigabitEthernet4/1/3] stp instance 2 port priority 16

stp priority

Syntax

stp [ instance instance-id ] priority priority

undo stp [ instance instance-id ] priority

View

System view

Default level

2: System level

Parameters

instance instance-id: Sets the priority of the router in a particular MSTI. The instance-id argument ranges from 0 to 47, where 0 represents the CIST.

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

Description

Use the stp priority command to set the priority of the router.

Use the undo stp priority command to restore the default router priority.

By default, the router priority is 32768.

Executed with an MSTI specified, the command sets the priority of the router in the specified MSTI. Executed without any MSTI specified, the command sets the priority of the router in the CIST.

Examples

# Set the router priority in MSTI 1 to 4096.

<Sysname> system-view

[Sysname] stp instance 1 priority 4096

stp region-configuration

Syntax

stp region-configuration

undo stp region-configuration

View

System view

Default level

2: System level

Parameters

None

Description

Use the stp region-configuration command to enter MST region view.

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

By default, the default settings are used for all the three MST region parameters. Namely, the router’s MST region name is the router’s MAC address, all VLANs are mapped to the CIST, and the MSTP revision level is 0.

After you enter MST region view, you can configure the MST region-related settings, 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 root primary

Syntax

stp [ instance instance-id ] root primary

undo stp [ instance instance-id ] root

View

System view

Default level

2: System level

Parameters

instance instance-id: Configures the router as the root bridge in a particular MSTI. The instance-id argument ranges from 0 to 47, where 0 represents the CIST.

Description

Use the stp root primary command to configure the router as the root bridge.

Use the undo stp root command to restore the default.

By default, a router is not a root bridge.

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

Executed with an MSTI specified, the command configures the router as the root bridge in the specified MSTI. Executed without any MSTI specified, the command configured the router as the root bridge in the CIST.

Related commands: stp priority and stp root secondary.

Examples

# Specify the router as the root bridge of MSTI 0.

<Sysname> system-view

[Sysname] stp instance 0 root primary

stp root secondary

Syntax

stp [ instance instance-id ] root secondary

undo stp [ instance instance-id ] root

View

System view

Default level

2: System level

Parameters

instance instance-id: Configures the router as a secondary root bridge in a particular MSTI. The instance-id argument ranges from 0 to 47, where 0 represents the CIST.

Description

Use the stp root secondary command to configure the router as a secondary root bridge.

Use the undo stp root command to restore the default.

By default, a router is not a secondary root bridge.

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

Executed with an MSTI specified, the command configures the router as a secondary root bridge in the specified MSTI. Executed without any MSTI specified, the command configured the router as a secondary root bridge in the CIST.

Related commands: stp priority and stp root primary.

Examples

# Specify the router as a secondary root bridge of MSTI 0.

<Sysname> system-view

[Sysname] stp instance 0 root secondary

stp root-protection

Syntax

stp root-protection

undo stp root-protection

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

None

Description

Use the stp root-protection command to enable the root guard function on the ports.

Use the undo stp root-protection command to restore the default.

By default, the root guard function is disabled.

Configured in Ethernet interface view, the setting takes effect on the interface only.

Configured in port group view, the setting takes effect on all ports in the port group.

Configured in Layer 2 aggregate interface view, the setting takes effect only on the aggregate interface. Configured on the member port in an aggregation group, the setting can take effect only after the port leaves the aggregation group.

Among loop guard, root guard and edge port settings, only one function (whichever is configured the earliest) takes effect on a port at the same time.

Examples

# Enable the root guard function for GigabitEthernet 4/1/1.

<Sysname> system-view

[Sysname] interface GigabitEthernet 4/1/1

[Sysname-GigabitEthernet4/1/1] stp root-protection

stp tc-protection

Syntax

stp tc-protection enable

stp tc-protection disable

View

System view

Default level

2: System level

Parameters

None

Description

Use the stp tc-protection enable command to enable the TC-BPDU guard function for the router.

Use the stp tc-protection disable command to disable the TC-BPDU guard function for the router.

By default, the TC-BPDU guard function is enabled.

Examples

# Disable the TC-BPDU guard function for the router.

<Sysname> system-view

[Sysname] stp tc-protection disable

stp tc-protection threshold

Syntax

stp tc-protection threshold number

undo stp tc-protection threshold

View

System view

Default level

2: System level

Parameters

number: Maximum number of immediate forwarding address entry flushes that the router can perform every a certain period of time (10 seconds). The value ranges from 1 to 255.

Description

Use the stp tc-protection threshold command to configure the maximum number of immediate forwarding address entry flushes that the router can perform every a certain period of time (10 seconds).

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

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

Examples

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

<Sysname> system-view

[Sysname] stp tc-protection threshold 10

stp timer forward-delay

Syntax

stp timer forward-delay time

undo stp timer forward-delay

View

System view

Default level

2: System level

Parameters

time: Forward delay in centiseconds, ranging from 400 to 3000 in steps of 100 (as in 400, 500, 600).

Description

Use the stp timer forward-delay command to set the forward delay timer of the router.

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

By default, the forward delay timer is 1500 centiseconds.

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 transitions from the discarding to the forwarding state. To stay synchronized with the remote device, the port has a wait period between transition states that is determined by the forward delay timer.

H3C does not recommend you to 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 and let spanning tree protocols automatically calculate optimal settings of the forward delay timer. If the network diameter uses the default value, the forward delay timer also uses the default value.

Related commands: stp timer hello, stp timer max-age, and stp bridge-diameter.

Examples

# Set the forward delay timer of the bridge to 2000 centiseconds.

<Sysname> system-view

[Sysname] stp timer forward-delay 2000

stp timer hello

Syntax

stp timer hello time

undo stp timer hello

View

System view

Default level

2: System level

Parameters

time: Hello time in centiseconds, ranging from 100 to 1000 in steps of 100 (as in 100, 200, 300).

Description

Use the stp timer hello command to set the hello time of the router.

Use the undo stp timer hello command to restore the default.

By default, the hello time is set to 200 centiseconds.

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

H3C does not recommend you to 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 and let spanning tree protocols automatically calculate optimal settings of the hello timer. If the network diameter uses the default value, the hello timer also uses the default value.

Related commands: stp timer forward-delay, stp timer max-age, and stp bridge-diameter.

Examples

# Set the hello time of the router to 400 centiseconds.

<Sysname> system-view

[Sysname] stp timer hello 400

stp timer max-age

Syntax

stp timer max-age time

undo stp timer max-age

View

System view

Default level

2: System level

Parameters

time: Max age in centiseconds, ranging from 600 to 4000 in steps of 100 (as in 600, 700, 800).

Description

Use the stp timer max-age command to set the max age timer of the router.

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

By default, the max age is set to 2000 centiseconds.

In the CIST of an MSTP network, the router determines whether a configuration BPDU received on a port has expired, based on the max age timer. If yes, a new spanning tree calculation process starts. The max age timer is ineffective for MSTIs.

H3C does not recommend you to 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 and let spanning tree protocols automatically calculate optimal settings of the max age timer. If the network diameter uses the default value, the max age timer also uses the default value.

Related commands: stp timer forward-delay, stp timer hello, and stp bridge-diameter.

Examples

# Set the max age timer of the router to 1000 centiseconds.

<Sysname> system-view

[Sysname] stp timer max-age 1000

stp timer-factor

Syntax

stp timer-factor factor

undo stp timer-factor

View

System view

Default level

2: System level

Parameters

factor: Timeout factor, ranging from 1 to 20.

Description

Use the stp timer-factor command to set the timeout factor, which decides the timeout time. Timeout time = timeout factor × 3 × hello time.

Use the undo stp timer-factor command to restore the default.

By default, the timeout factor is 3.

After the network topology is stabilized, each non-root bridge forwards configuration BPDUs to the surrounding bridges at the interval of hello time to check whether any link is faulty. Typically, if a bridge does not receive a BPDU from the upstream bridge within nine times the hello time, it will assume that the upstream bridge has failed and start a new spanning tree calculation process.

In a stable network, this kind of spanning tree calculation may occur because the upstream bridge is busy. In this case, you can avoid such unwanted spanning tree calculations by lengthening the timeout time, thus saving the network resources. H3C recommends that you set the timeout factor to 5, 6, or 7 for a stable network.

Related commands: stp timer hello.

Examples

# Set the timeout factor of the bridge to 7.

<Sysname> system-view

[Sysname] stp timer-factor 7

stp transmit-limit

Syntax

stp transmit-limit limit

undo stp transmit-limit

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

limit: Maximum number of BPDUs the ports can send within each hello time, ranging from 1 to 255.

Description

Use the stp transmit-limit command to set the maximum transmission rate of the ports.

Use the undo stp transmit-limit command to restore the default.

By default, the maximum transmission rate of all ports of the bridge is 10, that is, each port can send up to 10 BPDUs within each hello time.

Configured in Ethernet interface view, the setting takes effect on the interface only.

Configured in port group view, the setting takes effect on all member ports in the port group.

Configured in Layer 2 aggregate interface view, the setting takes effect only on the aggregate interface. Configured on a member port in an aggregation group, the setting can take effect only after the port leaves the aggregation group.

A higher maximum transmission rate value means that the port can send more BPDUs within each hello time, and requires more system resources. An appropriate maximum transmission rate setting can limit the speed at which a port sends BPDUs and prevent MSTP from using excessive bandwidth resources during network topology changes. H3C recommends that you use the default value.

Examples

# Set the maximum transmission rate of port GigabitEthernet 4/1/1 to 5.

<Sysname> system-view

[Sysname] interface GigabitEthernet 4/1/1

[Sysname-GigabitEthernet4/1/1] stp transmit-limit 5

vlan-mapping modulo

Syntax

vlan-mapping modulo modulo

View

MST region view

Default level

2: System level

Parameters

modulo: Modulo value. The value range of this argument is 1 to 47.

Description

Use the vlan-mapping modulo command to map VLANs in the MST region to MSTIs according to the specified modulo value, thus quickly creating a VLAN-to-instance mapping table.

By default, all VLANs are mapped to the CIST (MSTI 0).

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

This command maps each VLAN to the MSTI whose ID is (VLAN ID - 1) %modulo + 1, where (VLAN ID - 1) %modulo is the modulo operation for (VLAN ID - 1). If the modulo value is 15, for example, then VLAN 1 will be mapped to MSTI 1, VLAN 2 to MSTI 2, VLAN 15 to MSTI 15, VLAN 16 to MSTI 1, and so on.

Related commands: region-name, revision-level, display stp region-configuration, check region-configuration, and active region-configuration.

Examples

# Map VLANs to MSTIs as per modulo 8.

<Sysname> system-view

[Sysname] stp region-configuration

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