- Table of Contents
-
- 02-Layer 2-LAN Switching Command Reference
- 00-Preface
- 01-Ethernet interface configuration commands
- 02-Loopback and null interface configuration commands
- 03-Bulk interface configuration commands
- 04-MAC address table configuration commands
- 05-Ethernet link aggregation configuration commands
- 06-Port isolation configuration commands
- 07-Spanning tree configuration commands
- 08-BPDU tunneling configuration commands
- 09-VLAN configuration commands
- 10-GVRP configuration commands
- 11-LLDP configuration commands
- 12-Service loopback group configuration commands
- 13-MVRP commands
- Related Documents
-
Title | Size | Download |
---|---|---|
07-Spanning tree configuration commands | 288.31 KB |
active region-configuration
Use active region-configuration to activate your MST region configuration.
Syntax
active region-configuration
Views
MST region view
Default command level
2: System level
Usage guidelines
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 occurs only after you activate the MST region–related parameters by using the active region-configuration command or enable the spanning tree feature by using 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. Run this command only when they are correct.
Examples
# Map VLAN 2 to MSTI 1 and manually activate the MST region configuration.
<Sysname> system-view
[Sysname] stp region-configuration
[Sysname-mst-region] instance 1 vlan 2
[Sysname-mst-region] active region-configuration
· instance
· region-name
· revision-level
· vlan-mapping modulo
· check region-configuration
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
Ethernet interface view
Default command level
2: System level
Examples
# Enable BPDU drop on port GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] bpdu-drop any
check region-configuration
Use check region-configuration to display MST region pre-configuration information, including the region name, revision level, and VLAN-to-instance mapping settings.
Syntax
check region-configuration
Views
MST region view
Default command level
2: System level
Usage guidelines
Two or more spanning tree devices belong to the same MST region only if they are configured with the same format selector (0 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 connected via a physical link.
H3C recommends that you 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 :000fe26a58ed
Revision level :0
Configuration digest :0x41b5018aca57daa8dcfdba2984d99d06
Instance Vlans Mapped
0 1 to 9, 11 to 4094
15 10
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
· instance
· region-name
· revision-level
· vlan-mapping modulo
· active region-configuration
display stp
Use display stp to display the spanning tree status and statistics information.
Syntax
display stp [ instance instance-id | vlan vlan-id ] [ interface interface-list ] [ brief ] [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
instance instance-id: Displays the status and statistics information of a specific MSTI. The instance-id argument is in the range of 0 to 32, where 0 represents the common internal spanning tree (CIST).
vlan vlan-id: Displays the spanning tree status and statistics of a VLAN specified by vlan-id. The vlan-id argument is in the range of 1 to 4094.
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.
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.
Usage guidelines
Based on the spanning tree status and statistics information, you can analyze and maintain the network topology or check whether spanning tree is working properly.
In STP or RSTP mode, follow these guidelines:
· 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, follow these guidelines:
· 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.
In PVST mode, follow these guidelines:
· If you do not specify any VLAN or port, this command displays the spanning tree information of all VLANs on all ports. The displayed information is sorted by VLAN ID and by port name in each VLAN.
· If you specify a VLAN but not a port, this command displays the spanning tree information on all ports in that VLAN. The displayed information is sorted by port name.
· If you specify some ports but not any VLAN, this command displays the spanning tree information of all VLANs on the specified ports. The displayed information is sorted by VLAN ID and by port name in each VLAN.
· If you specify both a VLAN ID and a port list, this command displays the spanning tree information on the specified ports in the specified VLAN. The displayed information is sorted by port name.
Examples
# In MSTP mode, display the brief spanning tree status and statistics information of MSTI 0 on ports GigabitEthernet 1/0/1 through GigabitEthernet 1/0/4.
<Sysname> display stp instance 0 interface gigabitethernet 1/0/1 to gigabitethernet 1/0/4 brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/1 ALTE DISCARDING LOOP
0 GigabitEthernet1/0/2 DESI FORWARDING NONE
0 GigabitEthernet1/0/3 DESI FORWARDING NONE
0 GigabitEthernet1/0/4 DESI FORWARDING NONE
# In PVST mode, display the brief spanning tree status and statistics of VLAN 2 on ports GigabitEthernet 1/0/1 through GigabitEthernet 1/0/4.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] display stp vlan 2 interface gigabitethernet 1/0/1 to gigabitethernet 1/0/4 brief
VLAN Port Role STP State Protection
2 GigabitEthernet1/0/1 ALTE DISCARDING LOOP
2 GigabitEthernet1/0/2 DESI FORWARDING NONE
2 GigabitEthernet1/0/3 DESI FORWARDING NONE
2 GigabitEthernet1/0/4 DESI FORWARDING NONE
Table 2 Command output
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. · BPDU/ROOT—BPDU guard and root guard. · NONE—No protection. |
# In MSTP mode, display the spanning tree status and statistics information of all MSTIs on all ports.
<Sysname> display stp
-------[CIST Global Info][Mode MSTP]-------
CIST Bridge :32768.000f-e200-2200
Bridge Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :0.00e0-fc0e-6554 / 200200
CIST RegRoot/IRPC :32768.000f-e200-2200 / 0
CIST RootPortId :128.48
BPDU-Protection :disabled
Bridge Config-
Digest-Snooping :disabled
TC or TCN received :2
Time since last TC :0 days 0h:5m:42s
----[Port1(GigabitEthernet1/0/1)][FORWARDING]----
Port Protocol :enabled
Port Role :CIST Designated Port
Port Priority :128
Port Cost(Legacy) :Config=auto / Active=200
Desg. Bridge/Port :32768.000f-e200-2200 / 128.2
Port Edged :Config=disabled / Active=disabled
Point-to-point :Config=auto / Active=true
Transmit Limit :10 packets/hello-time
Protection Type :None
MST BPDU Format :Config=auto / Active=legacy
Port Config-
Digest-Snooping :disabled
Rapid transition :false
Num of Vlans Mapped :1
PortTimes :Hello 2s MaxAge 20s FwDly 15s MsgAge 2s RemHop 20
BPDU Sent :186
TCN: 0, Config: 0, RST: 0, MST: 186
BPDU Received :0
TCN: 0, Config: 0, RST: 0, MST: 0
-------[MSTI 1 Global Info]-------
MSTI Bridge ID :0.000f-e23e-9ca4
MSTI RegRoot/IRPC :0.000f-e23e-9ca4 / 0
MSTI RootPortId :0.0
MSTI Root Type :PRIMARY root
Master Bridge :32768.000f-e23e-9ca4
Cost to Master :0
TC received :0
# In PVST mode, display the spanning tree status and statistics of all VLANs on all ports.
<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 FwDly 15s
Root ID / RPC :0.00e0-fc0e-6554 / 200200
Root PortId :128.48
BPDU-Protection :disabled
TC or TCN received :2
Time since last TC :0 days 0h:5m:42s
----[Port1(GigabitEthernet1/0/1)][FORWARDING]----
Port Protocol :enabled
Port Role :Designated Port
Port Priority :128
Port Cost(Legacy) :Config=auto / Active=200
Desg. Bridge/Port :32768.000f-e200-2200 / 128.2
Port Edged :Config=disabled / Active=disabled
Point-to-point :Config=auto / Active=true
Transmit Limit :10 packets/hello-time
Protection Type :None
Rapid transition :false
PortTimes :Hello 2s MaxAge 20s FwDly 15s MsgAge 2s
BPDU Sent :186
TCN: 0, Config: 0, RST: 0
BPDU Received :0
TCN: 0, Config: 0, RST: 0, MST: 0
-------[VLAN 2 Global Info]-------
Protocol Status :enabled
Bridge ID :32768.000f-e200-2200
Bridge Times :Hello 2s MaxAge 20s FwDly 15s
Root ID / RPC :0.00e0-fc0e-6554 / 200200
Root PortId :128.48
BPDU-Protection :disabled
TC or TCN received :2
Time since last TC :0 days 0h:5m:42s
# 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
Table 3 Command output
Field |
Description |
CIST Bridge |
CIST bridge ID, which comprises the device’s priority in the CIST and its MAC address. For example, in output "32768.000f-e200-2200", the value preceding the dot is the device’s priority in the CIST, and the value following the dot is the device’s MAC address. |
Bridge ID |
Bridge ID, which comprises the device's priority in VLAN 1 and its MAC address. For example, in output "32768.000f-e200-2200", the value preceding the dot is the device’s priority in VLAN 1, and the value following the dot is the device’s MAC address. |
Bridge Times |
Major parameters for the bridge: · Hello—Hello timer. · MaxAge—Max age timer. · FwDly—Forward delay timer. · MaxHop—Max hops within the MST region. |
CIST Root/ERPC |
CIST root ID and external path cost (the path cost from the device to the CIST root). |
CIST RegRoot/IRPC |
CIST regional root ID and internal path cost (the path cost from the device to the CIST regional root). |
Root ID / RPC |
VLAN root ID and root path cost (the path cost from the device to the root). |
CIST RootPortId |
CIST root port ID. The "0.0" indicates that the device is the root, and there is no root port. |
Root PortId |
VLAN root port ID. The "0.0" indicates that the device is the root, and there is no root port. |
BPDU-Protection |
Global status of BPDU protection. |
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 after the latest topology change in the MSTI or VLAN. |
[FORWARDING] |
The port is in forwarding state. |
[DISCARDING] |
The port is in discarding state. |
[LEARNING] |
The port is in learning state. |
Port Protocol |
Status of the spanning tree feature on the port. |
Port Role |
Port role: · Alternate. · Backup. · Root. · Designated. · Master. · Disabled. |
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 packets sent within each hello time. |
Protection Type |
Protection type on the port: · Root—Root guard. · Loop—Loop guard. · BPDU—BPDU guard. · BPDU/ROOT—BPDU guard and root guard. · None—No protection. |
MST BPDU Format |
Format of the MST BPDUs that the port can send, which can be legacy or 802.1s. · Config—Configured value. · Active—Actual value. |
Port Config- Digest-Snooping |
Status of digest snooping on the port. |
Rapid transition |
The port rapidly transitions to the forwarding state or not in the MSTI or VLAN. |
Num of Vlans Mapped |
Number of VLANs mapped to the MSTI. |
PortTimes |
Major parameters for the port: · Hello—Hello timer. · MaxAge—Max Age timer. · FwDly—Forward delay timer. · MsgAge—Message Age timer. · RemHop—Remaining hops. |
BPDU Sent |
Statistics on sent BPDUs. |
BPDU Received |
Statistics on received BPDUs. |
MSTI RegRoot/IRPC |
MSTI regional root/internal path cost. |
MSTI RootPortId |
MSTI root port ID. |
MSTI Root Type |
MSTI root type, primary root or 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, this field indicates the device’s priority in the CIST. In PVST mode, this field indicates the device's priority in VLAN 1. |
Max age(s) |
Aging timer (in seconds) for BPDUs. In PVST mode, this field is the configuration in VLAN 1. |
Forward delay(s) |
Port state transition delay (in seconds). In PVST mode, this field is the configuration in VLAN 1. |
Hello time(s) |
Interval (in seconds) for the root bridge to send BPDUs. In PVST mode, this field is the configuration in VLAN 1. |
Max hops |
Maximum hops in the MSTI. |
reset stp
display stp abnormal-port
Use display stp abnormal-port to display information about ports blocked by spanning tree protection functions.
Syntax
display stp abnormal-port [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command 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.
Examples
# In MSTP mode, display information about ports blocked by spanning tree protection functions.
<Sysname> display stp abnormal-port
MSTID Blocked Port Reason
1 GigabitEthernet1/0/1 ROOT-Protected
2 GigabitEthernet1/0/2 LOOP-Protected
2 GigabitEthernet1/0/3 Formatcompatibility–Protected
# In PVST mode, display information about ports blocked by spanning tree protection functions.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] display stp abnormal-port
VLAN Blocked Port Reason
1 GigabitEthernet1/0/1 ROOT-Protected
2 GigabitEthernet1/0/2 LOOP-Protected
2 GigabitEthernet1/0/3 Formatcompatibility–Protected
Table 4 Command output
Field |
Description |
Blocked Port |
Name of a blocked port, which corresponds to the related MSTI or VLAN. |
Reason |
Reason that the port was blocked: · 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
Use display stp bpdu-statistics to display the BPDU statistics on ports.
Syntax
display stp bpdu-statistics [ interface interface-type interface-number [ instance instance-id ] ] [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command 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 is in the range of 0 to 32, 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.
Usage guidelines
In MSTP mode, follow these guidelines:
· 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 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 the specified MSTI on the port.
In STP, RSTP, or PVST mode, follow these guidelines:
· 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
# In MSTP mode, display the BPDU statistics of all MSTIs on GigabitEthernet 1/0/1.
<Sysname> display stp bpdu-statistics interface gigabitethernet 1/0/1
Port: GigabitEthernet1/0/1
Instance-independent:
Type Count Last Updated
--------------------------- ---------- -----------------
Invalid BPDUs 0
Looped-back BPDUs 0
MAX-aged BPDUs 0
TCN sent 0
TCN received 0
TCA sent 0
TCA received 2 10:33:12 01/13/2013
Config sent 0
Config received 0
RST sent 0
RST received 0
MST sent 4 10:33:11 01/13/2013
MST received 151 10:37:43 01/13/2013
Instance 0:
Type Count Last Updated
--------------------------- ---------- -----------------
Timeout BPDUs 0
MAX-hoped BPDUs 0
TC detected 1 10:32:40 01/13/2013
TC sent 3 10:33:11 01/13/2013
TC received 0
Instance 1:
Type Count Last Updated
--------------------------- ---------- -----------------
Timeout BPDUs 0
MAX-hoped BPDUs 0
TC detected 0
TC sent 0
TC received 0
Instance 2:
Type Count Last Updated
--------------------------- ---------- -----------------
Timeout BPDUs 0
MAX-hoped BPDUs 0
TC detected 0
TC sent 0
TC received 0
# In PVST mode, display the BPDU statistics on GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] display stp bpdu-statistics interface gigabitethernet 1/0/1
Port: GigabitEthernet1/0/1
Type Count Last Updated
--------------------------- ---------- -----------------
Invalid BPDUs 0
Looped-back BPDUs 0
MAX-aged BPDUs 0
TCN sent 0
TCN received 0
TCA sent 0
TCA received 2 10:33:12 01/13/2013
Config sent 0
Config received 0
RST sent 0
RST received 0
MST sent 4 10:33:11 01/13/2013
MST received 151 10:37:43 01/13/2013
Timeout BPDUs 0
MAX-hoped BPDUs 0
TC detected 511 10:32:40 01/13/2013
TC sent 8844 10:33:11 01/13/2013
TC received 1426 10:33:32 01/13/2013
Table 5 Command output
Field |
Description |
Port |
Port name. |
Instance-independent |
Statistics not related to any particular MSTI. |
Type |
Statistical item. |
Looped-back BPDUs |
BPDUs sent and then received by the same port. |
Max-Aged BPDUs |
BPDUs whose max age was exceeded. |
TCN Sent |
TCN BPDUs sent. |
TCN Received |
TCN BPDUs received. |
TCA Sent |
TCA BPDUs sent. |
TCA Received |
TCA BPDUs received. |
Config Sent |
Configuration BPDUs sent. |
Config Received |
Configuration BPDUs 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
Use display stp down-port to display information about ports shut down by spanning tree protection functions.
Syntax
display stp down-port [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command 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.
Examples
# Display information about ports shut down by spanning tree protection functions.
<Sysname> display stp down-port
Down Port Reason
GigabitEthernet1/0/1 BPDU-Protected
GigabitEthernet1/0/2 Formatfrequency-Protected
Table 6 Command output
Field |
Description |
Down Port |
Name of a port shut down by the spanning tree protection functions. |
Reason |
Reason that the port was shut down: · BPDU-Protected—BPDU guard function. · Formatfrequency-Protected—MSTP BPDU format frequent change protection function. |
display stp history
Use display stp history to display the historical port role calculation information for the specified MSTI or all MSTIs.
Syntax
display stp [ instance instance-id | vlan vlan-id ] history [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
0: Visit level
Parameters
instance instance-id: Displays the historical port role calculation information for a specific MSTI. The instance-id argument is in the range of 0 to 32, where 0 represents the CIST.
vlan vlan-id: Displays the historical port role calculation information for a specific VLAN. The vlan-id argument is in the range of 1 to 4094.
|: 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.
Usage guidelines
In STP or RSTP mode, the displayed information is sorted by port role calculation time.
In MSTP mode, follow these guidelines:
· If you do not specify any MSTI, this command displays the historical port role calculation information for all MSTIs. The displayed information is sorted by MSTI ID and by port role calculation time in each MSTI.
· If you specify an MSTI, this command displays the historical port role calculation information for the specified MSTI by the sequence of port role calculation time.
In PVST mode, follow these guidelines:
· If you do not specify any VLAN, this command displays the historical port role calculation information for all VLANs. The displayed information is sorted by VLAN ID and by port role calculation time in each VLAN.
· If you specify a VLAN, this command displays the historical port role calculation information for the specified VLAN by the sequence of port role calculation time.
Examples
# In MSTP mode, display the historical port role calculation information for MSTI 2.
<Sysname> display stp instance 2 history
------------------- Instance 2 ---------------------
Port Ethernet1/1
Role change : ROOT->DESI (Aged)
Time : 2013/02/08 00:22:56
Port priority : 0.00e0-fc01-6510 0 0.00e0-fc01-6510 128.1
Port Ethernet1/2
Role change : ALTER->ROOT
Time : 2013/02/08 00:22:56
Port priority : 0.00e0-fc01-6510 0 0.00e0-fc01-6510 128.2
# In PVST mode, display the historical port role calculation information for VLAN 2.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] display stp vlan 2 history
------------------- VLAN 2 ---------------------
Port Ethernet1/1
Role change : ROOT->DESI (Aged)
Time : 2013/02/08 00:22:56
Port priority : 0.00e0-fc01-6510 0 0.00e0-fc01-6510 128.1
Port Ethernet1/2
Role change : ALTER->ROOT
Time : 2013/02/08 00:22:56
Port 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. When the change was caused by expiration of the received configuration BPDU, this field displays Age). |
Time |
Time of port role calculation. |
Port priority |
Port priority. |
display stp region-configuration
Use display stp region-configuration to display the effective configuration information of the MST region, including the region name, revision level, and user-configured VLAN-to-instance mappings.
Syntax
display stp region-configuration [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command 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.
Examples
# In MSTP mode, display effective MST region configuration information.
<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
# In PVST mode, display the effective MST region configuration information.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] display stp region-configuration
Oper Configuration
Format selector :0
Region name :hello
Revision level :0
Configuration digest :0x5f762d9a46311effb7a488a3267fca9f
Instance Mode Vlans Mapped
0 default 3 to 4094
1 static 1
2 dynamic 2
Table 8 Command output
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, which can be configured by using the revision-level command and defaults to 0. |
Mode |
MSTI mode: · Default—Default instance MSTI 0. In PVST mode, the spanning tree feature is disabled. · Static—Static MSTI. · Dynamic—Dynamically assigned MSTI, which only exists in PVST mode. |
· instance
· region-name
· revision-level
· vlan-mapping modulo
display stp root
Use display stp root to display the root bridge information of all MSTIs.
Syntax
display stp root [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command 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.
Examples
# In MSTP mode, display the root bridge information of all spanning trees.
<Sysname> display stp root
MSTID Root Bridge ID ExtPathCost IntPathCost Root Port
0 0.00e0-fc0e-6554 200200 0 GigabitEthernet1/0/1
# In PVST mode, display the root bridge information of all spanning trees.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] display stp root
VLAN Root Bridge ID ExtPathCost IntPathCost Root Port
1 0.00e0-fc0e-6554 200200 0 GigabitEthernet1/0/1
Table 9 Command output
Field |
Description |
ExtPathCost |
External path cost. The device automatically calculates the default path cost of a port. Otherwise, you can use the stp cost command to configure the path cost of a port. |
IntPathCost |
Internal path cost. The device automatically calculates the default path cost of a port. Otherwise, you can use the stp cost command to configure the path cost of a port. |
Root Port |
Root port name (displayed only if a port of the device is the root port of MSTIs). |
display stp tc
Use display stp tc to display the statistics of TC/TCN BPDUs received and sent by all ports in an MSTI or all MSTIs.
Syntax
display stp [ instance instance-id | vlan vlan-id ] tc [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
0: Visit level
Parameters
instance instance-id: Displays the statistics of TC/TCN BPDUs received and sent by all ports in a particular MSTI. The instance-id argument is in the range of 0 to 32, where 0 represents the CIST.
vlan vlan-id: Displays the statistics of TC/TCN BPDUs received and sent by all ports in the specified VLAN. The vlan-id argument is in the range of 1 to 4094.
|: 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.
Usage guidelines
In STP or RSTP mode, the displayed information is sorted by port name.
In MSTP mode, follow these guidelines:
· If you do not specify any MSTI, this command displays the statistics of TC/TCN BPDUs received and sent by all ports in all MSTIs. The displayed information is sorted by instance ID and by port name in each MSTI.
· If you specify an MSTI, this command displays the statistics of TC/TCN BPDUs received and sent by all ports in the specified MSTI in port name order.
In PVST mode, follow these guidelines:
· If you do not specify any VLAN, this command displays the statistics of TC/TCN BPDUs received and sent by all ports in all VLANs. The displayed information is sorted by VLAN ID and by port name in each VLAN.
· If you specify a VLAN, this command displays the statistics of TC/TCN BPDUs received and sent by all ports in the specified VLAN in port name order.
Examples
# In MSTP mode, display the statistics of TC/TCN BPDUs received and sent by all ports in MSTI 0.
<Sysname> display stp instance 0 tc
MSTID Port Receive Send
0 Ethernet1/1 6 4
0 Ethernet1/2 0 2
# In PVST mode, display the statistics of TC/TCN BPDUs received and sent by all ports in VLAN 2.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] display stp vlan 2 tc
VLAN Port Receive Send
2 Ethernet1/1 6 4
2 Ethernet1/2 0 2
Table 10 Command output
Field |
Description |
Port |
Port name. |
Receive |
Number of TC/TCN BPDUs received on each port. |
Send |
Number of TC/TCN BPDUs sent by each port. |
instance
Use instance to map a list of VLANs to the specified MSTI.
Use undo instance to re-map the specified VLAN or all VLANs to the CIST (MSTI 0).
Syntax
instance instance-id vlan vlan-list
undo instance instance-id [ vlan vlan-list ]
Default
All VLANs are mapped to the CIST.
Views
MST region view
Default command level
2: System level
Parameters
instance-id: Specifies an MSTI ID. The instance-id argument is in the range of 0 to 32 for the MSTP mode and is in the range of 0 to 128 for the PVST mode, where 0 represents the CIST.
vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where the vlan-id argument represents the VLAN ID in the range of 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.
Usage guidelines
If you specify no VLAN in the undo instance command, all VLANs mapped to the specified MSTI are re-mapped to the CIST.
You cannot map the same VLAN to different MSTIs. If you map a VLAN that has been mapped to an MSTI to a new MSTI, the old mapping is automatically removed.
In PVST mode, you can map multiple VLANs to the CIST, and only one VLAN to each remaining MSTI.
After configuring this command, use 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
· display stp region-configuration
· check region-configuration
· active region-configuration
region-name
Use region-name to configure the MST region name.
Use undo region-name to restore the default MST region name.
Syntax
region-name name
undo region-name
Default
The MST region name of a device is its MAC address.
Views
MST region view
Default command level
2: System level
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, use 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
· instance
· revision-level
· vlan-mapping modulo
· display stp region-configuration
· check region-configuration
· active region-configuration
reset stp
Use reset stp to clear the MSTP statistics information.
Syntax
reset stp [ interface interface-list ]
Views
User view
Default command level
1: Monitor level
Parameters
interface interface-list: Clears the MSTP statistics of the 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. If you don’t specify this option, the command clears the spanning tree-related statistics on all ports.
Usage guidelines
The MSTP statistics information includes the numbers of TCN BPDUs, configuration BPDUs, RST BPDUs and MST BPDUs sent/received through the specified ports.
Examples
# Clear the spanning tree-related statistics on ports GigabitEthernet 1/0/1 through GigabitEthernet 1/0/3.
<Sysname> reset stp interface gigabitethernet 1/0/1 to gigabitethernet 1/0/3
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
Default command level
2: System level
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. When the MST region name and VLAN-to-instance mapping table are both the same for two MST regions, they can still be differentiated by their MSTP revision levels.
After configuring this command, use 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
· instance
· region-name
· vlan-mapping modulo
· display stp region-configuration
· check region-configuration
· active region-configuration
stp bpdu-protection
Use stp bpdu-protection to enable the BPDU guard function.
Use undo stp bpdu-protection to disable the BPDU guard function.
Syntax
stp bpdu-protection
undo stp bpdu-protection
Default
The BPDU guard function is disabled.
Views
System view
Default command level
2: System level
Examples
# Enable the BPDU guard function.
<Sysname> system-view
[Sysname] stp bpdu-protection
stp bridge-diameter
Use stp bridge-diameter to specify the network diameter, the maximum possible number of stations between any two terminal devices on the switched network.
Use undo stp bridge-diameter to restore the default.
Syntax
stp [ vlan vlan-list ] bridge-diameter diameter
undo stp [ vlan vlan-list ] bridge-diameter
Default
The network diameter of the switched network is 7.
Views
System view
Default command level
2: System level
Parameters
vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where the vlan-id argument represents the VLAN ID in the range of 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.
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.
To set the network diameter of an STP/RSTP/MSTP switched network, use this command without specifying any VLAN. To set the network diameter of a specified VLAN or multiple VLANs in a PVST switched network, use this command with a VLAN list specified.
In STP, RSTP, or MSTP mode, 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.
In PVST mode, the network diameter configuration takes effect only on the root bridge.
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 to 5.
<Sysname> system-view
[Sysname] stp mode pvst
[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 the specified ports use 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
Ethernet interface view, port group view, Layer 2 aggregate interface view
Default command level
2: System level
Parameters
auto: Configures the ports to recognize the MSTP BPDU format automatically and 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.
Usage guidelines
Configured in Ethernet interface view, the setting takes effect only on that interface.
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 takes effect only after the port leaves the aggregation group.
Examples
# Configure GigabitEthernet 1/0/1 to receive and send only standard-format (802.1s) MSTP packets.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] stp compliance dot1s
stp config-digest-snooping
Use stp config-digest-snooping to enable digest snooping.
Use undo stp config-digest-snooping to disable digest snooping.
Syntax
stp config-digest-snooping
undo stp config-digest-snooping
Default
The feature is disabled by default.
Views
System view, Ethernet interface view, port group view, Layer 2 aggregate interface view
Default command level
2: System level
Usage guidelines
Configured in system view, the setting takes effect globally.
Configured in Ethernet interface view, the setting takes effect only on the interface.
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 takes effect only after the port leaves the aggregation group.
Enable this feature both globally and on ports connected to other vendors' devices to make it effective. To minimize impact, enable the feature on all associated ports before you enable it globally.
When digest snooping is globally enabled, if you modify the VLAN-to-instance mapping or use the undo stp region-configuration command to restore the default MST region configuration, traffic may be interrupted because the local VLAN-to-instance mapping is different from that on a neighbor device. Perform these operations with caution.
Examples
# Enable digest snooping on GigabitEthernet 1/0/1 and then globally.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] stp config-digest-snooping
[Sysname-GigabitEthernet1/0/1] quit
[Sysname] stp config-digest-snooping
Related commands
display stp
stp cost
Use stp cost to set the path cost of the port or ports.
Use undo stp cost to restore the default.
Syntax
stp [ instance instance-id | vlan vlan-list ] cost cost
undo stp [ instance instance-id | vlan vlan-list ] cost
Default
The device automatically calculates the path costs of ports in each spanning tree based on the corresponding standard.
Views
Ethernet interface view, port group view, Layer 2 aggregate interface view
Default command level
2: System level
Parameters
instance instance-id: Sets the path cost of the ports in a particular MSTI. The instance-id argument is in the range of 0 to 32, where 0 represents the CIST.
vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where the vlan-id argument represents the VLAN ID in the range of 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.
cost: Specifies the path cost of the port, with an effective range that depends on the path cost calculation standard adopted.
· With the IEEE 802.1d-1998 standard selected for path cost calculation, the cost argument is in the range of 1 to 65535.
· With the IEEE 802.1t standard selected for path cost calculation, the cost argument is in the range of 1 to 200000000.
· With the private standard selected for path cost calculation, the cost argument is in the range of 1 to 200000.
Usage guidelines
Configured in Ethernet interface view, the setting takes effect only on the interface.
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 takes effect only after the port leaves the aggregation group.
To set the path cost of an MSTP port in a specific MSTI, use this command with the MSTI specified. To set the path cost of a PVST port in a specific VLAN, use this command with the VLAN specified. To set the path cost of an MSTP port in the CIST or an STP or RSTP port, use this command without specifying any MSTI and VLAN.
Path cost is an important factor in spanning tree calculation. Setting different path costs for a port in MSTIs allows different VLAN traffic flows to be forwarded along different physical links and enables 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 re-calculates the role of the port and initiates a state transition.
Examples
# In MSTP mode, set the path cost of port GigabitEthernet 1/0/3 in MSTI 2 to 200.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/3
[Sysname-GigabitEthernet1/0/3] stp instance 2 cost 200
# In PVST mode, set the path cost of port GigabitEthernet 1/0/3 in VLAN 2 to 200.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] interface gigabitethernet 1/0/3
[Sysname-GigabitEthernet1/0/3] stp vlan 2 cost 200
Related commands
· display stp
· stp pathcost-standard
stp edged-port
Use stp edged-port enable to configure one or more ports as edge ports.
Use stp edged-port disable to configure one or more ports as non-edge ports.
Use undo stp edged-port to restore the default.
Syntax
stp edged-port { enable | disable }
undo stp edged-port
Default
All ports are non-edge ports.
Views
Ethernet interface view, port group view, Layer 2 aggregate interface view
Default command level
2: System level
Parameters
enable: Configures one or more ports as edge ports.
disable: Configures one or more ports as non-edge ports.
Usage guidelines
Configured in Ethernet interface view, the setting takes effect only on the interface.
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 takes effect only after the port leaves the aggregation group.
If a port directly connects to a user terminal rather than another device or a shared LAN segment, this port is regarded as an edge port. When the network topology changes, an edge port does not cause a temporary loop. You can enable the port to transition to the forwarding state rapidly by configuring it as an edge port. H3C recommends that you configure ports directly connecting 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. If a port receives a configuration BPDU when the BPDU guard function is disabled, the port functions as a non-edge port, even if you configure it as an edge port.
You cannot configure edge port settings and loop guard on a port at the same time.
Examples
# Configure GigabitEthernet 1/0/1 as an edge port.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] stp edged-port enable
stp loop-protection
stp enable
Use stp enable to enable the spanning tree feature.
Use undo stp enable to disable the spanning tree feature.
Syntax
In system view:
stp [ vlan vlan-list ] enable
undo stp [ vlan vlan-list ] enable
In Ethernet interface, Layer 2 aggregate interface, or port group view:
stp enable
undo stp enable
Default
The spanning tree feature is globally disabled, but is enabled on all ports and in all VLANs.
Views
System view, Ethernet interface view, port group view, Layer 2 aggregate interface view
Default command level
2: System level
Parameters
vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where the vlan-id argument represents the VLAN ID in the range of 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges. If you do not specify this option, this command enables or disables the spanning tree feature globally (not for any VLAN).
Usage guidelines
Configured in system view, the setting takes effect globally.
Configured in Ethernet interface view, the setting takes effect only on the interface.
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 takes effect only after the port leaves the aggregation group.
When you enable the spanning tree feature, the device operates in STP, RSTP, MSTP, or PVST 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 MSTP mode, enable the spanning tree feature globally.
<Sysname> system-view
[Sysname] stp enable
# In PVST mode, enable the spanning tree feature globally and in VLAN 2.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] stp enable
[Sysname] stp vlan 2 enable
# In MSTP mode, disable the spanning tree feature on port GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] undo stp enable
Related commands
stp mode
stp loop-protection
Use stp loop-protection to enable the loop guard function on the ports.
Use undo stp loop-protection to disable the loop guard function on the ports.
Syntax
stp loop-protection
undo stp loop-protection
Default
The loop guard function is disabled.
Views
Ethernet interface view, port group view, Layer 2 aggregate interface view
Default command level
2: System level
Usage guidelines
Configured in Ethernet interface view, the setting takes effect only on the interface.
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 takes effect only after the port leaves the aggregation group.
You cannot configure edge port settings and loop guard, or configure root guard and loop guard on a port at the same time.
Examples
# Enable the loop guard function on GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] stp loop-protection
Related commands
· stp edged-port
· stp root-protection
stp max-hops
Use stp max-hops to set the maximum hop count of the MST region.
Use undo stp max-hops to restore the default.
Syntax
stp max-hops hops
undo stp max-hops
Default
The maximum hop count of an MST region is 20.
Views
System view
Default command level
2: System level
Parameters
hops: Sets the maximum hop count in the range of 1 to 40.
Usage guidelines
The maximum hop count limits the size of the MST region.
Examples
# Set the maximum hop count of the MST region to 35.
<Sysname> system-view
[Sysname] stp max-hops 35
display stp
stp mcheck
Use stp mcheck to perform the mCheck operation globally or on a port.
Syntax
stp mcheck
Views
System view, Ethernet interface view, Layer 2 aggregate interface view
Default command level
2: System level
Usage guidelines
If a port on a device that runs MSTP, RSTP, or PVST mode connects to an STP device, the port automatically transitions to the STP mode. It cannot automatically transition back to the original mode when:
· The STP device is shut down or removed.
· The STP device transitions to the MSTP, RSTP, or PVST mode.
Then, you can perform an mCheck operation to forcibly transition the port to operation in the original mode.
For example, suppose Device B that has no spanning tree feature enabled connects to Device A that is running STP, and to Device C that is running RSTP, MSTP, or PVST. Device B transparently transmits STP BPDUs, and the port on Device C and connecting to Device B transition to the STP mode. After you enable the spanning tree feature on Device B, to run RSTP or MSTP between Device B and Device C, you must perform an mCheck operation on the ports interconnecting Device B and Device C, in addition to configuring the spanning tree to operate in RSTP, MSTP, or PVST mode on Device B.
The device operates in STP, RSTP, MSTP, or PVST mode depending on the spanning tree mode setting.
The stp mcheck command is effective only when the device operates in MSTP, RSTP, or PVST mode.
Configured in system view, the setting takes effect globally.
Configured in Ethernet interface view, the setting takes effect only on the interface.
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 takes effect only after the port leaves the aggregation group.
Examples
# Perform mCheck on GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] stp 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
Default command level
2: System level
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 the other spanning tree mode varies by port type:
· On an access port, the PVST mode is compatible with any other spanning tree mode in any VLAN.
· On a trunk or hybrid port, the PVST mode is compatible with any other spanning tree mode in only VLAN 1.
Examples
# Configure the spanning tree device to operate in STP mode.
<Sysname> system-view
[Sysname] stp mode stp
Related commands
· stp mcheck
· stp enable
stp no-agreement-check
Use stp no-agreement-check to enable no agreement check on the ports.
Use undo stp no-agreement-check to disable no agreement check on the ports.
Syntax
stp no-agreement-check
undo stp no-agreement-check
Default
No agreement check is disabled.
Views
Ethernet interface view, port group view, Layer 2 aggregate interface view
Default command level
2: System level
Usage guidelines
Configured in Ethernet interface view, the setting takes effect only on the interface.
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 takes 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 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] stp no-agreement-check
stp pathcost-standard
Use stp pathcost-standard to specify a standard for the device to use when calculating the default path costs for ports.
Use undo stp pathcost-standard to restore the default.
Syntax
stp pathcost-standard { dot1d-1998 | dot1t | legacy }
undo stp pathcost-standard
Default
The default standard used by the device is legacy.
Views
System view
Default command level
2: System level
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
· stp cost
· display stp
stp point-to-point
Use stp point-to-point to configure the link type of the ports.
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
Ethernet interface view, port group view, Layer 2 aggregate interface view
Default command 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.
Usage guidelines
Configured in Ethernet interface view, the setting takes effect only on the interface.
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 takes effect only after the port leaves the aggregation group.
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. H3C recommends that you use the default setting to let the device 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 or PVST mode is effective for all MSTIs or VLANs.
If the physical link to which the port connects is not a point-to-point link but you set it to be one, the configuration may bring a temporary loop.
Examples
# Configure the link connecting GigabitEthernet 1/0/3 as a point-to-point link.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/3
[Sysname-GigabitEthernet1/0/3] stp point-to-point force-true
display stp
stp port priority
Use stp port priority to set the priority of the ports.
Use undo stp port priority to restore the default.
Syntax
stp [ instance instance-id | vlan vlan-list ] port priority priority
undo stp [ instance instance-id | vlan vlan-list ] port priority
Default
The port priority is 128.
Views
Ethernet interface view, port group view, Layer 2 aggregate interface view
Default command level
2: System level
Parameters
instance instance-id: Sets the priority of the ports in a particular MSTI. The instance-id argument is in the range of 0 to 32, where 0 represents the CIST.
priority: Specifies the port priority, in the range of 0 to 240 in increments of 16 (as indicated by 0, 16, 32).
vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where the vlan-id argument represents the VLAN ID in the range of 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.
Usage guidelines
Configured in Ethernet interface view, the setting takes effect only on the interface.
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 takes effect only after the port leaves the aggregation group.
To set the priority of an MSTP port in a specific MSTI, use this command with the MSTI specified. To set the priority of a PVST port in a specific VLAN or multiple VLANs, use this command with a VLAN list specified. To set the priority of an MSTP port in the CIST or an STP or RSTP port, use this command without specifying any MSTI and VLAN.
Port priority affects the role of a port in a spanning tree.
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.
Examples
# In MSTP mode, set the priority of port GigabitEthernet 1/0/3 to 16 in MSTI 2.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/3
[Sysname-GigabitEthernet1/0/3] stp instance 2 port priority 16
# In PVST mode, set the priority of port GigabitEthernet 1/0/3 to 16 in VLAN 2.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] interface gigabitethernet 1/0/3
[Sysname-GigabitEthernet1/0/3] stp vlan 2 port priority 16
Related commands
display stp
stp port-log
Use stp port-log to enable outputting port state transition information for the specified MSTI or all MSTIs.
Use undo stp port-log to disable outputting port state transition information for the specified MSTI or all MSTIs.
Syntax
stp port-log { instance { instance-id | all } | vlan vlan-list }
undo stp port-log { instance { instance-id | all } | vlan vlan-list }
Default
Outputting port state transition information is enabled.
Views
System view
Default command level
2: System level
Parameters
instance instance-id: Specifies an MSTI. The instance-id argument is in the range of 0 to 32, where 0 represents the CIST. To enable or disable outputting port state transition information in STP or RSTP mode, specify instance 0.
all: Specifies all MSTIs.
vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where the vlan-id argument represents the VLAN ID in the range of 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.
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 2013 Sysname MSTP/3/MSTP_DISCARDING: Instance 2's GigabitEthernet1/0/1 has been set to discarding state!
%Aug 16 00:49:41:856 2013 Sysname MSTP/3/MSTP_DISCARDING: Instance 2's GigabitEthernet1/0/2 has been set to forwarding state!
The output shows that GigabitEthernet 1/0/1 in MSTI 2 transitioned to the discarding state and GigabitEthernet 1/0/2 in MSTI 2 transitioned to the forwarding state.
# In PVST mode, enable outputting port state transition information for VLAN 1 to VLAN 4094.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] stp port-log vlan 1 to 4094
%Aug 16 00:49:41:856 2013 Sysname MSTP/3/PVST_DISCARDING: VLAN 2's GigabitEthernet1/0/1 has been set to discarding state!
%Aug 16 00:49:41:856 2013 Sysname MSTP/3/PVST_FORWARDING: VLAN 2's GigabitEthernet1/0/2 has been set to forwarding state!
The output shows that GigabitEthernet 1/0/1 in VLAN 2 transitioned to the discarding state and GigabitEthernet 1/0/2 in VLAN 2 transitioned to the forwarding state.
stp priority
Use stp priority to set the priority of the device.
Use undo stp priority to restore the default priority.
Syntax
stp [ instance instance-id | vlan vlan-list ] priority priority
undo stp [ instance instance-id | vlan vlan-list ] priority
Default
The device priority is 32768.
Views
System view
Default command level
2: System level
Parameters
instance instance-id: Sets the priority of the device in a MSTI. The instance-id argument is in the range of 0 to 32, where 0 represents the CIST.
vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where the vlan-id argument represents the VLAN ID in the range of 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.
priority: Specifies the device priority, in the range of 0 to 61440 in increments of 4096 (as indicated by 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
To set the priority of an MSTP device in a specific MSTI, use this command with the MSTI specified. To set the priority of a PVST device in a specific VLAN or multiple VLANs, use this command with a VLAN list specified. To set the priority of an MSTP device in the CIST or an STP or RSTP device, use this command without specifying any MSTI and VLAN.
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 mode pvst
[Sysname] stp vlan 1 priority 4096
stp region-configuration
Use stp region-configuration to enter MST region view.
Use undo stp region-configuration to restore the default MST region configurations.
Syntax
stp region-configuration
undo stp region-configuration
Views
System view
Default command level
2: System level
Usage guidelines
These are the default settings for the MST region:
· The MST region name of the device is the MAC address of the device.
· All VLANs are mapped to the CIST.
· The MSTP revision level is 0.
After you enter MST region view, you can configure the MST region-related 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 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-id | vlan vlan-list ] root primary
undo stp [ instance instance-id | vlan vlan-list ] root
Default
A device is not a root bridge.
Views
System view
Default command level
2: System level
Parameters
instance instance-id: Configures the device as the root bridge in a particular MSTI. The instance-id argument is in the range of 0 to 32, where 0 represents the CIST.
vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where the vlan-id argument represents the VLAN ID in the range of 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.
Usage guidelines
To set an MSTP device as the root bridge in a specific MSTI, use this command with the MSTI specified. To set a PVST device as the root bridge in a specific VLAN or multiple VLANs, use this command with a VLAN list specified. To set an MSTP device in the CIST or an STP or RSTP device as the root bridge, use this command without specifying any MSTI and VLAN.
Once you specify the device as the root bridge, you cannot change the priority of the device.
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 mode pvst
[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-id | vlan vlan-list ] root secondary
undo stp [ instance instance-id | vlan vlan-list ] root
Default
A device is not a secondary root bridge.
Views
System view
Default command level
2: System level
Parameters
instance instance-id: Configures the device as a secondary root bridge in a particular MSTI. The instance-id argument is in the range of 0 to 32, where 0 represents the CIST.
vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where the vlan-id argument represents the VLAN ID in the range of 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.
Usage guidelines
To set an MSTP device as a secondary root bridge in a specific MSTI, use this command with the MSTI specified. To set a PVST device as a secondary root bridge in a specific VLAN or multiple VLANs, use this command with a VLAN list specified. To set an MSTP device in the CIST or an STP or RSTP device as a secondary root bridge, use this command without specifying any MSTI and VLAN.
Once you specify the device as a secondary root bridge, you cannot change the priority of the device.
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 mode pvst
[Sysname] stp vlan 1 root secondary
Related commands
· stp priority
· stp root primary
stp root-protection
Use stp root-protection to enable the root guard function on the ports.
Use undo stp root-protection to disable the root guard function on the ports.
Syntax
stp root-protection
undo stp root-protection
Default
The root guard function is disabled.
Views
Ethernet interface view, port group view, Layer 2 aggregate interface view
Default command level
2: System level
Usage guidelines
Configured in Ethernet interface view, the setting takes effect only on the interface.
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 takes effect only after the port leaves the aggregation group.
You cannot configure root guard and loop guard on a port at the same time.
Examples
# Enable the root guard function for GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] stp root-protection
Related commands
stp loop-protection
stp tc-protection
Use stp tc-protection enable to enable the TC-BPDU attack guard function for the device.
Use stp tc-protection disable to disable the TC-BPDU attack guard function for the device.
Syntax
stp tc-protection enable
stp tc-protection disable
Default
The TC-BPDU attack guard function is enabled.
Views
System view
Default command level
2: System level
Usage guidelines
With the TC-BPDU guard function, you can set the maximum number of immediate forwarding address entry flushes that the device can perform every a certain period of time (10 seconds). For TC-BPDUs received in excess of the limit, the device performs a forwarding address entry flush when the time period expires. This prevents frequent flushing of forwarding address entries.
Examples
# Disable the TC-BPDU attack guard function for the device.
<Sysname> system-view
[Sysname] stp tc-protection disable
stp tc-protection threshold
stp tc-protection threshold
Use stp tc-protection threshold to configure the maximum number of forwarding address entry flushes that the device can perform every a certain period of time (10 seconds).
Use undo stp tc-protection threshold to restore the default.
Syntax
stp tc-protection threshold number
undo stp tc-protection threshold
Default
The device can perform a maximum of six forwarding address entry flushes every 10 seconds.
Views
System view
Default command level
2: System level
Parameters
number: Sets the maximum number of immediate forwarding address entry flushes that the device can perform within a certain period of time (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 timer forward-delay
Use stp timer forward-delay to set the forward delay timer of the device.
Use undo stp timer forward-delay to restore the default.
Syntax
stp [ vlan vlan-list ] timer forward-delay time
undo stp [ vlan vlan-list ] timer forward-delay
Default
The forward delay timer is 15 seconds.
Views
System view
Default command level
2: System level
Parameters
vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where the vlan-id argument represents the VLAN ID in the range of 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.
time: Sets the forward delay (in centiseconds), in the range of 400 to 3000 in increments of 100 (as indicated by 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 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.
To set the forward delay in STP/RSTP/MSTP mode, use this command without any VLAN specified. To set the forward delay for a specific VLAN or multiple VLANs in PVST mode, use this command with a VLAN list specified.
H3C does not recommend that you 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.
Examples
# In MSTP mode, set the forward delay timer to 20 seconds.
<Sysname> system-view
[Sysname] stp timer forward-delay 2000
# In PVST mode, set the forward delay timer to 20 seconds.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] stp vlan 2 timer forward-delay 2000
Related commands
· stp timer hello
· stp timer max-age
· stp bridge-diameter
stp timer hello
Use stp timer hello to set the hello time of the device.
Use undo stp timer hello to restore the default.
Syntax
stp [ vlan vlan-list ] timer hello time
undo stp [ vlan vlan-list ] timer hello
Default
The hello time is 2 seconds.
Views
System view
Default command level
2: System level
Parameters
vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where the vlan-id argument represents the VLAN ID in the range of 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.
time: Sets the hello time (in centiseconds), in the range of 100 to 1000 in increments of 100 (as indicated by 100, 200, 300).
Usage guidelines
Hello time is the time interval at which spanning tree devices send configuration BPDUs to maintain spanning tree. If a device fails to receive configuration BPDUs within the set period of time, a new spanning tree calculation process is triggered due to timeout.
To set the hello time in STP/RSTP/MSTP mode, use this command without any VLAN specified. To set the hello time for a specific VLAN or multiple VLANs in PVST mode, use this command with a VLAN list specified.
H3C does not recommend that you 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.
Examples
# In MSTP mode, set the hello time to 4 seconds.
<Sysname> system-view
[Sysname] stp timer hello 400
# In PVST mode, set the hello time in VLAN 2 to 4 seconds.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] stp vlan 2 timer hello 400
· stp timer forward-delay
· stp timer max-age
· stp bridge-diameter
stp timer max-age
Use stp timer max-age to set the max age timer of the device.
Use undo stp timer max-age to restore the default.
Syntax
stp [ vlan vlan-list ] timer max-age time
undo stp [ vlan vlan-list ] timer max-age
Default
The max age is 20 seconds.
Views
System view
Default command level
2: System level
Parameters
vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where the vlan-id argument represents the VLAN ID in the range of 1 to 4094, and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.
time: Sets the max age (in centiseconds), in the range of 600 to 4000 in increments of 100 (as indicated by 600, 700, 800).
Usage guidelines
In the CIST of an MSTP network or each VLAN of a PVST network, the device 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.
To set the max age timer in STP/RSTP/MSTP mode, use this command without any VLAN specified. To set the max age timer for a specific VLAN or multiple VLANs in PVST mode, use this command with a VLAN list specified.
H3C does not recommend that you 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.
Examples
# In MSTP mode, set the max age timer to 10 seconds.
<Sysname> system-view
[Sysname] stp timer max-age 1000
# In PVST mode, set the max age timer in VLAN 2 to 10 seconds.
<Sysname> system-view
[Sysname] stp mode pvst
[Sysname] stp vlan 2 timer max-age 1000
Related commands
· stp timer forward-delay
· stp timer hello
· stp bridge-diameter
stp timer-factor
Use stp timer-factor to configure the timeout time by setting the timeout factor.
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
Default command level
2: System level
Parameters
factor: Sets the timeout factor in the range of 1 to 20.
Usage guidelines
Timeout time = timeout factor × 3 × hello time.
After the network topology is stabilized, each non-root-bridge device forwards configuration BPDUs to the surrounding devices at the interval of hello time to check whether any link is faulty. If a device does not receive a BPDU from the upstream device within nine times the hello time, it assumes that the upstream device has failed and starts a new spanning tree calculation process.
In a stable network, this kind of spanning tree calculation may occur because the upstream device is busy. You can avoid such unwanted spanning tree calculations by lengthening the timeout time (by setting the timeout factor to 4 or more), saving the network resources. H3C recommends that you set the timeout factor to 5, 6, or 7, for 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 maximum number of BPDUs that the ports can send within each hello time.
Use undo stp transmit-limit to restore the default.
Syntax
stp transmit-limit limit
undo stp transmit-limit
Default
The maximum transmission rate of all ports is 10. Each port can send up to 10 BPDUs within each hello time.
Views
Ethernet interface view, port group view, Layer 2 aggregate interface view
Default command level
2: System level
Parameters
limit: Sets the maximum number of BPDUs the ports can send within each hello time, in the range of 1 to 255.
Usage guidelines
Configured in Ethernet interface view, the setting takes effect only on the interface.
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 takes effect only after the port leaves the aggregation group.
A larger maximum transmission rate value requires more system resources. An appropriate maximum transmission rate setting can prevent spanning tree protocols 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 1/0/1 to 5.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] stp transmit-limit 5
vlan-mapping modulo
Use vlan-mapping modulo to map VLANs in the MST region to MSTIs according to the specified modulo value, quickly creating 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
Default command level
2: System level
Parameters
modulo: Sets the modulo value, in the range of 1 to 32.
Usage guidelines
You cannot map a VLAN to different MSTIs. If you map a VLAN that has been mapped to an MSTI to a new MSTI, the old mapping is automatically removed.
This command maps each VLAN to the MSTI 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 is mapped to MSTI 1, VLAN 2 to MSTI 2, VLAN 15 to MSTI 15, VLAN 16 to MSTI 1, 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
· region-name
· revision-level
· display stp region-configuration
· check region-configuration
active region-configuration