15-MSTP Commands
Chapters Download (204.93 KB)
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 carry out this command, MSTP will replace the currently running MST region–related parameters with the parameters you have just configured, and will perform spanning tree calculation again.
Related commands: instance, region-name, revision-level, vlan-mapping modulo, check region-configuration.
Examples
# Activate MST region configuration manually.
<Sysname> system-view
[Sysname] stp region-configuration
[Sysname-mst-region] active 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 all the configuration information of the MST region, including the region name, VLAN-to-MSTI mapping and revision level settings.
Be sure that your MST region configurations are correct, especially the VLAN-to-MSTI mapping table. As defined in the MSTP protocol, MSTP-enabled devices are in the same MST region only when they have the same format selector (protocol format selector defined in 802.1s, which is 0 by default and unconfigurable), region name, VLAN-to-MSTI mapping table, and MSTP revision level settings. A device will be in a different region if it is different in any of these four settings.
You can view all the MST region–related configuration information by using this command and determine the MST region the device is currently in, or check whether the MST region configuration is correct.
Related commands: instance, region-name, revision-level, vlan-mapping modulo, active region-configuration.
Examples
# View all the 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 :00b010000001
Revision level :0
Instance Vlans Mapped
0 1 to 9, 11 to 4094
15 10
Table 1-1 check region-configuration command output description
Field |
Description |
Format selector |
Configuration format selector of the MST region |
Region name |
MST region name |
Revision level |
Revision level of the MST region |
Instance Vlans Mapped |
VLAN-to-MSTI mappings in the MST region |
Syntax
display stp [ instance instance-id ] [ interface interface-list ] [ brief ]
View
Any view
Default Level
1: Monitor level
Parameters
instance instance-id: Displays the spanning tree information of a particular MSTI. The effective range of instance-id is 0 to 15, with 0 representing the common internal spanning tree (CIST).
interface interface-list: Specifies 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 information.
Description
Use the display stp command to view the MSTP status information and statistics information.
Based on the MSTP status information and statistics information, you can analyze and maintain the network topology or check whether MSTP is working normally.
Note that:
l If you do not specify any MSTI ID or port list, this command will display the MSTP information of all MSTIs on all ports. The displayed information is sequenced by MSTI ID and by port name in each MSTI.
l If you specify an MSTI ID, this command will display the MSTP information on all ports in that MSTI. The displayed information is sequenced by port name.
l If you specify a port list, this command will display the MSTP information of all MSTIs on the specified ports. The displayed information is sequenced by MSTI ID, and by port name in each MSTI.
l If you specify both an MSTI ID and a port list, this command will display the MSTP information on the specified ports in the specified MSTI.
The MSTP status information includes:
l CIST global parameters: Protocol work mode, device priority in the CIST (Priority), MAC address, hello time, max age, forward delay, maximum hops, common root of the CIST, external path cost from the device to the CIST common root, regional root, the internal path cost from the device to the regional root, CIST root port of the device, and status of the BPDU guard function (enabled or disabled).
l CIST port parameters: Port status, role, priority, path cost, designated bridge, designated port, edge port/non-edge port, whether connecting to a point-to-point link, 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, and whether rapid state transition enabled for designated ports.
l MSTI global parameters: MSTI ID, bridge priority of the MSTI, regional root, internal path cost, MSTI root port, and master bridge.
l MSTI port parameters: Port status, role, priority, path cost, designated bridge, designated port, remaining hops, and whether rapid state transition enabled (for designated ports).
The statistics information includes:
l The number of TCN BPDUs, configuration BPDUs, RST BPDUs and MST BPDUs sent from each port
l The number of TCN BPDUs, configuration BPDUs, RST BPDUs, MST BPDUs and wrong BPDUs received on each port
l The number of BPDUs discarded on each port
Related commands: reset stp.
Examples
# View the brief MSTP status information and statistics information.
<Sysname> display stp instance 0 interface gigabitethernet 1/1/1 brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/1/1 DESI FORWARDING NONE
Table 1-2 display stp command output description
Field |
Description |
MSTID |
MSTI ID in the MST region |
Port |
Port name, corresponding to each MSTI |
Role |
Port role |
STP State |
MSTP status on the port, including forwarding, discarding, and learning |
Protection |
Protection type on the port, including root guard, loop guard, and BPDU guard |
# View the detailed MSTP status information and statistics information.
<Sysname> display stp instance 0 interface gigabitethernet 1/1/1
-------[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
----[Port2(GigabitEthernet1/1/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
Table 1-3 display stp command output description
Field |
Description |
CIST Bridge |
CIST bridge ID |
Bridge Times |
Major parameters for the bridge: l Hello: Hello timer l MaxAge: Max Age timer l FWDly: Forward delay timer l Max Hop: Max hops within the MST region |
CIST Root/ERPC |
CIST root and external path cost |
CIST RegRoot/IRPC |
CIST regional root and internal path cost |
CIST RootPortId |
CIST root port ID |
BPDU-Protection |
Indicates whether BPDU protection is enabled globally. |
Bridge Config- Digest-Snooping |
Indicates whether Digest Snooping is enabled globally on the bridge. |
TC or TCN received |
Number of received TC/TCN packets |
Time since last TC |
Time since the latest topology change |
Port Protocol |
Indicates whether STP is enabled on the port |
Port Role |
Port role, which can be Alternate, Backup, Root, Designated, Master, or Disabled |
Port Priority |
Port priority |
Port Cost(Legacy) |
Path cost of the port. The field in the bracket indicates the standard used for port path cost calculation, which can be legacy, dot1d-1998, or dot1t. Config indicates the configured value, and Active indicates the 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 |
Indicates whether the port is an edge port. Config indicates the configured value, and Active indicates the actual value. |
Point-to-point |
Indicates whether the port is connected to a point-to-point link. Config indicates the configured value, and Active indicates the actual value. |
Transmit Limit |
The maximum number of packets sent within each Hello time |
Protection Type |
Protection type on the port, including root guard and loop guard |
MST BPDU Format |
Format of the MST BPDUs that the port can send, which can be legacy or 802.1s. Config indicates the configured value, and Active indicates the actual value. |
Port Config- Digest-Snooping |
Indicates whether digest snooping is enabled on the port. |
Rapid transition |
Indicates whether the current port rapidly transitions to the forwarding state. |
Num of Vlans Mapped |
Number of VLANs mapped to the current MSTI |
PortTimes |
Major parameters for the port: l Hello: Hello timer l MaxAge: Max Age timer l FWDly: Forward delay timer l MsgAge: Message Age timer l Remain Hop: Remaining hops |
BPDU Sent |
Statistics on sent BPDUs |
BPDU Received |
Statistics on received BPDUs |
Syntax
display stp abnormal-port
View
Any view
Default Level
1: Monitor level
Parameters
None
Description
Use the display stp abnormal-port command to view the information about abnormally blocked ports.
Any of the following reasons may cause a port to be abnormally blocked:
l Root guard function
l Loop guard function
l MSTP BPDU format incompatibility protection function
Examples
# View information about abnormally blocked ports.
<Sysname> display stp abnormal-port
MSTID Blocked Port Reason
1 GigabitEthernet1/1/1 ROOT-Protected
2 GigabitEthernet1/1/3 Formatcompatibility–Protected
Table 1-4 display stp abnormal-port command output description
Field |
Description |
MSTID |
MSTI ID |
Blocked Port |
Name of a blocked port, which corresponds to the related MSTI |
Reason |
Reason that caused abnormal blocking of the port. l ROOT-Protected: root guard function l LOOP-Protected: loop guard function l Formatcompatibility-Protected: MSTP BPDU format incompatibility protection function |
Syntax
display stp down-port
View
Any view
Default Level
1: Monitor level
Parameters
None
Description
Use the display stp down-port command to display the information about ports blocked by STP protection functions.
These functions include:
l BPDU attack guard function
l MSTP BPDU format frequent change protection function
Examples
# View the information about ports blocked by STP protection functions.
<Sysname> display stp down-port
Down Port Reason
GigabitEthernet1/1/1 BPDU-Protected
GigabitEthernet1/1/3 Formatfrequency-Protected
Table 1-5 display stp abnormal-port command output description
Field |
Description |
Down Port |
Name of a blocked port |
Reason |
Reason that caused the port to be blocked. l BPDU-Protected: BPDU attack guard function l Formatfrequency-Protected: MSTP BPDU format frequent change protection function |
Syntax
display stp [ instance instance-id ] history
View
Any view
Default Level
0: Visit level
Parameters
instance instance-id: Displays the historic port role calculation information of a particular MSTI. The effective range of instance-id is 0 to 15, with 0 representing the common internal spanning tree (CIST).
Description
Use the display stp history command to view the historic port role calculation information of the specified MSTI or all MSTIs.
Note that:
l If you do not specify an MSTI ID, this command will display the historic port role calculation information of all MSTIs. The displayed information is sequenced by MSTI ID, and by port role calculation time in each MSTI.
l If you specify an MSTI ID, this command will display the historic port role calculation information of only this specified MSTI by the sequence of port role calculation time.
Examples
# View the historic port role calculation information of the card on slot 1 in MSTI 2.
<Sysname> display stp instance 2 history
------------------- Instance 2 ---------------------
Port GigabitEthernet1/1/1
Role change : ROOT->DESI (Aged)
Time : 2006/08/08 00:22:56
Port priority : 0.00e0-fc01-6510 0 0.00e0-fc01-6510 128.1
Port GigabitEthernet1/1/3
Role change : ALTER->ROOT
Time : 2006/08/08 00:22:56
Port priority : 0.00e0-fc01-6510 0 0.00e0-fc01-6510 128.2
Table 1-6 display stp history command 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 |
Syntax
display stp region-configuration
View
Any view
Default Level
1: Monitor level
Parameters
None
Description
Use the display stp region-configuration command to view the currently effective configuration information of the MST region, including the region name, revision level, and user-configured VLAN-to-MSTI mappings.
Related commands: stp region-configuration.
Examples
# View the currently effective MST region configuration information.
<Sysname> display stp region-configuration
Oper Configuration
Format selector :0
Region name :hello
Revision level :0
Instance Vlans Mapped
0 21 to 4094
1 1 to 10
2 11 to 20
Table 1-7 display stp region-configuration command output description
Field |
Description |
Format selector |
MSTP-defined format selector |
Region name |
MST region name |
Revision level |
Revision level of the MST region |
Instance Vlans Mapped |
VLAN-to-MSTI mappings in the MST region |
Syntax
display stp root
View
Any view
Default Level
1: Monitor level
Parameters
None
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 1-8 display stp root command output description
Field |
Description |
MSTID |
MSTI ID |
Root Bridge ID |
Root bridge ID |
ExtPathCost |
External path cost |
IntPathCost |
Internal path cost |
Root Port |
Root port name (displayed only if a port of the current device is the root port of MSTIs) |
Syntax
display stp [ instance instance-id ] tc
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 a particular spanning tree instance. The effective range of instance-id is 0 to 15, with 0 representing the common internal spanning tree (CIST).
Description
Use the display stp tc command to view the statistics of TC/TCN BPDUs received and sent.
Note that:
l If you do not specify an MSTI ID, this command will display the statistics of TC/TCN BPDUs received and sent by all ports in all spanning tree instances. The displayed information is sequenced by instance ID and by port name in each spanning tree instance.
l If you specify an MSTI ID, this command will display 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
MSTID Port Receive Send
0 GigabitEthernet1/1/1 6 4
0 GigabitEthernet1/1/3 0 2
Table 1-9 display stp tc command output description
Field |
Description |
MSTID |
MSTI ID in the MST region |
Port |
Port name |
Receive |
Number of TC/TCN BPDUs received on each port |
Send |
Number of TC/TCN BPDUs sent by each port |
Syntax
display onu-protocol [ stp ]
View
ONU port view
Default Level
2: System level
Parameters
stp: Displays the information about RSTP supported by the ONU.
Description
Use the display onu-protocol command to display the information about the protocols supported by the UNIs of an ONU that is in up state.
If the stp keyword is not specified, the information about all the protocols supported by the UNIs of the ONU is displayed.
l This command takes effect on H3C ONUs only.
l STP runs normally only when all attached ONUs are H3C ONUs.
Examples
# Display the information about RSTP supported by the ONU.
<Sysname> system-view
[Sysname] interface onu 1/0/1:1
[Sysname-Onu1/0/1:1] display onu-protocol stp
Protocol name: STP
Protocol status: enabled
UNI 1 :Forwarding
UNI 2 :Disable
UNI 3 :Disable
UNI 4 :Disable
PON :Forwarding
Table 1-10 display onu-protocol stp command output description
Field |
Description |
Protocol status |
Protocol status: enabled or disabled |
UNI Port : Forwarding |
UNI port number: STP status of the current UNI port |
PON : Forwarding |
PON port: STP status of the PON port |
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 effective range of instance-id is 0 to 15, with 0 representing the common internal spanning tree (CIST).
vlan vlan-list: Specifeis a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id2 }&<1-10>, in which vlan-id represents the VLAN ID and ranges from 1 to 4094. &<1-10> indicates you can specify up to 10 VLAN IDs or VLAN ID ranges.
Description
Use the instance command to map the specified VLAN(s) to the specified MSTI.
Use the undo instance command to remap the specified VLAN(s) or all VLANs to the CIST (MSTI 0).
By default, all VLANs are mapped to the CIST.
Notice that:
l If you specify no VLAN in the undo instance command, all VLANs mapped to the specified MSTI will be remapped to the CIST.
l 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.
Related commands: region-name, revision-level, check region-configuration, vlan-mapping modulo, active region-configuration.
Examples
# Map VLAN 2 to MSTI 1.
<Sysname> system-view
[Sysname] stp region-configuration
[Sysname-mst-region] instance 1 vlan 2
Syntax
onu-protocol stp enable
undo onu-protocol stp enable
View
ONU port view
Default Level
2: System level
Parameters
None
Description
Use the onu-protocol stp enable command to enable RSTP for UNIs of the ONU.
Use the undo onu-protocol stp enable command to disable RSTP for UNIs of the ONU.
By default, RSTP is enabled for UNIs of the ONU.
l This command takes effect on H3C ONUs only.
l STP runs normally only when all attached ONUs are H3C ONUs.
l When STP is enabled globally on the S3600 EPON OLT switch, make sure all the ONUs are enabled with STP and no ONU acts as an STP root bridge to avoid network anomalies.
Examples
# Enable RSTP for UNIs of the ONU.
<Sysname> system-view
[Sysname] interface onu 1/0/1:1
[Sysname-Onu1/0/1:1] onu-protocol stp enable
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 of your device.
Use the undo region-name command to restore the default MST region name.
By default, the MST region name of a device is its MAC address.
The MST region name, the VLAN-to-MSTI mapping table and the MSTP revision level of a device jointly determine the MST region the device belongs to.
Related commands: instance, revision-level, check region-configuration, vlan-mapping modulo, active region-configuration.
Examples
# Set the MST region name of the device to “hello”.
<Sysname> system-view
[Sysname] stp region-configuration
[Sysname-mst-region] region-name hello
Syntax
reset stp [ interface interface-list ]
View
User view
Default Level
1: Monitor level
Parameters
interface interface-list: Specifies 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.
Description
Use the reset stp command to clear the MSTP statistics information.
The MSTP statistics information includes the numbers of TCN BPDUs, configuration BPDUs, RST BPDUs and MST BPDUs sent/received through the specified port(s) (STP BPDUs and TCN BPDUs are counted only for the CIST).
Note that this command clears the spanning tree-related statistics information on the specified port(s) 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-related statistics information on port GigabitEthernet 1/1/1.
<Sysname> reset stp interface gigabitethernet 1/1/1
Syntax
revision-level level
undo revision-level
View
MST region view
Default Level
2: System level
Parameters
level: MSTP revision level, in the range of 0 to 65535.
Description
Use the region-level command to configure the MSTP revision level of your device.
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-MSTI mapping table of a device jointly determine the MST region the device belongs to.
Related commands: instance, region-name, check region-configuration, vlan-mapping modulo, 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
Syntax
stp { enable | disable }
undo stp [ enable | disable ]
View
System view, Ethernet port view, ONU port view, port group view, Layer-2 aggregate port view
Default Level
2: System level
Parameters
enable: Enables MSTP.
disable: Disables MSTP.
Description
Use the stp enable or undo stp disable command to enable MSTP globally in system view, on a port in Ethernet port or Layer-2 aggregate interface view, or on multiple ports in port group view.
Use the undo stp [ enable ] or stp disable command to disable MSTP globally in system view, on a port in Ethernet port or Layer-2 aggregate interface view, or on multiple ports in port group view.
By default, MSTP is enabled on all ports, but not globally. Even though MSTP is enabled on all ports by default, it does not take effect. To have it take effect, you must enable MSTP globally in system view.
To control MSTP flexibly, you can use the undo stp [ enable ] or stp disable command to disable MSTP on ports that are not intended to take part in spanning tree calculation and thus to save CPU resources.
Note that:
l 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. For detailed information about link aggregation, refer to Link Aggregation Configuration in this manual.
l After you enable MSTP, the switch works in STP-compatible mode, RSTP mode or MSTP mode depending on the MSTP mode setting, which is configurable with the stp mode command. After MSTP is disabled, the switch becomes a transparent bridge.
l After being enabled, MSTP dynamically maintains the spanning tree status of VLANs based on received configuration BPDUs. After being disabled, it stops maintaining the spanning tree status.
Related commands: stp mode.
Examples
# Enable the MSTP feature globally.
<Sysname> system-view
[Sysname] stp enable
# Disable MSTP on port GigabitEthernet 1/1/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/1/1
[Sysname-GigabitEthernet1/1/1] undo stp enable
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 device.
Use the undo stp bpdu-protection command to disable the BPDU guard function for the device.
By default, the BPDU guard function is disabled.
Examples
# Enable the BPDU guard function for the device.
<Sysname> system-view
[Sysname] stp bpdu-protection
Syntax
stp bridge-diameter bridge-number
undo stp bridge-diameter
View
System view
Default Level
2: System level
Parameters
bridge-number: Specifies the switched network diameter, in the range of 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. You can set these three timers indirectly by setting the network diameter. Based on the network diameter you configured, MSTP automatically sets an optimal hello time, forward delay, and max age for the device. With the network diameter set to 7 (the default), the three timer are also set to their defaults.
Note that this configuration is effective for the CIST and root bridge only, and not for MSTIs.
Related commands: stp timer forward-delay, stp timer hello, stp timer max-age.
Examples
# Set the network diameter of the switched network to 5.
<Sysname> system-view
[Sysname] stp bridge-diameter 5
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 port(s) to recognize the MSTP BPDU format automatically and accordingly determine the format of MSTP BPDUs to send.
dot1s: Configures the port(s) to receive and send only standard-format (802.1s-compliant) MSTP BPDUs.
legacy: Configures the port(s) to receive and send only compatible-format MSTP BPDUs.
Description
Use the stp compliance command to configure the mode the port(s) will use to recognize and send MSTP BPDUs.
Use the undo stp compliance command to restore the system default.
The default mode is auto, namely all ports recognize the BPDU format automatically.
Note that:
l Configured in interface view, the setting takes effect on the current port only; configured in port group view, the setting takes effect on all ports in the port group.
l 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. For detailed information about link aggregation, refer to Link Aggregation Configuration in this manual.
l If the mode is set to auto on a port, the port automatically recognizes and resolves the received compatible-format BPDUs or 802.1s-compliant BPDUs, and sends, when needed, compatible-format or 802.1s-compliant BPDUs.
l If the mode is set to legacy or dot1s on a port, the port can only receive and send BPDUs of the specified format. If the port is configured not to detect the packet format automatically while it works in the MSTP mode, and if it receives a packet in the format other than the configured format, it will become a designated port and remain in the discarding state to prevent the occurrence of a loop.
Examples
# Configure GigabitEthernet 1/1/1 to receive and send only standard-format (802.1s) MSTP packets.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/1/1
[Sysname-GigabitEthernet1/1/1] stp compliance dot1s
Syntax
stp config-digest-snooping
undo stp config-digest-snooping
View
System view, Ethernet interface view, ONU port 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.
Note that:
l Configured in system view, the setting takes effect globally; configured in interface view, the setting takes effect on the current port only; configured in port group view, the setting takes effect on all ports in the port group.
l 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. For detailed information about link aggregation, refer to Link Aggregation Configuration in this manual.
l You need to enable this feature both globally and on ports connected to other vendors’ devices to make it take effect. It is recommended to enable the feature on all associated ports first and then globally, making all configured ports take effect at the same time to minimize the impact, and disable the feature globally to disable it on all associated ports.
l It is not recommended to enable Digest Snooping on the MST region edge ports to avoid loops.
Examples
# Enable Digest Snooping globally.
<Sysname> system-view
[Sysname] stp config-digest-snooping
# Enable Digest Snooping on GigabitEthernet 1/1/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/1/1
[Sysname-GigabitEthernet1/1/1] stp config-digest-snooping
Syntax
l Ethernet interface view, port group view, Layer-2 aggregate interface view:
stp [ instance instance-id ] cost cost
undo stp [ instance instance-id ] cost
l ONU port view:
stp cost cost
undo stp cost
View
Ethernet interface view, port group view, Layer-2 aggregate interface view, ONU port view
Default Level
2: System level
Parameters
instance instance-id: Sets the path cost of the port(s) in a particular MSTI. The effective range of instance-id is 0 to 15, with 0 representing the common internal spanning tree (CIST).
cost: Path cost of the port, the effective range of which depends on the path cost calculation standard adopted.
l With the IEEE 802.1d-1998 standard selected for path cost calculation, the cost argument ranges from 1 to 65535.
l With the IEEE 802.1t standard selected for path cost calculation, the cost argument ranges from 1 to 200000000.
l 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 port(s) in the specified MSTI or all MSTIs.
Use the undo stp cost command to restore the system default.
By default, the device automatically calculates the path costs of ports in each MSTI based on the corresponding standard.
l Configured in interface view, the setting takes effect on the current port only; configured in port group view, the setting takes effect on all ports in the port group.
l 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. For detailed information about link aggregation, refer to Link Aggregation Configuration in this manual.
l If you set instance-id to 0, you are setting the path cost of the port in the CIST. The path cost setting of a port can affect the role selection of the port. Setting different path costs for the same port in different MSTIs allows different VLAN traffic flows to be forwarded along different physical links, thus to achieve VLAN-based load balancing. When the path cost of a port is changed, MSTP will re-compute the role of the port and initiate a state transition.
l If you do not provide instance instance-id, your configuration will take effect in the CIST instance only.
Examples
# Set the path cost of port GigabitEthernet 1/1/3 in MSTI 2 to 200.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/1/3
[Sysname-GigabitEthernet1/1/3] stp instance 2 cost 200
Syntax
stp edged-port { enable | disable }
undo stp edged-port
View
Ethernet interface view, ONU port view, port group view, Layer-2 aggregate interface view
Default Level
2: System level
Parameters
enable: Configures the current port(s) to be an edge port or edge ports.
disable: Configures the current port(s) to be a non-edge port or non-edge ports.
Description
Use the stp edged-port enable command to configure the port(s) to be an edge port or edge ports.
Use the stp edged-port disable or undo stp edged-port enable command to configure the port(s) to be a non-edge port or non-edge ports.
All ports are non-edge ports by default.
Note that:
l Configured in interface view, the setting takes effect on the current port only; configured in port group view, the setting takes effect on all ports in the port group.
l 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. For detailed information about link aggregation, refer to Link Aggregation Configuration in this manual.
l 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 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. We recommend 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.
l Normally, configuration BPDUs from other devices cannot reach an edge port because it does not connect to any other device. 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.
Examples
# Configure GigabitEthernet 1/1/1 as a non-edge port.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/1/1
[Sysname-GigabitEthernet1/1/1] stp edged-port disable
Syntax
stp loop-protection
undo stp loop-protection
View
Ethernet interface view, ONU port 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 port(s).
Use the undo stp loop-protection command to restore the system default.
By default, the loop guard function is disabled.
Note that:
l Configured in interface view, the setting takes effect on the current port only; configured in port group view, the setting takes effect on all ports in the port group.
l 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. For detailed information about link aggregation, refer to Link Aggregation Configuration in this manual.
Examples
# Enable the loop guard function on GigabitEthernet 1/1/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/1/1
[Sysname-GigabitEthernet1/1/1] stp loop-protection
Syntax
stp max-hops hops
undo stp max-hops
View
System view
Default Level
2: System level
Parameters
hops: Maximum hops, in the range of 1 to 40
Description
Use the stp max-hops command to set the maximum hops of the MST region on the device.
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.
The maximum hops configured in an MST region limit the size of the MST region. In an MST region, the maximum hops configured on the regional root bridge are the maximum hops of this MST region. After a configuration BPDU leaves the root bridge, its hop count is decremented by 1 each time it passes a device. When its hop count reaches 0, it will be discarded by the device that received it. As a result, devices beyond the maximum hop count are unable to take part in spanning tree calculation, and thereby the size of the MST region is limited.
Devices other than the root bridge in an MST region use the maximum hops setting on the root bridge.
Examples
# Set the maximum hops of the MST region to 35.
<Sysname> system-view
[Sysname] stp max-hops 35
Syntax
stp mcheck
View
System view, Ethernet interface view, ONU port view, Layer-2 aggregate interface view
Default Level
2: System level
Parameters
None
Description
Use the stp mcheck command to carry out the mCheck operation globally or on the current port.
In a switched network, if a port on the device running MSTP (or RSTP) connects to a device running STP, this port will automatically migrate to the STP-compatible mode. However, if the device running STP is removed, the port will not be able to migrate automatically to the MSTP (or RSTP) mode, but will remain working in the STP-compatible mode. In this case, you can perform an mCheck operation to force the port to migrate to the MSTP (or RSTP) mode.
Note that:
l The stp mcheck command is meaningful only when the device works in the MSTP (or RSTP-compatible) mode, not in the STP-compatible mode.
l Configured in system view, the setting takes effect globally; configured in interface view, the setting takes effect on the current port only.
l 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. For detailed information about link aggregation, refer to Link Aggregation Configuration in this manual.
Related commands: stp mode.
Examples
# Carry out mCheck on GigabitEthernet 1/1/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/1/1
[Sysname-GigabitEthernet1/1/1] stp mcheck
Syntax
stp mode { stp | rstp | mstp }
undo stp mode
View
System view
Default Level
2: System level
Parameters
stp: Configures the MSTP-enabled device to work in STP-compatible mode.
rstp: Configures an MSTP-enabled device to work in RSTP mode.
mstp: Configures an MSTP-enabled device to work in MSTP mode.
Description
Use the stp mode command to configure the MSTP work mode of the device.
Use the undo stp mode command to restore the MSTP work mode to the default setting.
By default, an MSTP-enabled device works in MSTP mode.
Related commands: stp mcheck, stp enable.
Examples
# Configure the MSTP-enabled device to work in STP-compatible mode.
<Sysname> system-view
[Sysname] stp mode stp
Syntax
stp no-agreement-check
undo stp no-agreement-check
View
Ethernet interface view, ONU port 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 port(s).
Use the undo stp no-agreement-check command to disable No Agreement Check on the port(s).
By default, No Agreement Check is disabled.
Note that:
l Configured in interface view, the setting takes effect on the current port only; configured in port group view, the setting takes effect on all ports in the port group.
l 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. For detailed information about link aggregation, refer to Link Aggregation Configuration in this manual.
To use the No Agreement Check feature, enable it on the root port.
Examples
# Enable No Agreement Check on GigabitEthernet 1/1/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/1/1
[Sysname-GigabitEthernet1/1/1] stp no-agreement-check
Syntax
stp pathcost-standard { dot1d-1998 | dot1t | legacy }
undo stp pathcost-standard
View
System view
Default Level
2: System level
Parameters
dot1d-1998: The device calculates the default path cost for ports based on IEEE 802.1d-1998.
dot1t: The device calculates the default path cost for ports based on IEEE 802.1t.
legacy: The device calculates the default path cost for ports based on a private standard.
Description
Use the stp pathcost-standard command to specify a standard for the device to use when calculating the default path costs for ports of the device.
Use the undo stp pathcost-standard command to restore the system default.
The default standard used by the device is legacy.
Note that if you change the standard that the device uses in calculating the default path cost, the port path cost value set through the stp cost command will be invalid.
Table 1-11 Link speed vs. path cost
Link speed |
Duplex state |
Path cost in 802.1d-1998 standard |
Path cost in IEEE 802.1t standard |
Path cost in private standard |
0 |
— |
65535 |
200,000,000 |
200,000 |
10 Mbps |
Single Port Aggregate Link 2 Ports Aggregate Link 3 Ports Aggregate Link 4 Ports |
100 100 100 100 |
2,000,000 1,000,000 666,666 500,000 |
2,000 1,800 1,600 1,400 |
100 Mbps |
Single Port Aggregate Link 2 Ports Aggregate Link 3 Ports Aggregate Link 4 Ports |
19 19 19 19 |
200,000 100,000 66,666 50,000 |
200 180 160 140 |
1000 Mbps |
Single Port Aggregate Link 2 Ports Aggregate Link 3 Ports Aggregate Link 4 Ports |
4 4 4 4 |
20,000 10,000 6,666 5,000 |
20 18 16 14 |
10 Gbps |
Single Port Aggregate Link 2 Ports Aggregate Link 3 Ports Aggregate Link 4 Ports |
2 2 2 2 |
2,000 1,000 666 500 |
2 1 1 1 |
When calculating path cost for an aggregate interface, 802.1d-1998 does not take into account the number of member ports in its aggregation group as 802.1t does. The calculation formula of 802.1t is: Path Cost = 200,000,000/link speed (in 100 kbps), where link speed is the sum of the link speed values of the non-blocked ports in the aggregation group.
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
# Configure the device to calculate the default path cost for ports based on IEEE 802.1t.
<Sysname> system-view
[Sysname] stp pathcost-standard dot1t
Syntax
stp point-to-point { auto | force-false | force-true }
undo stp point-to-point
View
Ethernet interface view, ONU port 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 specify whether the current port(s) is/are connected to a point-to-point link or point-to-point links.
Use the undo stp point-to-point command to restore the system default.
The default setting is auto; namely the MSTP-enabled device automatically detects whether a port connects to a point-to-point link.
Note that:
l Configured in interface view, the setting takes effect on the current port only; configured in port group view, the setting takes effect on all ports in the port group.
l 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. For detailed information about link aggregation, refer to Link Aggregation Configuration in this manual.
l When connecting to a non-point-to-point link, a port is incapable of rapid state transition.
l If the current port is a Layer-2 aggregate interface or if it works in full duplex mode, the link to which the current port connects is a point-to-point link. We recommend that you use the default setting, namely let MSTP detect the link status automatically.
l This setting takes effect on the CIST and all MSTIs. If a port is configured as connecting to a point-to-point link or a non-point-to-point link, the setting takes effect for the port in all MSTIs. If the physical link to which the port connects is not a point-to-point link and you force it to be a point-to-point link by configuration, your configuration may incur a temporary loop.
Examples
# Configure port GigabitEthernet 1/1/3 as connecting to a point-to-point link.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/1/3
[Sysname-GigabitEthernet1/1/3] stp point-to-point force-true
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 current port(s) in a particular spanning tree instance. The effective range of instance-id is 0 to 15, with 0 representing the common internal spanning tree (CIST).
priority: Port priority, in the range of 0 to 240 in steps of 16 (0, 16, 32…, for example).
Description
Use the stp port priority command to set the priority of the port(s).
Use the undo stp port priority command to restore the system default.
By default, the port priority is 128.
Note that:
l Configured in interface view, the setting takes effect on the current port only; configured in port group view, the setting takes effect on all ports in the port group.
l 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. For detailed information about link aggregation, refer to Link Aggregation Configuration in this manual.
l If you set instance-id to 0, you are setting the priority of the port in the CIST. The priority of a port can affect the role selection of the port in the specified MSTI.
l Setting different priorities for the same port in different MSTIs allows different VLAN traffic flows to be forwarded along different physical links, thus to achieve VLAN-based load balancing.
l When the priority of a port is changed in an MSTI, MSTP will re-compute the role of the port and initiate a state transition in the MSTI.
l If you do not provide instance instance-id, your configuration will take effect in the CIST only.
Examples
# Set the priority of port GigabitEthernet 1/1/3 in MSTI 2 to 16.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/1/3
[Sysname-GigabitEthernet1/1/3] stp instance 2 port priority 16
Syntax
stp port-log { all | instance instance-id }
undo stp port-log { all | instance instance-id }
View
System view
Default Level
2: System level
Parameters
all: Enables output of port state transition information for all MSTIs.
instance instance-id: Enables output of port state transition information for the specified MSTI. The effective range of instance-id is 0 to 15, with 0 representing the common internal spanning tree (CIST).
Description
Use the stp port-log command to enable output of port state transition information for the specified MSTI or all MSTIs.
Use the undo stp port-log command to disable output of port state transition information for the specified MSTI or all MSTIs.
By default, the output of port state transition information is enabled.
Examples
# Enable output of port state transition information for MSTI 2.
<Sysname> system-view
[Sysname] stp port-log instance 2
%Aug 16 00:49:41:856 2006 Sysname MSTP/3/PDISC: Instance 2's GigabitEthernet1/1/1 has been set to discarding state!
%Aug 16 00:49:41:856 2006 Sysname MSTP/3/PFWD: Instance 2's GigabitEthernet1/1/3 has been set to forwarding state!
// The information above shows that in MSTI 2 the state of GigabitEthernet 1/1/1 has changed to discarding and that of GigabitEthernet 1/1/3 has changed to forwarding.
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 device in a particular spanning tree instance. The effective range of instance-id is 0 to 15, with 0 representing the common internal spanning tree (CIST).
priority: Port priority, in the range of 0 to 61440 in steps of 4096, namely you can set up to 16 priority values, such as 0, 4096, 8192…, on the device.
Description
Use the stp priority command to set the priority of the device.
Use the undo stp priority command to restore the default device priority.
By default, the device priority is 32768.
The device priority is involved in spanning tree calculation. The device priority is set on a per-MSTI basis. An MSTP-enabled device can have different priorities in different MSTIs.
If you do not provide instance instance-id, your configuration will take effect in the CIST instance only.
Examples
# Set the device priority in MSTI 1 to 4096.
<Sysname> system-view
[Sysname] stp instance 1 priority 4096
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 device’s MST region name is the device’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 parameters related to the MST region, including the region name, VLAN-to-MSTI mappings and revision level.
Examples
# Enter MST region view.
<Sysname> system-view
[Sysname] stp region-configuration
[Sysname-mst-region]
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 device as the root bridge in a particular MSTI. The effective range of instance-id is 0 to 15, with 0 representing the common internal spanning tree (CIST).
Description
Use the stp root primary command to configure the current device as the root bridge.
Use the undo stp root command to restore the system default.
By default, a device is not a root bridge.
Note that:
l If you do not provide instance instance-id, your configuration will take effect in the CIST instance only.
l There is only one root bridge in effect in an MSTI. If two or more devices have been designated to be root bridges of the same MSTI, MSTP will select the device with the lowest MAC address as the root bridge.
l You can specify a root bridge for each MSTI without caring about the device priority. After specifying the current device as the root bridge or a secondary root bridge, you cannot change the priority of the device.
Examples
# Specify the current device as the root bridge of MSTI 0.
<Sysname> system-view
[Sysname] stp instance 0 root primary
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 device as a secondary root bridge in a particular MSTI. The effective range of instance-id is 0 to 15, with 0 representing the common internal spanning tree (CIST).
Description
Use the stp root secondary command to configure the device as a secondary root bridge.
Use the undo stp root command to restore the system default.
By default, a device is not a secondary root bridge.
Note that:
l If you do not provide instance instance-id, your configuration will take effect in the CIST instance only.
l You can configure one or more secondary root bridges for each MSTI. When the root bridge of an MSTI fails or is shut down, the secondary root bridge can take over the role of the root bridge of the specified MSTI. If you specify more than one secondary root bridge, the secondary root bridge with the lowest MAC address will become the root bridge.
l After specifying the current device as the root bridge or a secondary root bridge, you cannot change the priority of the device.
Examples
# Specify the current device as the secondary root bridge of MSTI 0.
<Sysname> system-view
[Sysname] stp instance 0 root secondary
Syntax
stp root-protection
undo stp root-protection
View
Ethernet interface view, ONU port 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 port(s).
Use the undo stp root-protection command to disable the root guard function on the port(s).
By default, the root guard function is disabled.
Note that:
l Configured in interface view, the setting takes effect on the current port only; configured in port group view, the setting takes effect on all ports in the port group.
l 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. For detailed information about link aggregation, refer to Link Aggregation Configuration in this manual.
Examples
# Enable the root guard function for GigabitEthernet 1/1/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/1/1
[Sysname-GigabitEthernet1/1/1] stp root-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 attack guard function for the device.
Use the stp tc-protection disable command to disable the TC-BPDU attack guard function for the device.
By default, the TC-BPDU attack guard function is enabled.
Examples
# Enable the TC-BPDU attack guard function for the device.
<Sysname> system-view
[Sysname] stp tc-protection enable
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 switch can perform within a certain period of time after it receives the first TC-BPDU. The value range for the argument is 1 to 255.
Description
Use the stp tc-protection threshold command to configure the maximum number of forwarding address entry flushes that the device can perform within 10 seconds after it receives the first TC-BPDU.
Use the undo stp tc-protection threshold command to restore the default.
By default, the device can perform a maximum of six forwarding address entry flushes within 10 seconds after it receives the first TC-BPDU.
Examples
# Set the maximum number of forwarding address entry flushes that the device can perform within 10 seconds after it receives the first TC-BPDU to 10.
<Sysname> system-view
[Sysname] stp tc-protection threshold 10
Syntax
stp timer forward-delay centi-seconds
undo stp timer forward-delay
View
System view
Default Level
2: System level
Parameters
centi-seconds: Forward delay in centiseconds, ranging form 400 to 3000 in steps of 100.
Description
Use the stp timer forward-delay command to set the forward delay timer of the device.
Use the undo stp timer forward-delay command to restore the system default.
By default, the forward delay timer is set to 1,500 centiseconds.
In order to prevent temporary loops, a port must go through an intermediate state, the learning state, before it transitions from the discarding state to the forwarding state, and must wait a certain period of time before it transitions from one state to another to keep synchronized with the remote device during state transition. The forward delay timer set on the root bridge determines the time interval of state transition.
If the current device is the root bridge, the state transition interval of the device depends on the set forward delay value; for a non- root bridge, its state transition interval is determined by the forward delay timer set on the root bridge.
The settings of the hello time, forward delay and max age timers must meet the following formulae:
l 2 × (forward delay – 1 second) ¦ max age
l Max age ¦ 2 × (hello Time + 1 second)
MSTP can work effectively on the entire network only when the above-mentioned conditions are met; otherwise, topology changes will frequently occur. We recommend that you specify the network diameter of the switched network in the stp root primary command and let MSTP automatically calculate optimal settings of these three timers.
Related commands: stp timer hello, stp timer max-age, stp bridge-diameter.
Examples
# Set the forward delay timer of the device to 2,000 centiseconds.
<Sysname> system-view
[Sysname] stp timer forward-delay 2000
Syntax
stp timer hello centi-seconds
undo stp timer hello
View
System view
Default Level
2: System level
Parameters
centi-seconds: Hello time in centiseconds, ranging from 100 to 1000 in steps of 100.
Description
Use the stp timer hello command to set the hello time of the device.
Use the undo stp timer hello command to restore the system default.
By default, the hello time is set to 200 centiseconds.
Hello time is the time interval at which MSTP-enabled 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 will be triggered due to timeout. The root bridge sends configuration BPDUs at the interval of the hello time set on the device, while non- root bridges use the hello time set on the root bridge.
The settings of the hello time, forward delay and max age timers must meet the following formulae:
l 2 × (forward delay – 1 second) ¦ max age
l Max age ¦ 2 × (hello time + 1 second)
MSTP can work effectively on the entire network only when the above-mentioned conditions are met; otherwise, topology changes will frequently occur. We recommend that you specify the network diameter of the switched network in the stp root primary command and let MSTP automatically calculate optimal settings of these three timers.
Related commands: stp timer forward-delay, stp timer max-age, stp bridge-diameter.
Examples
# Set the hello time of the device to 400 centiseconds.
<Sysname> system-view
[Sysname] stp timer hello 400
Syntax
stp timer max-age centi-seconds
undo stp timer max-age
View
System view
Default Level
2: System level
Parameters
centi-seconds: Max age in centiseconds, ranging from 600 to 4000 in steps of 100.
Description
Use the stp timer max-age command to set the max age timer of the device.
Use the undo stp timer max-age command to restore the system default.
By default, the max age is set to 2,000 centiseconds.
MSTP can detect link failures and automatically restore the forwarding state of the redundant link. In the CIST, the device determines whether a configuration BPDU received on a port has expired based on the max age timer. If a port receives a configuration BPDU that has expired, that MSTI needs to be re-computed.
The max age timer is not meaningful for MSTI. If the current device is the root bridge of the CIST, it determines whether a configuration BPDU has expired based on the configured max age timer; if the current device is not the root bridge of the CIST, it uses the max age timer set on the CIST root bridge.
The settings of the hello time, forward delay and max age timers must meet the following formulae:
l 2 × (forward delay – 1 second) ¦ max age
l Max age ¦ 2 × (hello time + 1 second)
MSTP can work effectively on the entire network only when the above-mentioned conditions are met; otherwise, topology changes will frequently occur. We recommend that you specify the network diameter in the stp root primary command and let MSTP automatically calculate an optimal setting of these three timers.
Related commands: stp timer forward-delay, stp timer hello, stp bridge-diameter.
Examples
# Set the max age timer of the device to 1,000 centiseconds.
<Sysname> system-view
[Sysname] stp timer max-age 1000
Syntax
stp timer-factor number
undo stp timer-factor
View
System view
Default Level
2: System level
Parameters
number: Timeout factor, in the range of 1 to 20.
Description
Use the stp timer-factor command to configure the timeout time of the device by setting the timeout factor. Timeout time = timeout factor × 3 × hello time.
Use the undo stp timer-factor command to restore the default timeout factor.
By default, the timeout factor of the device is set to 3.
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. Typically, if a device does not receive a BPDU from the upstream device within nine times the hello time, it will assume that the upstream device has failed and start a new spanning tree calculation process.
In a very stable network, this kind of spanning tree calculation may occur because the upstream device is busy. In this case, you can avoid such unwanted spanning tree calculations by lengthening the timeout time (by setting the timeout factor to 4 or more). We recommend that you set the timeout factor to 5, or 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
Syntax
stp transmit-limit packet-number
undo stp transmit-limit
View
Ethernet interface view, ONU port view, port group view, Layer-2 aggregate interface view
Default Level
2: System level
Parameters
packet-number: Maximum number of MSTP packets that the port(s) can send within each hello time, namely the maximum transmission rate of the port, in the range of 1 to 255.
Description
Use the stp transmit-limit command to set the maximum transmission rate of the port(s).
Use the undo stp transmit-limit command to restore the system default.
By default, the maximum transmission rate of all ports of the device is 10.
Note that:
l Configured in interface view, the setting takes effect on the current port only; configured in port group view, the setting takes effect on all ports in the port group.
l 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. For detailed information about link aggregation, refer to Link Aggregation Configuration in this manual.
l A larger maximum transmission rate value represents more MSTP packets that the port will send within each hello time, but this means that more device resources will be used. An appropriate maximum transmission rate setting can prevent MSTP from using excessive bandwidth resources during network topology changes.
Examples
# Set the maximum transmission rate of port GigabitEthernet 1/1/1 to 5.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/1/1
[Sysname-GigabitEthernet1/1/1] stp transmit-limit 5
Syntax
vlan-mapping modulo modulo
View
MST region view
Default Level
2: System level
Parameters
modulo: Modulo value, in the range of 1 to 15.
Description
Use the vlan-mapping modulo command to map VLANs in the current MST region to MSTIs according to the specified modulo value.
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.
By using the vlan-mapping modulo command, you can quickly specify a VLAN for each MSTI. 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, check region-configuration, 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