H3C S5500-SI Series Ethernet Switches Command Manual(V1.01)

HomeSupportSwitchesH3C S5500 Switch SeriesReference GuidesCommand ReferencesH3C S5500-SI Series Ethernet Switches Command Manual(V1.01)
09-MSTP Commands
Title Size Download
09-MSTP Commands 189 KB

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

1.1.2  check region-configuration

Syntax

check region-configuration

View

MST region view

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-instance mapping and revision level settings.

As specified in the MSTP protocol, the configurations of MST regions must be right, especially the VLAN-to-MSTI mapping table. MSTP-enabled switches are in the same region only when they have the same format selector (a 802.1s-defined protocol selector, which is 0 by default and cannot be configured), region name, VLAN-to-MSTI mapping table, and revision level. A switch cannot be in the expected region if any of the four MST region-related parameters mentioned above are not consistent with those of another switch in the region.

The H3C series support only the MST region name, VLAN-to-MSTI mapping table, and revision level. Switches with the settings of these parameters being the same are assigned to the same MST region.

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

     16       10

Table 1-1 Description on the fields of the check region-configuration command

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-instance mappings in the MST region

 

1.1.3  display stp

Syntax

display stp [ instance instance-id ] [ interface interface-list ] [ brief ]

View

Any view

Parameters

instance instance-id: Displays the spanning tree information of a particular spanning tree instance. The effective range of instance-id is 0 to 15, with 0 representing the common internal spanning tree (CIST).

interface interface-list: Displays the spanning tree information on one or multiple ports. You can provide up to 10 port lists, by each of which you can specify an individual port in the form of interface-type interface-number, or a port range in the form of interface-type start-interface-number to interface-type end-interface-number, where the end port number must be greater than the start port number.

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 spanning tree instance ID or port list, this command will display the MSTP information on all ports. The displayed information is sequenced by spanning tree instance ID and by port name in each spanning tree instance.

l           If you specify a spanning tree instance ID, this command will display the MSTP information on all ports in that spanning tree instance. The displayed information is sequenced by port name.

l           If you specify a port list, this command will display the MSTP information on the specified ports. The displayed information is sequenced by spanning tree instance ID, and by port name in each spanning tree instance.

l           If you specify both a spanning tree instance ID and a port list, this command will display the MSTP information on the specified ports in the specified spanning tree instance.

The MSTP status information includes:

l           CIST global parameters: Protocol work mode, device priority in the CIST instance (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, whether a port in an aggregation group, and whether rapid state transition enabled (designated ports).

l           MSTI global parameters: MSTI instance ID, bridge priority of the instance, 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, whether a port in an aggregation group, 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

# Display the state information about MSTI 0 on GigabitEthernet 1/0/1 through GigabitEthernet 1/0/4.

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

  MSTID      Port                        Role  STP State     Protection

   0         GigabitEthernet1/0/1        DESI  FORWARDING    NONE

   0         GigabitEthernet1/0/2        DESI  FORWARDING    NONE

   0         GigabitEthernet1/0/3        DESI  FORWARDING    NONE

   0         GigabitEthernet1/0/4*       DESI  FORWARDING    NONE

  (*) means port in aggregation group

Table 1-2 Description on the fields of the display stp command

Field

Description

MSTID

spanning tree instance ID in the MST region

Port

Port name, corresponding to each spanning tree instance

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

(*) means port in aggregation group

* indicates a port in an aggregation group

 

1.1.4  display stp abnormal-port

Syntax

display stp abnormal-port

View

Any view

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 action

l           Loop guard action

l           MSTP BPDU format compatibility protection action

Examples

# View information about abnormally blocked ports.

<Sysname> display stp abnormal-port

MSTID       Blocked Port                   Reason

1         GigabitEthernet1/0/1           ROOT-Protected

2         GigabitEthernet1/0/2           LOOP-Protected  

2         GigabitEthernet1/0/3           Formatcompatibility–Protected

Table 1-3 Description on the fields of the display stp abnormal-port command

Field

Description

MSTID

spanning tree instance ID

Blocked Port

Name of blocked port, which corresponds to the related spanning tree instance

Reason

Reason that caused abnormal blocking of the port.

l      ROOT-Protected: root guard action

l      LOOP-Protected: loop guard action

l      Formatcompatibility-Protected: MSTP BPDU format compatibility protection action

 

1.1.5  display stp down-port

Syntax

display stp down-port

View

Any view

Parameters

None

Description

Use the display stp down-port command to view the information about ports blocked by STP protection actions.

These actions include:

l           BPDU attack guard action

l           MSTP BPDU format compatibility protection action

Examples

# View the information about ports blocked by STP protection actions.

<Sysname> display stp down-port

Down Port                        Reason

GigabitEthernet1/0/1             BPDU-Protected

GigabitEthernet1/0/2             Formatfrequency-Protected

Table 1-4 Description on the fields of the display stp abnormal-port command

Field

Description

Down Port

Name of blocked port

Reason

Reason that caused the port to be blocked.

l      BPDU-Protected: BPDU attack guard action

l      Formatfrequency-Protected: MSTP BPDU format compatibility protection action

 

1.1.6  display stp history

Syntax

display stp [ instance instance-id ] history

View

Any view

Parameters

instance instance-id: Displays the historic port role calculation information of 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 history command to view the historic port role calculation information of the specified spanning tree instance or all spanning tree instances.

Note that:

l           If you do not specify a spanning tree instance ID, this command will display the historic port role calculation information of all spanning tree instances. The displayed information is sequenced by instance ID, and in the timing of port role calculation in each instance.

l           If you specify a spanning tree instance ID, this command will display the historic port role calculation information of only this specified spanning instance, in the timing of port role calculation.

Examples

# View the historic port role calculation information of the card on MSTP instance 2.

<Sysname> display stp instance 2 history

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

     Port GigabitEthernet1/0/3

       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/0/4

       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-5 Description on the fields of the display stp history command

Field

Description

Port

Port name

Role change

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

Time

Time of port role calculation

Port priority

Port priority

 

1.1.7  display stp region-configuration

Syntax

display stp region-configuration

View

Any view

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-instance 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-6 Description on the fields of the display stp region-configuration command

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-instance mappings in the MST region

 

1.1.8  display stp root

Syntax

display stp root

View

Any view

Parameters

None

Description

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

Examples

# View the root bridge information of all MSTP instances.

<Sysname> display stp root

MSTID   Root Bridge ID        ExtPathCost IntPathCost Root Port

   0    32768.000f-e200-2200  200         0           GigabitEthernet1/0/1

Table 1-7 Description on the fields of the display stp root command

Field

Description

MSTID

spanning tree instance 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 multiple instances)

 

1.1.9  display stp tc

Syntax

display stp [ instance instance-id ] tc

View

Any view

Parameters

instance instance-id: Displays the statistics of TC BPDUs (also known as 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 BPDUs received and sent.

Note that:

l           If you do not specify a spanning tree instance ID, this command will display the statistics of TC BPDUs received and sent by all ports in all spanning trees. The displayed information is sequenced by instance ID and by port name in each spanning tree instance.

l           If you specify a spanning tree instance ID, this command will display the statistics of TC BPDUs received and sent by all ports in the specified spanning tree instance, in port name order.

Examples

# View the statistics of TC BPDUs received and sent by all ports on the card in MSTP instance 0.

<Sysname> display stp instance 0 tc

MSTID      Port                           Receive      Send

   0        GigabitEthernet1/0/1             6          4

   0        GigabitEthernet1/0/2             0          2

Table 1-8 Description on the fields of the display stp tc command

Field

Description

MSTID

MSTP instance ID in the MST region

Port

Port name

Receive

Number of TC BPDUs received on each port

Send

Number of TC BPDUs received by each port

 

1.1.10  instance

Syntax

instance instance-id vlan vlan-list

undo instance instance-id [ vlan vlan-list ]

View

MST region view

Parameters

instance-id: spanning tree instance ID, ranging from 0 to 15, with 0 representing the CIST.

vlan vlan-list: Defines one or multiple VLANs. You can provide up to 10 VLAN lists, by each of which you can specify an individual VLAN in the form of vlan-id, or a VLAN range in the form of start-vlan-id to end-vlan-id, where the end VLAN ID must be greater than the start VLAN ID. The effective range of a VLAN ID is 1 to 4094.

Description

Use the instance command to map the specified VLAN(s) to the specified spanning tree instance.

Use the undo instance command to remap the specified VLAN(s) or all VLANs to the CIST (spanning tree instance 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 spanning tree instance will be remapped to the CIST.

l           You cannot map the same VLAN to different spanning tree instances. If you map a VLAN that has been mapped to an instance to a new instance, 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 spanning tree instance 1.

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region] instance 1 vlan 2

1.1.11  region-name

Syntax

region-name name

undo region-name

View

MST region view

Parameters

name: Name of the MST region, 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-instance 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

1.1.12  reset stp

Syntax

reset stp [ interface interface-list ]

View

User view

Parameters

interface interface-list: Clears the spanning tree statistics information on one or multiple ports. You can provide up to 10 port lists, by each of which you can specify an individual port in the form of interface-type interface-number, or a port range in the form of interface-type start-interface-number to interface-type end-interface-number, where the end port number must be greater than the start port number.

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 ports GigabitEthernet 1/0/1 through GigabitEthernet 1/0/3.

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

1.1.13  revision-level

Syntax

revision-level level

undo revision-level

View

MST region view

Parameters

level: MSTP revision level, in the range of 0 to 65535. The system default is 0.

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.

The MSTP revision level, the MST region name and the VLAN-to-instance 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

1.1.14  stp

Syntax

stp { enable | disable }

undo stp

View

System view, Ethernet interface view, port group view

Parameters

enable: Enables the MSTP feature.

disable: Disables the MSTP feature.

Description

Use the stp command to enable or disable the MSTP feature globally or on the port(s).

Use the undo stp command to restore the default MSTP status.

By default, MSTP is globally enabled.

MSTP is enabled on ports by default and automatically enabled on all ports when it is enabled globally on the device.

Note that:

l           To control MSTP flexibly, you can disable the MSTP feature for certain ports so that they will not take part in spanning tree calculation and thus to save the device’s CPU resources.

l           After you enable MSTP, the device determines whether to work in STP-compatible mode, in RSTP mode or in MSTP mode according to your MSTP work mode setting. After MSTP is disabled, the device becomes a transparent bridge. 

l           After being enabled, MSTP dynamically maintains spanning tree status of the corresponding VLANs based on the received configuration BPDUs. After being disabled, it stops maintaining the spanning tree status.

l           Configured in system view, the setting is effective for the device globally; configured in Ethernet interface view, the setting is effective on the current port only; configured in port group view, the setting is effective on all ports in the port group.

Related commands: stp mode.

Examples

# Enable the MSTP feature globally.

<Sysname> system-view

[Sysname] stp enable

# Disable MSTP on port GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface GigabitEthernet 1/0/1

[Sysname-GigabitEthernet1/0/1] stp disable

1.1.15  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 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

1.1.16  stp bridge-diameter

Syntax

stp bridge-diameter bridge-number

undo stp bridge-diameter

View

System view

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 number of stations between any two terminal devices on the switched network.

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

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

1.1.17  stp compliance

Syntax

stp compliance { auto | dot1s | legacy }

undo stp compliance

View

Ethernet interface view, port group view

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 Ethernet interface view, the setting is effective on the current port only; configured in port group view, the setting is effective on all ports in the port group.

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 as configured, that port will become a designated port, and the port will remain in the discarding state to prevent the occurrence of a loop.

Examples

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

<Sysname>system-view

[Sysname] interface GigabitEthernet 1/0/1

[Sysname-GigabitEthernet1/0/1] stp compliance dot1s

# Restore the default mode for port GigabitEthernet 1/0/1 to recognize and send MSTP BPDUs.

<Sysname>system-view

[Sysname-GigabitEthernet1/0/1] undo stp compliance

 [Sysname-GigabitEthernet2/0/1] undo stp compliance

1.1.18  stp config-digest-snooping

Syntax

stp config-digest-snooping

undo stp config-digest-snooping

View

System view, Ethernet interface view, port group view

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.

Notice that:

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 port to avoid loops.

Examples

# Enable Digest Snooping globally.

<Sysname> system-view

[Sysname] stp config-digest-snooping

# Enable Digest Snooping on GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface GigabitEthernet 1/0/1

[Sysname-GigabitEthernet1/0/1] stp config-digest-snooping

1.1.19  stp cost

Syntax

stp [ instance instance-id ] cost cost

undo stp [ instance instance-id ] cost

View

Ethernet interface view, port group view

Parameters

instance instance-id: Sets the path cost of the port(s) in a particular spanning tree instance. The effective range of instance-id is 0 to 15, with 0 representing the CIST.

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

Description

Use the stp cost command to set the path cost of the port(s) in the specified spanning tree instance or all spanning tree instances.

Use the undo stp cost command to restore the system default.

By default, the device automatically calculates the path costs of ports in each spanning tree instance based on the corresponding standard.

Configured in Ethernet interface view, the setting is effective on the current port only; configured in port group view, the setting is effective on all ports in the port group.

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 spanning tree instances allows different VLAN traffic flows to be forwarded along different physical links, thus to enable per-VLAN 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.

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/0/3 in spanning tree instance 2 to 200.

<Sysname> system-view

[Sysname] interface GigabitEthernet 1/0/3

[Sysname-GigabitEthernet1/0/3] stp instance 2 cost 200

1.1.20  stp edged-port

Syntax

stp edged-port { enable | disable }

undo stp edged-port

View

Ethernet interface view, port group view

Parameters

enable: Configures the current port to be an edge port.

disable: Configures the current port to be a non-edge port.

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 Ethernet ports are non-edge ports by default.

Note that:

l           Configured in Ethernet interface view, the setting is effective on the current port only; configured in port group view, the setting is effective on all ports in the port group.

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 an Ethernet port directly connecting to a user terminal as an edge port before 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/0/1 as a non-edge port.

<Sysname> system-view

[Sysname] interface GigabitEthernet 1/0/1

[Sysname-GigabitEthernet1/0/1] stp edged-port disable

1.1.21  stp loop-protection

Syntax

stp loop-protection

undo stp loop-protection

View

Ethernet interface view, port group view

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.

Configured in Ethernet interface view, the setting is effective on the current port only; configured in port group view, the setting is effective on all ports in the port group.

Examples

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

<Sysname> system-view

[Sysname] interface GigabitEthernet 1/0/1

[Sysname-GigabitEthernet1/0/1] stp loop-protection

1.1.22  stp max-hops

Syntax

stp max-hops hops

undo stp max-hops

View

System view

Parameters

hops: Maximum hops, in the range of 1 to 40

Description

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

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

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

In the CIST and spanning tree instances, the maximum hops setting configured on the regional root bridge determines the maximum network diameter supported by this MST region. After a configuration BPDU leaves the root bridge, its hop count is decremented by 1 whenever it passes a device. When its hop count reaches 0, it will be discarded by the device that has 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.

When the current device becomes the root bridge of the CIST or an MSTI, the maximum hops setting configured on the device becomes the network diameter of that spanning tree and restricts the size of that spanning tree in the current MST region.

Devices other than the root bridge in an MST region use the maximum hops setting on the root bridge.

Examples

# Set the maximum number of hops of the MST region to 35.

<Sysname> system-view

[Sysname] stp max-hops 35

1.1.23  stp mcheck

Syntax

stp mcheck

View

System view, Ethernet interface view

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, this 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 the stp mcheck command is meaningful only when the device works in the MSTP (or RSTP) mode, not in the STP-compatible mode.

Related commands: stp mode.

Examples

# Carry out mCheck on GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface GigabitEthernet 1/0/1

[Sysname-GigabitEthernet1/0/1] stp mcheck

1.1.24  stp mode

Syntax

stp mode { stp | rstp | mstp }

undo stp mode

View

System view

Parameters

stp: Configures the MSTP-compliant device to work in STP-compatible mode.

rstp: Configures MSTP-compliant device to work in RSTP mode.

mstp: Configures MSTP-compliant 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-compliant device works in MSTP mode.

Related commands: stp mcheck, stp.

Examples

# Configure the MSTP-compliant device to work in STP-compatible mode.

<Sysname> system-view

[Sysname] stp mode stp

1.1.25  stp no-agreement-check

Syntax

stp no-agreement-check

undo stp no-agreement-check

View

Ethernet interface view, port group view

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:

The No Agreement Check feature can take effect only on the root port.

 

Examples

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

<Sysname> system-view

[Sysname] interface GigabitEthernet 1/0/1

[Sysname-GigabitEthernet1/0/1] stp no-agreement-check

1.1.26  stp pathcost-standard

Syntax

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

undo stp pathcost-standard

View

System view

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 cost of the link connected with 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 out of effect.

Table 1-9 Link speed vs. path cost

Link speed

Duplex state

802.1D-1998

IEEE 802.1t

Private standard

0

65535

200,000,000

200,000

10 Mbps

Single Port

Aggregated Link 2 Ports

Aggregated Link 3 Ports

Aggregated 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

Aggregated Link 2 Ports

Aggregated Link 3 Ports

Aggregated Link 4 Ports

19

19

19

19

200,000

100,000

66,666

50,000

200

180

160

140

1000 Mbps

Single Port

Aggregated Link 2 Ports

Aggregated Link 3 Ports

Aggregated Link 4 Ports

4

4

4

4

20,000

10,000

6,666

5,000

20

18

16

14

10 Gbps

Single Port

Aggregated Link 2 Ports

Aggregated Link 3 Ports

Aggregated Link 4 Ports

2

2

2

2

2,000

1,000

666

500

2

1

1

1

 

In the calculation of the path cost value of an aggregated link, 802.1D-1998 does not take into account the number of ports in the aggregated link. Whereas, 802.1T takes the number of ports in the aggregated link into account. The calculation formula 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 aggregated link.

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

1.1.27  stp point-to-point

Syntax

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

undo stp point-to-point

View

Ethernet interface view, port group view

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) connect(s) 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-compliant device automatically detects whether an Ethernet port connects to a point-to-point link.

Configured in Ethernet interface view, the setting is effective on the current port only; configured in port group view, the setting is effective on all ports in the port group.

Note that:

l           When connecting to a non-point-to-point link, a port is incapable of rapid state transition.

l           If the current port is the master port of a link aggregation group 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 is effective to the CIST and all spanning tree instances. 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 spanning tree instances. 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/0/3 as connecting to a point-to-point link.

<Sysname> system-view

[Sysname] interface GigabitEthernet 1/0/3

[Sysname-GigabitEthernet1/0/3] stp point-to-point force-true

1.1.28  stp port-log

Syntax

stp port-log { all | instance instance-id }

undo stp port-log { all | instance instance-id }

View

System view

Parameters

all: Enables output of port state transition information for all instances.

instance instance-id: Enables output of port state transition information for the specified spanning tree instance. The effective range of instance-id is 0 to 15, with 0 representing the CIST.

Description

Use the stp port-log command to enable the output of port state transition information for the specified instance or all instances.

Use the undo stp port-log command to disable the output of port state transition information for the specified instance or all instances.

By default, the output of port state transition information is enabled.

Examples

# Enable output of port state transition information for instance 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/0/1 has been set to discarding state!

%Aug 16 00:49:41:856 2006 Sysname MSTP/3/PFWD: Instance 2's GigabitEthernet1/0/2 has been set to forwarding state!

// The information above shows that in instance 2, the state of GigabitEthernet 1/0/1 has changed to discarding and that of GigabitEthernet 1/0/2 has changed to forwarding.

1.1.29  stp port priority

Syntax

stp [ instance instance-id ] port priority priority

undo stp [ instance instance-id ] port priority

View

Ethernet interface view, port group view

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

priority: Port priority, in the range of 0 to 240 at the step 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.

Configured in Ethernet interface view, the setting is effective on the current port only; configured in port group view, the setting is effective on all ports in the port group.

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 spanning tree instance.

Setting different priorities for the same port in different spanning tree instances allows different VLAN traffic flows to be forwarded along different physical links, thus to enable per-VLAN load balancing.

When the priority of a port is changed, MSTP will re-compute the role of the port and initiate a state transition.

If you do not provide instance instance-id, your configuration will take effect in the CIST instance only.

Examples

# Set the priority of port GigabitEthernet 1/0/3 in spanning tree instance 2 to 16.

<Sysname> system-view

[Sysname] interface GigabitEthernet 1/0/3

[Sysname-GigabitEthernet1/0/3] stp instance 2 port priority 16

1.1.30  stp priority

Syntax

stp [ instance instance-id ] priority priority

undo stp [ instance instance-id ] priority

View

System view

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

priority: Port priority, in the range of 0 to 61440 at the step 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-instance basis. An MSTP-compliant device can have different priorities in different spanning tree instances.

If you do not provide instance instance-id, your configuration will take effect in the CIST instance only.

Examples

# Set the device priority in spanning tree instance 1 to 4096.

<Sysname> system-view

[Sysname] stp instance 1 priority 4096

1.1.31  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 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-instance mapping and revision level.

Examples

# Enter MST region view.

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region]

1.1.32  stp root primary

Syntax

stp [ instance instance-id ] root primary

undo stp [ instance instance-id ] root

View

System view

Parameters

instance instance-id: Configures the device as the root bridge in a particular spanning tree instance. The effect range of instance-id is 0 to 15, with 0 representing the 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 a spanning tree instance. If two or more devices have been designated to be root bridges of the same spanning tree instance, MSTP will select the device with the lowest MAC address as the root bridge.

l           You can specify a root bridge for each spanning tree instance 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

# Define the current device as the root bridge of spanning tree instance 0.

<Sysname> system-view

[Sysname] stp instance 0 root primary

1.1.33  stp root secondary

Syntax

stp [ instance instance-id ] root secondary

undo stp [ instance instance-id ] root

View

System view

Parameters

instance instance-id: Configures the device as a secondary root bridge in a particular spanning tree instance. The effective range of instance-id is 0 to 15, with 0 representing the 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 spanning tree instance. When the root bridge of an instance fails or is shut down, the secondary root bridge can take over the role of the instance of the specified spanning tree instance. If you specify more than one secondary root bridge, the secondary root bridge with the lowest MAC address will become the root bridge.

l           Upon specifying the current device as the root bridge or a secondary root bridge, you cannot change the priority of the device.

Examples

# Define the current device as the secondary root bridge of spanning tree instance 0.

<Sysname> system-view

[Sysname] stp instance 0 root secondary

1.1.34  stp root-protection

Syntax

stp root-protection

undo stp root-protection

View

Ethernet interface view, port group view

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.

Configured in Ethernet interface view, the setting is effective on the current port only; configured in port group view, the setting is effective on all ports in the port group.

Examples

# Enable the root guard function for port GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface GigabitEthernet 1/0/1

[Sysname-GigabitEthernet1/0/1] stp root-protection

1.1.35  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 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

1.1.36  stp tc-protection threshold

Syntax

stp tc-protection threshold number

undo stp tc-protection threshold

View

System view

Parameters

number: Maximum number of times the device deletes forwarding address entries within a certain period of time immediately after it receives TC-BPDUs, in the range of 1 to 255.

Description

Use the stp tc-protection threshold command to configure the maximum number of times the device deletes forwarding address entries within 10 seconds immediately after it receives TC-BPDUs.

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

By default, the device deletes forwarding address entries a maximum of six times within a certain period of time immediately after it receives TC-BPDUs.

Examples

# Set the maximum number of times the device deletes forwarding address entries within a certain period of time immediately after it receives TC-BPDUs to 10.

<Sysname> system-view

[Sysname] stp tc-protection threshold 10

1.1.37  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, in the range of 400 to 3,000.

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 secondary root bridge, its state transition interval is determined by the forward delay timer set on the root bridge.

The setting 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, network instability 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 an optimal setting 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

1.1.38  stp timer hello

Syntax

stp timer hello centi-seconds

undo stp timer hello

View

System view

Parameters

centi-seconds: Hello time (in centiseconds), in the range of 100 to 1,000.

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-compliant devices send configuration BPDUs to maintain spanning tree stability. 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 secondary root bridges use the hello time set on the root bridge.

The setting 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, network instability 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 an optimal setting 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

1.1.39  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), in the range of 600 to 4,000.

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 faults 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 spanning tree instance needs to be re-computed.

The max age timer is not meaningful for MSTIs. 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 setting 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, network instability 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

1.1.40  stp timer-factor

Syntax

stp timer-factor number

undo stp timer-factor

View

System view

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 calculation 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

1.1.41  stp transmit-limit

Syntax

stp transmit-limit packet-number

undo stp transmit-limit

View

Ethernet interface view, port group view

Parameters

packet-number: Maximum number of MSTP packets that the port 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.

Configured in Ethernet interface view, the setting is effective on the current port only; configured in port group view, the setting is effective on all ports in the port group.

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 an excessive bandwidth resource during network topology instability.

Examples

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

<Sysname> system-view

[Sysname] interface GigabitEthernet 1/0/1

[Sysname-GigabitEthernet1/0/1] stp transmit-limit 5

1.1.42  vlan-mapping modulo

Syntax

vlan-mapping modulo modulo

View

MST region view

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 spanning tree instances according to the specified modulo value.

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

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

 

&  Note:

By using the vlan-mapping modulo command, you can quickly specify a VLAN for each spanning tree instance. This command maps each VLAN to the spanning tree instance 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 16, 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

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网