- Table of Contents
-
- H3C S7500 Series Command Manual(Release 3100 Series)-(V1.04)
- 00-1Cover
- 01-CLI Commands
- 02-Login Commands
- 03-Configuration File Management Commands
- 04-VLAN Commands
- 05-Extended VLAN Application Commands
- 06-IP Address-IP Performance-IPX Commands
- 07-GVRP Commands
- 08-QinQ Commands
- 09-Port Basic Configuration Commands
- 10-Link Aggregation Commands
- 11-Port Isolation Commands
- 12-Port Binding Commands
- 13-DLDP Commands
- 14-MAC Address Table Commands
- 15-MSTP Commands
- 16-Routing Protocol Commands
- 17-Multicast Commands
- 18-802.1x Commands
- 19-AAA-RADIUS-HWTACACS-EAD Commands
- 20-Traffic Accounting Commands
- 21-VRRP-HA Commands
- 22-ARP Commands
- 23-DHCP Commands
- 24-ACL Commands
- 25-QoS Commands
- 26-Mirroring Commands
- 27-Cluster Commands
- 28-PoE Commands
- 29-UDP-Helper Commands
- 30-SNMP-RMON Commands
- 31-NTP Commands
- 32-SSH Terminal Service Commands
- 33-File System Management Commands
- 34-FTP and TFTP Commands
- 35-Information Center Commands
- 36-DNS Commands
- 37-System Maintenance and Debugging Commands
- 38-HWPing Commands
- 39-RRPP Commands
- 40-NAT-Netstream-Policy Routing Commands
- 41-Telnet Protection Commands
- 42-Hardware-Dependent Software Configuration Commands
- 43-Appendix
- Related Documents
-
Title | Size | Download |
---|---|---|
15-MSTP Commands | 263 KB |
Table of Contents
Chapter 1 MSTP Configuration Commands
1.1 MSTP Configuration Commands
1.1.1 active region-configuration
1.1.2 check region-configuration
1.1.4 display stp region-configuration
1.1.12 stp config-digest-snooping
1.1.16 stp interface config-digest-snooping
1.1.18 stp interface edged-port
1.1.19 stp interface loop-protection
1.1.21 stp interface no-agreement-check
1.1.22 stp interface point-to-point
1.1.23 stp interface port priority
1.1.24 stp interface root-protection
1.1.25 stp interface transmit-limit
1.1.35 stp region-configuration
1.1.40 stp timer forward-delay
Chapter 1 MSTP Configuration Commands
1.1 MSTP Configuration Commands
1.1.1 active region-configuration
Syntax
active region-configuration
View
MST region view
Parameters
None
Description
Use the active region-configuration command to activate the settings of an MST (multiple spanning tree) region.
Configuring MST region-related parameters (especially the VLAN mapping table) results in spanning trees being regenerated. To reduce network topology jitter caused by such configurations, MSTP (multiple spanning tree protocol) does not regenerate spanning trees immediately after the configuration; it does this only after you activate the new MST region-related settings or enable MSTP, and then the new settings can really take effect.
This command causes the switch to operate with the new MST region-related settings you configured and spanning trees to be regenerated.
Related commands: instance, region-name, revision-level, vlan-mapping modulo, check region-configuration.
Examples
# Activate the MST region-related settings manually.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp region-configuration
[H3C-mst-region] active region-configuration
1.1.2 check region-configuration
Syntax
check region-configuration
View
MST region view
Parameters
None
Description
Use the check region-configuration command to display the current MST region configuration information, including the region name, the revision level, and the VLAN mapping table.
In an MSTP region, make sure that the MST region-related settings (especially the VLAN mapping table) are right. MSTP-enabled switches are in the same region only when they have the same MST region-related settings. A switch cannot be in a respected region if any one of the above three MST region-related settings is not consistent with that of another switch in the region.
You can use this command to view inactivated MST region-related settings, according to which you can find out the MST region the switch currently belongs to or check to see whether or not the MST region-related configuration is correct.
Related commands: instance, region-name, revision-level, vlan-mapping modulo, active region-configuration.
Examples
# Display the MST region configuration of the current switch.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp region-configuration
[H3C-mst-region] check region-configuration
Admin Configuration
Format selector :0
Region name :00e0fc003900
Revision level :0
Instance Vlans Mapped
0 1 to 9, 11 to 4094
16 10
Table 1-1 Description on the fields of the check region-configuration command
Field |
Description |
Format selector |
The selector specified by MSTP |
Region name |
The name of the MST region |
Revision level |
The revision level of the MST region |
Instance Vlans Mapped |
VLAN-to-MSTI mappings in the MST region |
1.1.3 display stp
Syntax
display stp [ instance instance-id ] [ interface interface-list | slot slot-number ] [ brief ]
View
Any view
Parameters
instance-id: ID of the MSTI, ranging from 0 to 16. A value of 0 specifies the common and internal spanning tree (CIST).
interface-list: Ethernet port list. You can specify multiple Ethernet ports by providing this argument in the form of interface-list = { interface-type interface-number [ to interface-type interface-number ] } &<1-10>, where &<1-10> means that you can provide up to 10 port indexes/port index ranges for this argument.
slot slot-number: Specifies a slot, the STP-related information about which is to be displayed.
brief: Displays only port state and guard measures taken on the port.
Description
Use the display stp command to display the state and statistical information about one or all MSTIs.
The state and statistical information about MSTP can be used to analyze and maintain the topology of a network. It can also be used to make MSTP operate properly.
l If neither MSTI nor port list is specified, the command displays spanning tree information about all MSTIs on all ports in the order of port numbers.
l If only one MSTI is specified, the command displays information about the specified MSTI on all ports in the order of the port numbers.
l If only a port list is specified, the command displays information about all MSTIs on these ports in the order of the port numbers.
l If both an MSTI and a port list are specified, the command displays spanning tree information about the specified MSTI and the specified ports in the order of MSTI IDs.
MSTP state information includes:
l Global CIST parameters: Protocol operation mode, switch priority in the CIST instance, MAC address, Hello time, Max age, Forward delay, Max hops, the CIST root, the external path cost from the switch to the CIST root, region root, the internal path cost from the switch to the region root, CIST root port of the switch, the state of the BPDU (bridge protocol data unit) guard function (enabled or disabled), and the state of the digest snooping function (enabled or disabled).
l CIST port parameters: Port protocol, port role, port priority, path cost, designated bridge, designated port, edge port/non-edge port, whether or not the link on the port is a point-to-point link, the maximum transmitting speed, type of the enabled guard function, state of the digest snooping function (enabled or disabled), VLAN mappings, Hello time, Max age, Forward delay, Message-age time, and Remaining-hops.
l Global MSTI parameters: MSTI ID, bridge priority of the MSTI, region root, internal path cost, MSTI root port, and master bridge.
l MSTI port parameters: Port state, role, priority, path cost, designated bridge, designated port, and Remaining Hops.
The statistical information includes: the numbers of the TCN BPDUs, the configuration BPDUs, the RST BPDUs, and the MST BPDUs transmitted/received by each port.
Related commands: reset stp.
Examples
# Display the state and statistical information about an MSTI.
<H3C> display stp instance 0 interface Ethernet 2/0/1 to Ethernet 2/0/4 brief
MSTID Port Role STP State Protection
0 Ethernet2/0/1 ALTE DISCARDING LOOP
0 Ethernet2/0/2 DESI FORWARDING NONE
0 Ethernet2/0/3 DESI FORWARDING NONE
0 Ethernet2/0/4 DESI FORWARDING NONE
Table 1-2 Description on the fields of the display stp command
Field |
Description |
MSTID |
ID of an MSTI in the MST region |
Port |
Port number corresponding to the specified MSTI |
Role |
Port role |
STP State |
STP state on the port, which can be forwarding and discarding. |
Protection |
Guard type of the port |
1.1.4 display stp region-configuration
Syntax
display stp region-configuration
View
Any view
Parameters
None
Description
Use the display stp region-configuration command to display the activated MST region configuration information, including the region name, the revision level, and the VLAN-to-MSTI mappings configured for the switch.
Related commands: stp region-configuration.
Examples
# Display the activated MST region configuration.
<H3C> 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-3 Description on the fields of the display stp region-configuration command
Field |
Description |
Format selector |
The selector specified by MSTP |
Region name |
The name of the MST region |
Revision level |
The revision level of the MST region |
Instance Vlans Mapped |
VLAN-to-MSTI mappings in the MST region |
1.1.5 instance
Syntax
instance instance-id vlan vlan-list
undo instance instance-id [ vlan vlan-list ]
View
MST region view
Parameters
instance-id: ID of an MSTI, ranging from 0 to 16. A value of 0 specifies the CIST.
vlan-list: List of VLANs. You need to provide this argument in the form of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where &<1-10> means that you can provide up to 10 VLAN IDs/VLAN ID ranges for this argument. Normally, a VLAN ID can be a number ranging from 1 to 4094. VLANs with their IDs beyond this range (if the switch supports this kind of VLAN IDs), such as VLAN 4095, VLAN 4096, can only be mapped to the CIST (instance 0).
Description
Use the instance command to map specified VLANs to a specified MSTI.
Use the undo instance command to remove the mappings from the specified VLANs to the specified MSTI and remap the specified VLANs to the CIST (instance 0). If you specify no VLAN in the undo instance command, all VLANs mapped to the specified MSTI are remapped to the CIST.
By default, all VLANs are mapped to the CIST.
VLAN-to-MSTI mappings are recorded in the VLAN mapping table of an MSTP switch. So these two commands are actually used to manipulate the VLAN mapping table. You can add/remove a VLAN to/from the VLAN mapping table of a specific MSTI by using these two commands.
Note that a VLAN cannot be mapped to multiple MSTIs at the same time. A VLAN-to-MSTI mapping is automatically removed if you map the VLAN to another MSTI.
Related commands: region-name, revision-level, vlan-mapping modulo, check region-configuration, active region-configuration.
Examples
# Map VLAN 2 to MSTI 1.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp region-configuration
[H3C-mst-region] instance 1 vlan 2
1.1.6 region-name
Syntax
region-name name
undo region-name
View
MST region view
Parameters
name: MST region name to be set for the switch, a string of 1 to 32 characters.
Description
Use the region-name command to set an MST region name for a switch.
Use the undo region-name command to revert to the default MST region name.
The default MST region name of a switch is its MAC address.
The MST region name, along with the VLAN mapping table and the MSTP revision level, determines the MST region a switch belongs to.
Related commands: instance, revision-level, check region-configuration, vlan-mapping modulo, active region-configuration.
Examples
# Set the MST region name of the switch to hello.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp region-configuration
[H3C-mst-region] region-name hello
1.1.7 reset stp
Syntax
reset stp [ interface interface-list ]
View
User view
Parameters
interface-list: Ethernet port list. You can specify multiple Ethernet ports by providing this argument in the form of interface-list = { interface-type interface-number [ to interface-type interface-number ] } &<1-10>, where &<1-10> means that you can provide up to 10 port indexes/port index ranges for this argument.
Description
Use the reset stp command to clear spanning tree-related statistics on Ethernet ports.
The spanning tree statistics include the numbers of the TCN BPDUs, configuration BPDUs, RST BPDUs, and MST BPDUs sent/received through one or more specified ports or all ports (note that STP BPDUs and TCN BPDUs are counted only for CISTs.)
This command clears the spanning tree-related statistics on specified ports if you specify the interface-list argument. If you do not specify the interface-list argument, this command clears the spanning tree-related statistics on all ports.
Related commands: display stp.
Examples
# Clear the spanning tree-related statistics on Ethernet 2/0/1 through Ethernet 2/0/3.
<H3C> reset stp interface Ethernet 2/0/1 to Ethernet 2/0/3
1.1.8 revision-level
Syntax
revision-level level
undo revision-level
View
MST region view
Parameters
level: MSTP revision level to be set for the switch. This argument ranges from 0 to 65,535.
Description
Use the revision-level command to set the MSTP revision level for a switch.
Use the undo revision-level command to revert to the default revision level.
By default, the MSTP revision level is 0.
The MSTP revision level, along with the MST region name and the VLAN mapping table, determines the MST region a switch 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.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp region-configuration
[H3C-mst-region] revision-level 5
1.1.9 stp
Syntax
stp { enable | disable }
undo stp
View
System view, Ethernet port view
Parameters
enable: Enables MSTP globally or on a port.
disable: Disables MSTP globally or on a port.
Description
Use the stp command to enable/disable MSTP globally or on a port.
Use the undo stp command to revert to the default MSTP state globally or on a port.
By default, MSTP is disabled globally and on a port.
By default, once MSTP is enabled globally, it is enabled on a port.
After MSTP is enabled, the actual operation mode, which can be STP-compatible mode, RSTP-compatible mode, or MSTP mode, is determined by the protocol mode configured by users. A switch becomes a transparent bridge if MSTP is disabled.
After being enabled, MSTP maintains spanning trees by processing configuration BPDUs of different VLANs. After being disabled, it stops maintaining spanning trees.
Related commands: stp mode, stp interface.
Examples
# Enable MSTP globally.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp enable
# Disable MSTP on Ethernet 2/0/1.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] interface Ethernet 2/0/1
[H3C-Ethernet2/0/1] stp disable
1.1.10 stp bpdu-protection
Syntax
stp bpdu-protection
undo stp bpdu-protection
View
System view
Parameters
None
Description
Use the stp bpdu-protection command to enable the BPDU guard function.
Use the undo stp bpdu-protection command to revert to the default state of the BPDU guard function.
By default, the BPDU guard function is disabled.
Normally, the access ports of the devices operating on the access layer directly connect to terminals (such as PCs) or file servers. These ports are usually configured as edge ports to achieve rapid transition. But they resume non-edge ports automatically upon receiving configuration BPDUs, which causes spanning tree regeneration and network topology jitter.
Normally, no configuration BPDU will reach edge ports. But malicious users can attack a network by sending configuration BPDUs deliberately to edge ports to cause network jitter. You can prevent this type of attacks by utilizing the BPDU guard function. With this function enabled on a switch, the switch shuts down the edge ports that receive configuration BPDUs and then reports these cases to the administrator. If a port is shut down, only the administrator can restore it.
Examples
# Enable the BPDU guard function.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp bpdu-protection
1.1.11 stp bridge-diameter
Syntax
stp bridge-diameter bridgenum
undo stp bridge-diameter
View
System view
Parameters
bridgenum: Network diameter to be set for a switched network. This argument ranges from 2 to 7.
Description
Use the stp bridge-diameter command to set the network diameter of a switched network. The network diameter of a switched network is represented by the maximum possible number of switches between any two terminals in a switched network.
Use the undo stp bridge-diameter command to revert to the default network diameter.
By default, the maximum number of switches between any two terminal devices in the switched network is 7.
The network diameter parameter is represented by the maximum number of switches between two communication ends.
After you configure the network diameter of a switched network, MSTP adjusts its Hello time, Forward delay, and Max age settings accordingly. With the network diameter set to 7 (the default), the three time-relate settings, Hello time, Forward delay, and Max age, are set to their defaults as well.
The stp bridge-diameter command only applies to CIST; it is invalid for MSTIs.
Related commands: stp timer forward-delay, stp timer hello, stp timer max-age.
Examples
# Set the network diameter to 5.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp bridge-diameter 5
1.1.12 stp config-digest-snooping
Syntax
stp config-digest-snooping
undo stp config-digest-snooping
View
System view
Parameters
None
Description
Use the stp config-digest-snooping command to enable the digest snooping function.
Use the undo stp config-digest-snooping command to disable the digest snooping function.
The digest snooping function is disabled by default.
According to IEEE 802.1s, two connected switches can interwork with each other through MSTIs in an MST region only when the two switches have the same MST region-related configuration. With MSTP employed, interconnected switches determine whether or not they are in the same MST region by checking the configuration IDs of the BPDUs between them. (A configuration ID contains information such as region ID and configuration digest.)
As some other vendors' switches adopt proprietary spanning tree protocols, they cannot interwork with other switches in an MST region even if they are configured with the same MST region-related settings as other switches in the MST region.
This kind of problems can be overcome by implementing the digest snooping function. If a switch port is connected to another vendor's switch that has the same MST region-related settings but adopts a proprietary spanning tree protocol, you can enable digest snooping on the port. Then the switch regards the peer switch connected to the port as in the same region and records the configuration digests carried in the BPDUs received from the switch, which will be put in the BPDUs to be sent to the peer switch. In this way, the switch can interwork with other vendors’ switches in an MST region.
& Note:
l The digest snooping function is needed only when your S7500 switch is connected to other vendors’ proprietary spanning tree protocol-adopted switches.
l To enable the digest snooping function successfully, you must first enable it on all the switch ports that connect to other vendors’ proprietary spanning tree protocol-adopted switches and then enable it globally.
l To enable the digest snooping function, the interconnected switches must be configured with exactly the same MST region settings.
l The digest snooping function must be enabled on all the switch ports that connect to other vendors' proprietary spanning tree protocol-adopted switches in the same MST region.
l With the digest snooping function enabled, the VLAN-to-MSTI mapping cannot be modified.
l The digest snooping function is not applicable to ports on the boundary of an MST region.
l The digest snooping function is not applicable to edge ports.
Examples
# Enable the digest snooping function for Ethernet 2/0/1.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] interface Ethernet2/0/1
[H3C-Ethernet2/0/1] stp config-digest-snooping
[H3C-Ethernet2/0/1] quit
[H3C]stp config-digest-snooping
1.1.13 stp cost
Syntax
stp [ instance instance-id ] cost cost
undo stp [ instance instance-id ] cost
View
Ethernet port view
Parameters
instance-id: ID of an MSTI, ranging from 0 to 16. A value of 0 specifies the CIST.
cost: Path cost to be set for the port. This argument ranges from 1 to 200,000.
Description
Use the stp cost command to set the path cost of the current port in a specified MSTI.
Use the undo stp cost command to revert to the default path cost of the current port in the specified MSTI.
By default, a switch automatically calculates the path costs of a port in different MSTIs based on a specified standard.
If you specify the instance-id argument to be 0 or do not specify this argument, the stp cost command sets the path cost of the port on CIST.
The path costs of a port in MSTIs affect the roles of the ports in the MSTIs. By configuring different path costs for the same port in different MSTIs, you can make flows of different VLANs travel along different physical links, so as to achieve VLAN-based load balancing. Changing the path cost of a port in an MSTI may change the role of the port in the instance and put it in state transition.
Related commands: stp interface cost.
Examples
# Set the path cost of Ethernet 2/0/3 in MSTI 2 to 200.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] interface Ethernet2/0/3
[H3C-Ethernet2/0/3] stp instance 2 cost 200
1.1.14 stp edged-port
Syntax
stp edged-port { enable | disable }
undo stp edged-port
View
Ethernet port view
Parameters
enable: Configures the current Ethernet port as an edge port.
disable: Configures the current Ethernet port as a non-edge port.
Description
Use the stp edged-port enable command to configure the current Ethernet port as an edge port.
Use the stp edged-port disable command to configure the current Ethernet port as a non-edge port.
Use the undo stp edged-port command to restore the current Ethernet port to its default state.
By default, all Ethernet ports of a switch are non-edge ports.
An edge port is a port that is directly connected to a user terminal instead of another switch or a network segment. Rapid transition is applied to edge ports because, on these ports, no loops can be incurred by network topology changes. You can enable a port to transit to the forwarding state rapidly by setting it to an edge port. And you are recommended to configure the Ethernet ports directly connected to user terminals as edge ports to enable them to transit to the forwarding state rapidly.
Normally, configuration BPDUs cannot reach an edge port because the port is not connected to another switch. But when the BPDU guard function is disabled on an edge port, configuration BPDUs sent deliberately by a malicious user may reach the port. If an edge port receives a BPDU, it turns to a non-edge port.
Related commands: stp interface edged-port.
Caution:
Among loop guard function, root guard function and edge port setting, only one can be valid on a port at one time.
Examples
# Configure Ethernet 2/0/1 as a non-edge port.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] interface Ethernet2/0/1
[H3C-Ethernet2/0/1] stp edged-port disable
1.1.15 stp interface
Syntax
stp interface interface-list { enable | disable }
View
System view
Parameters
interface-list: Ethernet port list. You can specify multiple Ethernet ports by providing this argument in the form of interface-list = { interface-type interface-number [ to interface-type interface-number ] } &<1-10>, where &<1-10> means that you can provide up to 10 port indexes/port index ranges for this argument.
enable: Enables MSTP on the specified ports.
disable: Disables MSTP on the specified ports.
Description
Use the stp interface command to enable or disable MSTP on specified ports in system view.
By default, MSTP is enabled on the ports of a switch if MSTP is globally enabled on the switch, and is disabled on the ports if MSTP is globally disabled.
An MSTP-disabled port does not participate in any calculation of spanning tree and is always in forwarding state.
Caution:
Disabling MSTP on ports may result in loops.
Related commands: stp mode, stp.
Examples
# Enable MSTP on Ethernet 2/0/1 in system view.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp interface Ethernet 2/0/1 enable
1.1.16 stp interface config-digest-snooping
Syntax
stp interface interface-list config-digest-snooping
undo stp interface interface-list config-digest-snooping
View
System view
Parameters
interface-list: Ethernet port list. You can specify multiple Ethernet ports by providing this argument in the form of interface-list ={ interface-type interface-number [ to interface-type interface-number ] } &<1-10>, where &<1-10> means that you can provide up to 10 port indexes/port index ranges for this argument.
Description
Use the stp interface config-digest-snooping command to enable the digest snooping function.
Use the undo stp interface config-digest-snooping command to disable the digest snooping function.
By default, the digest snooping function is disabled.
According to IEEE 802.1s, two interconnected MSTP switches can interwork with each other through MSTIs in an MST region only when the two switches have the same MST region-related configuration. Interconnected MSTP switches determine whether or not they are in the same MST region by checking the configuration IDs of the BPDUs between them. (A configuration ID contains information such as region ID and configuration digest.)
As some other vendors' switches adopt proprietary spanning tree protocols, they cannot interwork with other switches in an MST region even if they are configured with the same MST region-related settings as other switches in the MST region.
This problem can be overcome by implementing the digest snooping function. If a port on an S7500 switch is connected to another vendor's switch that has the same MST region-related settings as its own but adopts a proprietary spanning tree protocol, you can enable digest snooping on the port. Then the S7500 switch regards the switch of another vendor as in the same region; it records the configuration digests carried in the BPDUs received from the switch of another vendor, and put them in the BPDUs to be sent to the switch of another vendor. In this way, the S7500 switches can interwork with other vendors' switches in the same MST region.
& Note:
l The digest snooping function is needed only when your S7500 switch is connected to other vendors’ proprietary protocol-adopted switches.
l To enable the digest snooping function successfully, you must first enable it on all the ports of your S7500 switch that are connected to other vendors’ proprietary protocol-adopted switches and then enable it globally.
l To enable the digest snooping function, the interconnected switches must be configured with exactly the same MST region-related configuration.
l The digest snooping function must be enabled on all the ports of your S7500 switch that are connected to other vendors' proprietary protocol-adopted switches in the same MST region.
l With the digest snooping function enabled, the VLAN-to-MSTI mapping cannot be modified.
l The digest snooping function is not applicable to MST region edge ports.
l The digest snooping function is not applicable to edge ports.
Examples
# Enable the digest snooping function on Ethernet 2/0/1 in system view.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp interface Ethernet 2/0/1 config-digest-snooping
1.1.17 stp interface cost
Syntax
stp interface interface-list [ instance instance-id ] cost cost
undo stp interface interface-list [ instance instance-id ] cost
View
System view
Parameters
interface-list: Ethernet port list. You can specify multiple Ethernet ports by providing this argument in the form of interface-list = { interface-type interface-number [ to interface-type interface-number ] } &<1-10>, where &<1-10> means that you can provide up to 10 port indexes/port index ranges for this argument.
instance-id: MSTI ID ranging from 0 to 16. A value of 0 specifies the CIST.
cost: Port path cost to be set. This argument ranges from 1 to 200,000,000.
Description
Use the stp interface cost command to set the path cost(s) of the specified port(s) in a specified MSTI in system view.
Use the undo stp interface cost command to revert to the default path cost(s) of the specified port(s) in the specified MSTI in system view.
By default, a switch automatically calculates the path costs of a port in different MSTIs based on a specified standard.
If you specify the instance-id argument to be 0 or do not specify this argument, the stp interface cost command sets the path cost(s) of the specified port(s) in the CIST.
The path costs of a port in MSTIs affect the roles of the ports in the MSTIs. By configuring different path costs for the same port in different MSTIs, you can make flows of different VLANs travel along different physical links, so as to achieve VLAN-based load balancing. Changing the path cost of a port in an MSTI may change the role of the port in the MSTI and put it in state transition.
The default port path cost differs with port speed. Refer to Table 1-4 for details.
Related commands: stp cost.
Examples
# Set the path cost of Ethernet 2/0/3 in MSTI 2 to 400 in system view.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp instance 2 interface Ethernet 2/0/3 cost 400
1.1.18 stp interface edged-port
Syntax
stp interface interface-list edged-port { enable | disable }
undo stp interface interface-list edged-port
View
System view
Parameters
interface-list: Ethernet port list. You can specify multiple Ethernet ports by providing this argument in the form of interface-list = { interface-type interface-number [ to interface-type interface-number ] } &<1-10>, where &<1-10> means that you can provide up to 10 port indexes/port index ranges for this argument.
enable: Configures the specified Ethernet ports to be edge ports.
disable: Configures the specified Ethernet ports to be non-edge ports.
Description
Use the stp interface edged-port enable command to configure the specified Ethernet port(s) as edge ports in system view.
Use the stp interface edged-port disable command to configure the specified Ethernet port(s) as non-edge ports in system view.
Use the undo stp interface edged-port command to restore the specified Ethernet port(s) to their default states.
By default, all Ethernet ports of a switch are non-edge ports.
An edge port is a port that is directly connected to a user terminal instead of another switch or a network segment. Rapid transition is applied to edge ports because, on these ports, no loops can be incurred by network topology changes. You can enable a port to transit to the forwarding state rapidly by setting it to an edge port. And you are recommended to configure the Ethernet ports directly connected to user terminals as edge ports to enable them to transit to the forwarding state rapidly.
Normally, configuration BPDUs cannot reach an edge port because the port is not connected to another switch. But when the BPDU guard function is disabled on an edge port, configuration BPDUs sent deliberately by a malicious user may reach the port. If an edge port receives a BPDU, it turns to a non-edge port.
Related commands: stp edged-port.
Caution:
Among loop guard function, root guard function and edge port setting, only one can be valid on a port at one time.
Examples
# Configure Ethernet 2/0/3 as an edge port in system view.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp interface Ethernet 2/0/3 edged-port enable
1.1.19 stp interface loop-protection
Syntax
stp interface interface-list loop-protection
undo stp interface interface-list loop-protection
View
System view
Parameters
interface-list: Ethernet port list. You can specify multiple Ethernet ports by providing this argument in the form of interface-list = { interface-type interface-number [ to interface-type interface-number ] } &<1-10>, where &<1-10> means that you can provide up to 10 port indexes/port index ranges for this argument.
Description
Use the stp interface loop-protection command to enable the loop guard function in system view.
Use the undo stp interface loop-protection command to revert to the default state of the loop guard function in system view.
The loop guard function is disabled by default.
Related commands: stp loop-protection.
Caution:
Among loop guard function, root guard function and edge port setting, only one can be valid on the same port.
Examples
# Enable the loop guard function on Ethernet 2/0/1.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp interface Ethernet 2/0/1 loop-protection
1.1.20 stp interface mcheck
Syntax
stp [ interface interface-list ] mcheck
View
System view
Parameters
interface-list: Ethernet port list. You can specify multiple Ethernet ports by providing this argument in the form of interface-list = { interface-type interface-number [ to interface-type interface-number ] } &<1-10>, where &<1-10> means that you can provide up to 10 port indexes/port index ranges for this argument.
Description
Use the stp interface mcheck command to perform the mCheck operation on specified port(s) in system view.
A port on an MSTP-enabled switch toggles to the STP-/RSTP-compatible mode automatically if an STP-/RSTP-enabled switch is connected to it. But when the STP-/RSTP-enabled switch is disconnected from the port, the port cannot toggle back to the MSTP mode automatically. In this case, you can force the port to toggle to the MSTP mode by performing the mCheck operation on the port.
Related commands: stp mcheck, stp mode.
Examples
# Perform the mCheck operation for Ethernet 2/0/3 in system view.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp interface Ethernet 2/0/3 mcheck
1.1.21 stp interface no-agreement-check
Syntax
stp interface interface-type interface-number no-agreement-check
undo stp interface interface-type interface-number no-agreement-check
View
System view
Parameters
interface-type: Port type.
interface-number: Port number.
Description
Use the stp interface no-agreement-check command to enable the rapid transition function on a specified port.
Use the undo stp interface no-agreement-check command to disable the rapid transition function on a specified port.
The rapid transition function is disabled on any port by default.
Some other vendors' switches adopt proprietary spanning tree protocols that are similar to RSTP in the way to implement rapid transition on designated ports. When a switch of this kind operates as the upstream switch of an S7500 switch running MSTP, the upstream designated port fails to change their states rapidly.
The rapid transition function is developed to avoid this case. When an S7500 switch running MSTP is connected in the upstream direction to another vendor's switch running proprietary spanning tree protocol, you can enable the rapid transition function on the ports of the S7500 switch operating as the downstream switch. Among these ports, the root ports will then send agreement packets to their upstream ports after they receive proposal packets from the upstream designated ports, instead of waiting for agreement packets from the upstream switch. This enables designated ports of the upstream switch to change their states rapidly.
Related commands: stp no-agreement-check.
& Note:
l The rapid transition function can be enabled on root ports or alternate ports only.
l If you configure the rapid transition function on the designated port, the function does not take effect on the port.
Examples
# Enable the rapid transition function for Ethernet 2/0/1.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C]stp interface Ethernet2/0/1 no-agreement-check
1.1.22 stp interface point-to-point
Syntax
stp interface interface-list point-to-point { force-true | force-false | auto }
undo stp interface interface-list point-to-point
View
System view
Parameters
interface-list: Ethernet port list. You can specify multiple Ethernet ports by providing this argument in the form of interface-list = { interface-type interface-number [ to interface-type interface-number ] } &<1-10>, where &<1-10> means that you can provide up to 10 port indexes/port index ranges for this argument.
force-true: Specifies that the links connected to the specified Ethernet ports are point-to-point links.
force-false: Specifies that the links connected to the specified Ethernet ports are not point-to-point links.
auto: Specifies to automatically determine whether or not the links connected to the specified Ethernet ports are point-to-point links.
Description
Use the stp interface point-to-point command to specify whether the links connected to the specified Ethernet ports are point-to-point links in system view.
Use the undo stp interface point-to-point command to restore the links connected to the specified ports to their default link types, which are automatically determined by MSTP.
If no keyword is specified in the stp interface point-to-point command, the auto keyword is used by default, and so MSTP automatically determines the types of the links connected to the specified ports.
The rapid transition function is not applicable to ports on non-point-to-point links.
If an Ethernet port is the master port of an aggregated port or operates in full-duplex mode, the link connected to the port is a point-to-point link.
You are recommended to let MSTP automatically determine the link types.
These two commands only apply to CIST and MSTIs. If you configure the link to which a port is connected to be a point-to-point link (or a non-point-to-point link), the configuration applies to all MSTIs (that is, the port is configured to connect to a point-to-point link (or a non-point-to-point link) in all MSTIs). If the actual physical link is not a point-to-point link and you configure the link to which the port is connected to be a point-to-point link, loops may temporarily occur.
Related commands: stp point-to-point.
Examples
# Configure the link connected to Ethernet 2/0/3 as a point-to-point link in system view.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp interface Ethernet 2/0/3 point-to-point force-true
1.1.23 stp interface port priority
Syntax
stp interface interface-list instance instance-id port priority priority
undo stp interface interface-list instance instance-id port priority
View
System view
Parameters
interface-list: Ethernet port list. You can specify multiple Ethernet ports by providing this argument in the form of interface-list = { interface-type interface-number [ to interface-type interface-number ] } &<1-10>, where &<1-10> means that you can provide up to 10 port indexes/port index ranges for this argument.
instance-id: MSTI ID ranging from 0 to 16. A value of 0 specifies the CIST.
priority: Port priority to be set. This argument ranges from 0 to 240 and must be a multiple of 16 (such as 0, 16, and 32). The default port priority of a port in any MSTI is 128.
Description
Use the stp interface port priority command to set a port priority for the specified ports in the specified MSTI.
Use the undo stp interface port priority command to restore the specified ports to the default port priority in the specified MSTI.
If you specify the instance-id argument to be 0, these two commands apply to the port priorities on the CIST. The role a port plays in an MSTI is determined by the port priority in the MSTI. A port on an MSTP-enabled switch can have different port priorities and play different roles in different MSTIs. This enables packets of different VLANs to be forwarded along different physical paths, so as to achieve load balancing by VLANs. Changing port priorities results in port roles being re-determined and may cause state transitions.
Related commands: stp port priority.
Examples
# Set the port priority of Ethernet 2/0/3 to 16 in MSTI 2.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp interface Ethernet 2/0/3 instance 2 port priority 16
1.1.24 stp interface root-protection
Syntax
stp interface interface-list root-protection
undo stp interface interface-list root-protection
View
System view
Parameters
interface-list: Ethernet port list. You can specify multiple Ethernet ports by providing this argument in the form of interface-list = { interface-type interface-number [ to interface-type interface-number ] } &<1-10>, where &<1-10> means that you can provide up to 10 port indexes/port index ranges for this argument.
Description
Use the stp interface root-protection command to enable the root guard function on specified port(s).
Use the undo stp interface root-protection command to restore the root guard function to the default state on specified port(s).
By default, the root guard function is disabled.
Configuration errors or attacks may result in configuration BPDUs with their priorities higher than that of a root bridge, which causes new root bridge to be elected and network topology jitter to occur. In this case, flows that should travel along high-speed links may be led to low-speed links, and network congestion may occur.
You can avoid this by utilizing the root guard function. Ports with this function enabled can only be kept as designated ports in all MSTIs. When a port of this type receives configuration BPDUs with higher priorities, it changes to discarding state (rather than becomes a non-designated port) and stops forwarding packets (as if it is disconnected from the link). It resumes the normal state if it does not receive any configuration BPDUs with higher priorities for a specified period.
Related commands: stp root-protection.
Caution:
Among loop guard function, root guard function and edge port setting, only one can be valid on a port at one time.
Examples
# Enable the root guard function on Ethernet 2/0/1.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp interface Ethernet 2/0/1 root-protection
1.1.25 stp interface transmit-limit
Syntax
stp interface interface-list transmit-limit packetnum
undo stp interface interface-list transmit-limit
View
System view
Parameters
interface-list: Ethernet port list. You can specify multiple Ethernet ports by providing this argument in the form of interface-list = { interface-type interface-number [ to interface-type interface-number ] } &<1-10>, where &<1-10> means that you can provide up to 10 port indexes/port index ranges for this argument.
packetnum: Maximum number of configuration BPDUs a port can send in each Hello time. This argument ranges from 1 to 255 and defaults to 10.
Description
Use the stp interface transmit-limit command to set the maximum number of configuration BPDUs each specified port can send in each Hello time.
Use the undo stp interface transmit-limit command to revert to the default maximum number.
The larger the packetnum argument is, the more packets a port can transmit in each Hello time. Configure the packetnum argument to a proper value to limit the number of BPDUs a port can send in each Hello time to prevent MSTP from occupying too much network resources when network topology jitter occurs.
Related commands: stp transmit-limit.
Examples
# Set the maximum transmitting speed of Ethernet 2/0/3 to 5.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp interface Ethernet 2/0/3 transmit-limit 5
1.1.26 stp loop-protection
Syntax
stp loop-protection
undo stp loop-protection
View
Ethernet port view
Parameters
None
Description
Use the stp loop-protection command to enable the loop guard function on the current port.
Use the undo stp loop-protection command to restore the loop guard function to the default state on the current port.
By default, the loop guard function is disabled.
A switch maintains the states of the root port and other blocked ports by receiving and processing BPDUs from the upstream switch. These BPDUs may get lost because of network congestions and link failures. If a switch does not receive BPDUs from the upstream switch for a certain period, the switch selects a new root port; the original root port becomes a designated port; and the blocked ports transit to forwarding state. This may cause loops in the network.
The loop guard function suppresses loops. With this function enabled, if link congestions or link failures happen, a root port becomes a designated port, and the port state becomes discarding. The blocked port also becomes designated port and the port state becomes discarding (that is, the blocked ports do not forward packets), and thereby loops can be prevented in the network.
Examples
# Enable the loop guard function on Ethernet 2/0/1.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] interface Ethernet2/0/1
[H3C-Ethernet2/0/1] stp loop-protection
1.1.27 stp max-hops
Syntax
stp max-hops hops
undo stp max-hops
View
System view
Parameters
hops: Maximum hops to be set. This argument ranges from 1 to 40. The default maximum hop value of an MST region is 20.
Description
Use the stp max-hops command to set the maximum hops for the MST region the current switch belongs to.
Use the undo stp max-hops command to revert to the default maximum hops.
The maximum hop values configured on the region roots of the CIST and MSTI in an MST region limit the size of the MST region.
A configuration BPDU contains a field that maintains the remaining hops of the configuration BPDU. And a switch discards the configuration BPDUs whose remaining hops are 0. After a configuration BPDU reaches a root bridge of a spanning tree in an MST region, the value of the remaining hops field in the configuration BPDU is decreased by 1 every time the configuration BPDU passes a switch. Such a mechanism disables the switches beyond the maximum hops from participating in spanning tree generation, and thus limits the size of an MST region.
With such a mechanism, the maximum hops configured on the switch operating as the root bridge of the CIST or an MSTI in an MST region becomes the network diameter of the spanning tree, which limits the size of the spanning tree in the current MST region. The switches that are not root bridges in the MST region adopt the maximum hop settings of their root bridges.
Examples
# Set the maximum hops of the current MST region to 35.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp max-hops 35
1.1.28 stp mcheck
Syntax
stp mcheck
View
Ethernet port view
Parameters
None
Description
Use the stp mcheck command to perform the mCheck operation on the current port.
When a port on an MSTP-enabled upstream switch connects with an STP-enabled downstream switch, the port transits to the STP-compatible mode automatically. But when the STP-enabled downstream switch is then replaced by an MSTP-enabled switch, the port cannot automatically transit to the MSTP mode but remains in the STP-compatible mode. In this case, you can force the port to transit to the MSTP mode by performing the mCheck operation on the port.
Similarly, when a port on an RSTP-compatible upstream switch connects with an STP-enabled downstream switch, the port transits to the STP-compatible mode. But when the STP-enabled downstream switch is then replaced by an MSTP-enabled switch, the port cannot automatically transit to the MSTP mode but remains in the STP-compatible mode. In this case, you can force the port to transit to the MSTP-compatible mode by performing the mCheck operation on the port.
Related commands: stp mode, stp interface mcheck.
Examples
# Perform the mCheck operation for Ethernet 2/0/1.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] interface Ethernet2/0/1
[H3C-Ethernet2/0/1] stp mcheck
1.1.29 stp mode
Syntax
stp mode { stp | rstp | mstp }
undo stp mode
View
System view
Parameters
stp: Enables the STP-compatible mode.
mstp: Enables the MSTP mode.
rstp: Enables RSTP-compatible.
Description
Use the stp mode command to set the MSTP operation mode.
Use the undo stp mode command to revert to the default MSTP operation mode.
By default, a switch operates in MSTP mode.
To make a switch compatible with STP/RSTP, MSTP provides following three operation modes:
l STP-compatible mode, where a switch sends out STP BPDU packets
l RSTP-compatible mode, where a switch sends out RSTP BPDU packets
l MSTP mode, where a switch sends out MSTP BPDU packets
Related commands: stp mcheck, stp, stp interface, stp interface mcheck.
Examples
# Configure the switch to operate in STP-compatible mode.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp mode stp
1.1.30 stp no-agreement-check
Syntax
stp no-agreement-check
undo stp no-agreement-check
View
Ethernet port view
Parameters
None
Description
Use the stp no-agreement-check command to enable the rapid transition function for a port.
Use the stp no-agreement-check command to disable the rapid transition function.
By default, the rapid transition function is disabled on a port.
Some other vendors' switches adopt proprietary spanning tree protocols that are similar to RSTP in the way to implement rapid transition on designated ports. When a switch of this kind operates as the upstream switch of an S7500 switch running MSTP, the upstream designated port fails to change their states rapidly.
The rapid transition function is designed to resolve this problem. When an S7500 switch running MSTP is connected in the upstream direction to another vendor's switch running proprietary spanning tree protocol, you can enable the rapid transition function on the ports of the S7500 switch operating as the downstream switch. Among these ports, the root ports will then send agreement packets to their upstream ports after they receive proposal packets from the upstream designated ports, instead of waiting for agreement packets from the upstream switch. This enables designated ports of the upstream switch to change their states rapidly.
Related commands: stp interface no-agreement-check.
& Note:
l The rapid transition function can be enabled on root ports or alternate ports only.
l If you configure the rapid transition function on the designated port, the function does not take effect on the port.
Examples
# Enable the rapid transition function for Ethernet 2/0/1.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C]interface Ethernet2/0/1
[H3C-Ethernet2/0/1]stp no-agreement-check
1.1.31 stp pathcost-standard
Syntax
stp pathcost-standard { dot1d-1998 | dot1t | legacy }
undo stp pathcost-standard
View
System view
Parameters
dot1d-1998: Uses the IEEE 802.1D-1998 standard to calculate the default path costs of ports.
dot1t: Uses the IEEE 802.1t standard to calculate the default path costs of ports.
legacy: Uses the proprietary standard to calculate the default path costs of ports.
Description
Use the stp pathcost-standard command to set the standard to be used to calculate the default path costs of the links connected to the switch.
Use the undo stp pathcost-standard command to specify to use the default standard.
By default, a switch uses the legacy standard to calculate the default path costs of ports.
Table 1-4 Transmission speeds and the corresponding path costs
Transmission speed |
Operation mode (half-/full-duplex) |
802.1D-1998 |
IEEE 802.1t |
Standard defined by Private |
0 |
— |
65535 |
200,000,000 |
200,000 |
10 Mbps |
Half-Duplex/Full-Duplex Aggregated Link 2 Ports Aggregated Link 3 Ports Aggregated Link 4 Ports |
100 95 95 95 |
2,000,000 1,000,000 666,666 500,000 |
2,000 1,800 1,600 1,400 |
100 Mbps |
Half-Duplex/Full-Duplex Aggregated Link 2 Ports Aggregated Link 3 Ports Aggregated Link 4 Ports |
19 15 15 15 |
200,000 100,000 66,666 50,000 |
200 180 160 140 |
1000 Mbps |
Full-Duplex Aggregated Link 2 Ports Aggregated Link 3 Ports Aggregated Link 4 Ports |
4 3 3 3 |
20,000 10,000 6,666 5,000 |
20 18 16 14 |
10 Gbps |
Full-Duplex Aggregated Link 2 Ports Aggregated Link 3 Ports Aggregated Link 4 Ports |
2 1 1 1 |
2,000 1,000 666 500 |
2 1 1 1 |
Normally, when a port operates in full-duplex mode, the corresponding path cost is slightly less than that when the port operates in half-duplex mode.
When calculating the path cost of an aggregated link, the 802.1D-1998 standard does not take the number of the ports on the aggregated link into account, whereas the 802.1T standard does. The following formula is used to calculate the path cost of an aggregated link:
Path cost = 200,000,000 / link transmission speed,
Where the link transmission speed is the sum of the speeds of the unblocked ports on the aggregated link, which is measured in 100 Kbps.
Examples
# Configure to use the IEEE 802.1D-1998 standard to calculate the default path costs of ports.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp pathcost-standard dot1d-1998
# Configure to use the IEEE 802.1t standard to calculate the default path costs of ports.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp pathcost-standard dot1t
1.1.32 stp point-to-point
Syntax
stp point-to-point { force-true | force-false | auto }
undo stp point-to-point
View
Ethernet port view
Parameters
force-true: Specifies that the link connected to the current Ethernet port is a point-to-point link.
force-false: Specifies that the link connected to the current Ethernet port is not a point-to-point link.
auto: Specifies to automatically determine whether or not the link connected to the current Ethernet port is a point-to-point link.
Description
Use the stp point-to-point command to specify whether the link connected to the current Ethernet port is a point-to-point link.
Use the undo stp point-to-point command to restore the link connected to the current Ethernet port to its default link type, which is automatically determined by MSTP.
If no keyword is specified in the stp point-to-point command, the auto keyword is used by default, and so MSTP automatically determines the type of the link connected to the current port.
The rapid transition function is not applicable to ports on non-point-to-point links.
If an Ethernet port is the master port of an aggregation port or operates in full-duplex mode, the link connected to the port is a point-to-point link.
You are recommended to let MSTP automatically determine the link types of ports.
These two commands only apply to CISTs and MSTIs. If you configure the link to which a port is connected is a point-to-point link (or a non-point-to-point link), the configuration applies to all MSTIs (that is, the port is configured to connect to a point-to-point link [or a non-point-to-point link] in all MSTIs). If the actual physical link is not a point-to-point link and you configure the link to which the port is connected to be a point-to-point link, loops may temporarily occur.
Related commands: stp interface point-to-point.
Examples
# Configure the link connected to Ethernet2/0/3 as a point-to-point link.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] interface Ethernet2/0/3
[H3C-Ethernet2/0/3] stp point-to-point force-true
1.1.33 stp port priority
Syntax
stp [ instance instance-id ] port priority priority
undo stp [ instance instance-id ] port priority
View
Ethernet port view
Parameters
instance-id: MSTI ID ranging from 0 to 16. A value of 0 specifies the CIST.
port priority priority: Sets the port priority. The priority argument ranges from 0 to 240 and must be a multiple of 16 (such as 0, 16, and 32). The default port priority of a port in any MSTI is 128.
Description
Use the stp port priority command to set the port priority of the current port in the specified MSTI.
Use the undo stp port priority command to restore the current port to the default port priority in the specified MSTI.
If you specify the instance-id argument to be 0 or do not specify the argument, these two commands apply to the port priorities on the CIST. The role a port plays in an MSTI is determined by the port priority in the MSTI. A port on an MSTP-enabled switch can have different port priorities and play different roles in different MSTIs. This enables packets of different VLANs to be forwarded along different physical paths, so as to achieve load balancing by VLANs. Changing port priorities result in port roles being re-determined and may cause state transitions.
Related commands: stp interface port priority.
Examples
# Set the port priority of Ethernet 2/0/3 in MSTI 2 to 16.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] interface Ethernet2/0/3
[H3C-Ethernet2/0/3] stp instance 2 port priority 16
1.1.34 stp priority
Syntax
stp [ instance instance-id ] priority priority
undo stp [ instance instance-id ] priority
View
System view
Parameters
instance-id: MSTI ID ranging from 0 to 16. A value of 0 specifies the CIST.
priority: Switch priority to be set. This argument ranges from 0 to 61,440 and must be a multiple of 4,096 (such as 0, 4,096, and 8,192). There are totally 16 available switch priorities.
Description
Use the stp priority command to set the priority of the switch in the specified MSTI.
Use the undo stp priority command to restore the switch to the default priority in the specified MSTI.
The default priority of a switch is 32,768.
The priorities of switches are used for spanning tree generation. Switch priorities are MSTI-specific. That is, you can set different priorities for the same switch in different MSTIs.
If you do not specify the instance-id argument, the two commands apply to the CIST.
Examples
# Set the priority of the switch in MSTI 1 to 4,096.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp instance 1 priority 4096
1.1.35 stp region-configuration
Syntax
stp region-configuration
undo stp region-configuration
View
System view
Parameters
None
Description
Use the stp region-configuration command to enter MST region view.
Use the undo stp region-configuration command to revert to the default MST region-related settings.
MST region-related settings include: region name, revision level, and VLAN mapping table. The three MST region-related settings default to:
l MST region name: The first MAC address of the switch
l VLAN mapping table: All VLANs are mapped to the CIST.
l MSTP revision level: 0
And you can modify the three settings after entering MST region view by using the stp region-configuration command.
Examples
# Enter MST region view.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp region-configuration
[H3C-mst-region]
1.1.36 stp root primary
Syntax
stp [ instance instance-id ] root primary [ bridge-diameter bridgenum ] [ hello-time centi-seconds ]
undo stp [ instance instance-id ] root
View
System view
Parameters
instance-id: MSTI ID ranging from 0 to 16. A value of 0 specifies the CIST.
bridgenum: Network diameter of the specified MSTI. This argument ranges from 2 to 7 and defaults to 7.
centi-seconds: Hello time (in centiseconds) of the specified MSTI. This argument ranges from 100 to 1,000 and defaults to 200.
Description
Use the stp root primary command to configure the current switch as the root bridge of a specified MSTI.
Use the undo stp root command to cancel the current configuration.
By default, a switch is not configured as a root bridge.
If you do not specify the instance-id argument, these two commands apply to the CIST.
You can specify the current switch as the root bridge of an MSTI regardless of the priority of the switch. You can also specify the network diameter of the switched network by using the stp root primary command. The switch will then figure out the following three time parameters: Hello time, Forward delay, and Max age. As the Hello time figured out by the network diameter is not always the optimal one, you can set it manually through the hello-time centi-seconds parameter. Normally, you are recommended to set the network diameter and leave the Forward delay and Max age parameters being automatically determined by the network diameter you set.
Caution:
l You can configure only one root bridge for an MSTI and can configure one or more secondary root bridges for an MSTI. Configuring multiple root bridges for an MSTI causes unpredictable spanning tree computing results.
l Once a switch is configured as the root bridge or a secondary root bridge, its priority cannot be modified.
Examples
# Configure the current switch as the root bridge of MSTI 1, setting the network diameter of the switched network to 4, and the Hello time to 500 centiseconds.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp instance 1 root primary bridge-diameter 4 hello-time 500
1.1.37 stp root secondary
Syntax
stp [ instance instance-id ] root secondary [ bridge-diameter bridgenum ] [ hello-time centi-seconds ]
undo stp [ instance instance-id ] root
View
System view
Parameters
instance-id: MSTI ID ranging from 0 to 16. A value of 0 specifies the CIST.
bridgenum: Network diameter of the specified MSTI. This argument ranges from 2 to 7 and defaults to 7.
centi-seconds: Hello time in centiseconds of the specified MSTI. This argument ranges from 100 to 1,000 and defaults to 200.
Description
Use the stp root secondary command to configure the current switch as a secondary root bridge of a specified MSTI.
Use the undo stp root command to cancel the current configuration.
By default, a switch does not operate as a secondary root bridge.
If you do not specify the instance-id argument, these two commands apply to the CIST.
You can configure one or more secondary root bridges for an MSTI. If the switch operating as the root bridge fails or is turned off, the secondary root bridge with the least MAC address becomes the root bridge.
You can also specify the network diameter and the Hello time of the switch that you are configuring as a secondary root bridge. The switch will then figures out the other two time parameters: Forward delay and Max age. You can configure only one root bridge for an MSTI but you can configure one or more secondary root bridges for an MSTI.
Once a switch is configured as the root bridge or a secondary root bridge, its priority cannot be modified.
Examples
# Configure the current switch as a secondary root bridge of MSTI 4, setting the network diameter of the switched network to 5 and the Hello time to 300 centiseconds.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp instance 4 root secondary bridge-diameter 5 hello-time 300
1.1.38 stp root-protection
Syntax
stp root-protection
undo stp root-protection
View
Ethernet port view
Parameters
None
Description
Use the stp root-protection command to enable the root guard function on the current port.
Use the undo stp root-protection command to restore the root guard function to the default state on the current port.
By default, the root guard function is disabled.
Configuration errors or attacks may result in configuration BPDUs with their priorities higher than that of a root bridge, which causes new root bridge to be elected and network topology jitter to occur. In this case, flows that are to travel along high-speed links may be led to low-speed links, and network congestion may occur.
You can avoid this by utilizing the root guard function. Ports with this function enabled can only be kept as designated ports in all MSTIs. When a port of this type receives configuration BPDUs with higher priorities, it changes to discarding state (rather than becomes a non-designated port) and stops forwarding packets (as if it is disconnected from the link). It resumes the normal state if it does not receive any configuration BPDUs with higher priorities for a specified period.
Related commands: stp interface root-protection.
Examples
# Enable the root guard function on Ethernet 2/0/1.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] interface Ethernet2/0/1
[H3C-Ethernet2/0/1] stp root-protection
1.1.39 stp tc-protection
Syntax
stp tc-protection enable
stp tc-protection disable
View
System view
Parameters
None
Description
Use the stp tc-protection enable command to enable the TC-BPDU guard function.
Use the stp tc-protection disable command to disable the TC-BPDU guard function.
By default, the TC-BPDU guard function is enabled.
A switch removes MAC address entries and ARP entries upon receiving TC-BPDUs. If a malicious user sends a large amount of TC-BPDUs to a switch in a short period, the switch may busy itself in removing MAC address entries and ARP entries, which may decreases the performance and stability of the switch.
With the TC-BPDU guard function enabled, a switch performs only one removing operation in a specified period (10 seconds by default) after it receives a TC-BPDU. The switch also checks to see if other TC-BPDUs arrive in this period and performs another removing operation in the next period if a TC-BPDU is received. Such a mechanism prevents a switch from being busying itself in performing removing operations.
Examples
# Enable the TC-BPDU guard function on the switch.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp tc-protection enable
1.1.40 stp timer forward-delay
Syntax
stp timer forward-delay centi-seconds
undo stp timer forward-delay
View
System view
Parameters
centi-seconds: Forward delay in centiseconds to be set. This argument ranges from 400 to 3,000 and defaults to 1,500.
Description
Use the stp timer forward-delay command to set the forward delay of the switch.
Use the undo stp timer forward-delay command to revert to the default Forward delay.
To prevent the occurrence of temporary loops, when a port changes its state from discarding to forwarding, it undergoes an intermediate state and waits for a specific period to synchronize with the remote switches. This state transition period is determined by the Forward delay configured on the root bridge.
The Forward delay setting configured on a root bridge applies to all switches operating in the same MSTI.
As for the configuration of the three time-related parameters (that is, the Hello time, Forward delay, and Max age parameters), the following formulas must be met to prevent network jitter.
2 x (Forward delay – 1 second) >= Max age
Max age >= 2 x (Hello time + 1 second)
You are recommended to specify the network diameter of the switched network and the Hello time by using the stp root primary or stp root secondary command. After that, the three proper time-related parameters are automatically determined.
Related commands: stp timer hello, stp timer max-age, stp bridge-diameter.
Examples
# Set the Forward delay to 2,000 centiseconds.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp timer forward-delay 2000
1.1.41 stp timer hello
Syntax
stp timer hello centi-seconds
undo stp timer hello
View
System view
Parameters
centi-seconds: Hello time in centiseconds to be set. This argument ranges from 100 to 1,000 and defaults to 200.
Description
Use the stp timer hello command to set the Hello time of the switch.
Use the undo stp timer hello command to revert to the default Hello time.
A root bridge regularly sends out configuration BPDUs to maintain the existing MSTIs. The Hello time is used to set the sending interval. When a switch becomes a root bridge, it regularly sends BPDUs at the interval specified by the hello time you have configured on it. While, the other non-root-bridge switches listen to the BPDUs; if they do not receive a BPDU in a specific period, spanning trees will be regenerated.
As for the configuration of the three time-related parameters (that is, the Hello time, Forward delay, and Max age parameters), the following formulas must be met to prevent network jitter:
2 * (Forward delay – 1 second) >= Max age
Max age >= 2 * (Hello time + 1 second)
You are recommended to specify the network diameter of the switched network and the Hello time by using the stp root primary or stp root secondary command. After that, the three proper time-related parameters are automatically determined.
Related commands: stp timer forward-delay, stp timer max-age, stp bridge-diameter.
Examples
# Set the Hello time to 400 centiseconds.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp timer hello 400
1.1.42 stp timer max-age
Syntax
stp timer max-age centi-seconds
undo stp timer max-age
View
System view
Parameters
centi-seconds: Max age in centiseconds to be set. This argument ranges from 600 to 4,000 and defaults to 2,000.
Description
Use the stp timer max-age command to set the Max age of the switch.
Use the undo stp timer max-age command to revert to the default Max age.
MSTP is capable of detecting link failures and automatically restoring redundant links to forwarding state. In CIST, switches use the Max age parameter to judge whether or not a received configuration BPDU times out. And spanning trees will be regenerated if a configuration BPDU received by a port times out.
The Max age is meaningless to MSTIs. The Max age configured for the root bridge of the CIST applies to all switches operating on the CIST, including the CIST root bridge.
As for the configuration of the three time-related parameters (that is, the Hello time, Forward delay, and Max age parameters), the following formulas must be met to prevent network jitter:
2 * (Forward delay – 1 second) >= Max age,
Max age >= 2 * (Hello time + 1 second).
You are recommended to specify the network diameter of the switched network and the Hello time parameter by using the stp root primary or stp root secondary command. After that, the three proper time-related parameters are automatically determined.
Related commands: stp timer forward-delay, stp timer hello, stp bridge-diameter.
Examples
# Set the Max age to 1,000 centiseconds.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp timer max-age 1000
1.1.43 stp timer-factor
Syntax
stp timer-factor number
undo stp timer-factor
View
System view
Parameters
number: Hello time factor used to set the timeout time. This argument ranges from 1 to 10 and defaults to 3.
Description
Use the stp timer-factor command to set the timeout time of MSTP protocol packets on a switch in the form of a multiple of the Hello time. For example, with the number argument set to 3, the timeout time is three times of the Hello time.
Use the undo stp timer-factor command to revert to the default Hello time factor.
A switch regularly sends protocol packets to its neighboring devices at the interval specified by the Hello time parameter to test the links. Normally, a switch regards its upstream switch faulty if the former does receive any protocol packet from the latter in a period three times of the Hello time and then initiates the spanning tree regeneration process.
Spanning trees may be regenerated even in a steady network if an upstream switch continues to be busy. You can configure the timeout time factor to a larger number to avoid this problem. Normally, the timeout time can be four (or more) times of the Hello time. For a steady network, the timeout time can be five to seven times of the Hello time.
Examples
# Set the Hello time factor to 7.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp timer-factor 7
1.1.44 stp transmit-limit
Syntax
stp transmit-limit packetnum
undo stp transmit-limit
View
Ethernet port view
Parameters
packetnum: Maximum number of configuration BPDUs a port can transmit in each Hello time. This argument ranges from 1 to 255 and defaults to 10.
Description
Use the stp transmit-limit command to set the maximum number of configuration BPDUs the current port can transmit in each Hello time.
Use the undo stp transmit-limit command to revert to the default maximum number.
A larger number configured by the stp transmit-limit command allows more configuration BPDUs to be transmitted in each Hello time, which may occupy more switch resources. So configure it to a proper value to avoid MSTP from occupying too many network resources.
Related commands: stp interface transmit-limit.
Examples
# Set the maximum number of configuration BPDUs that can be transmitted by Ethernet 2/0/1 in each Hello time to 15.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] interface Ethernet2/0/1
[H3C-Ethernet2/0/1] stp transmit-limit 15
1.1.45 vlan-mapping modulo
Syntax
vlan-mapping modulo modulo
View
MST region view
Parameters
modulo: Modulo ranging from 1 to 16.
Description
Use the vlan-mapping modulo command to map VLANs to specific the specific MSTIs.
By default, all VLANs in a network are mapped to the CIST (MSTI 0).
MSTP uses a VLAN mapping table to describe VLAN-to-MSTI mappings. You can use this command to establish the VLAN mapping table and to map VLANs to the specific MSTI.
Note that a VLAN cannot be mapped to multiple different MSTIs at the same time. A VLAN-to-MSTI mapping becomes invalid when you map the VLAN to another MSTI.
& Note:
You can map VLANs to the specific MSTIs quickly by using the vlan-mapping modulo modulo command. The ID of the MSTI to which a VLAN is mapped can be figured out by using the following expression:
(VLAN ID-1) % modulo + 1,
Where (VLAN ID-1) % modulo yields the module of (VLAN ID-1) with regards to modulo. For example, if you set the modulo argument to 16, then VLAN 1 is mapped to MSTI 1, VLAN 2 is mapped to MSTI 2, …, VLAN 16 is mapped to MSTI 16, VLAN 17 is mapped to MSTI 1, and so on.
Related commands: check region-configuration, revision-level, region-name, active region-configuration.
Examples
# Map VLANs to MSTIs, with the modulo being 16.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] stp region-configuration
[H3C-mst-region] vlan-mapping modulo 16
1.1.46 vlan-vpn tunnel
Syntax
vlan-vpn tunnel
undo vlan-vpn tunnel
View
System view
Parameters
None
Description
Use the vlan-vpn tunnel command to enable the VLAN-VPN tunnel function for a switch.
Use the undo vlan-vpn tunnel command to disable the VLAN-VPN tunnel function.
The VLAN-VPN tunnel function enables BPDUs to be transparently transmitted between geographically dispersed user networks through specified VLAN VPNs in operator’s networks, through which spanning trees can be generated across these user networks and are independent of those of the operator’s network.
By default, the VLAN-VPN tunnel function is disabled.
& Note:
l The VLAN-VPN tunnel function can only be enabled on STP-enabled devices.
l To enable the VLAN-VPN function, make sure the links between operator’s networks are trunk links.
Examples
# Enable the VLAN-VPN tunnel function for the switch.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] vlan-vpn tunnel