No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Command Reference

AR500, AR510, and AR530 V200R007

This document describes all the configuration commands of the device, including the command function, syntax, parameters, views, default level, usage guidelines, examples, and related commands.
Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
STP/RSTP/MSTP Configuration Commands

STP/RSTP/MSTP Configuration Commands

NOTE:
  • AR502G-L-D-H, AR502GR-L-D-H do not support STP/RSTP.

  • AR510 series do not support STP/RSTP.

  • AR500 series and AR510 series do not support MSTP.

active region-configuration

Function

The active region-configuration command activates the configuration of a multiple spanning tree (MST) region.

Format

active region-configuration

Parameters

None

Views

MST region view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

Configuring MST region parameters, especially VLAN mapping tables for MST regions, is likely to cause network topology flapping. To reduce network flapping, make sure that newly configured MST region parameters take effect only after the active region-configuration command is run.

Precautions

After the active region-configuration command is run, configured MST region parameters will take effect and the spanning tree will be recalculated.

Example

# Map VLAN 5 to the spanning tree instance 2 and activate the configuration.

<Huawei> system-view
[Huawei] stp region-configuration
[Huawei-mst-region] instance 2 vlan 5
[Huawei-mst-region] active region-configuration

check region-configuration

Function

The check region-configuration command displays the configuration of an MST region such as the region name, revision level, and VLAN mapping table.

Format

check region-configuration

Parameters

None

Views

MST region view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

MSTP divides a switching network into multiple regions, each of which has multiple spanning trees that are independent of each other. Each region is called an MST region and each spanning tree is called a multiple spanning tree instance (MSTI).

Two switching devices belong to the same MST region only when they have the following same configurations:
  • MST region name
  • MST region revision level
  • Mappings between MSTIs and VLANs

To ensure that MST region configurations on each switching device are correct, you are recommended to run the check region-configuration command to check the MST region configurations before running the active region-configuration command. If the MST region configurations are correct, run the active region-configuration command to activate them.

Precautions

By default, VLANs that are not mapped to any instances with non-zero IDs using the instance command are mapped to instance 0.

Example

# Display the configuration of an MST region.

<Huawei> system-view
[Huawei] stp region-configuration
[Huawei-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 5-41  Description of the check region-configuration command output

Item

Description

Format selector

Selection factor defined by MSTP

Region name

Name of the MST region. To configure the name for an MST region, run the region-name command.

Revision level

Revision level of the MST region. To set the revision level of the MST region, run the revision-level command.

Instance VLANs Mapped

Mapping between MSTIs and VLANs. To configure the mapping between MSTIs and VLANs, run the instance or vlan-mapping modulo.

display snmp-agent trap feature-name mstp all

Function

The display snmp-agent trap feature-name mstp all command displays all trap messages of the MSTP module.

Format

display snmp-agent trap feature-name mstp all

Parameters

None

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

The Simple Network Management Protocol (SNMP) is a standard network management protocol widely used on TCP/IP networks. It uses a central computer (a network management station) that runs network management software to manage network elements. The management agent on the network element automatically reports traps to the network management station. After that, the network administrator immediately takes measures to resolve the problem.

The display snmp-agent trap feature-name mstp all command displays whether all trap functions of the MSTP module are enabled.

Example

# Display all trap messages of the MSTP module.

Table 5-42  Description of the display snmp-agent trap feature-name mstp all command output

Item

Description

Feature name

Name of the module to which a trap message belongs.

Trap number

Number of trap messages.

Default switch status

Whether the default trap function is enabled:

  • on: The trap function is enabled.
  • off: The trap function is disabled.

Current switch status

Whether the current trap function is enabled:

  • on: The trap function is enabled.
  • off: The trap function is disabled.

display stp

Function

The display stp command displays the status of and statistics on a spanning tree instance.

Format

display stp [ instance instance-id ] [ interface interface-type interface-number ] [ brief ]

Parameters

Parameter Description Value
instance instance-id

Displays the status and statistics of a spanning tree instance.

If instance instance-id is not specified, the status and statistics of all spanning tree instances will be displayed in the sequence of the interface numbers.

The value is an integer ranging from 0 to 4094. Value 0 refers to CIST.
NOTE:
instance-id ranges from 0 to 4094. The device supports a maximum of 17 instances.
interface interface-type interface-number

Displays the information of a spanning tree on a specified interface.

If interface interface-type interface-number is not specified, the status and statistics of all interfaces will be displayed in the sequence of the interface numbers.

-
brief Displays the brief status. -

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

The display stp command is used to check whether STP/RSTP/MSTP/VBST is run in the existing switching device or specified interface.
  • If the Protocol Status field value is Disabled, STP/RSTP/MSTP/VBST is not run.
  • If STP/RSTP/MSTP has been run, information such as the working mode of STP/RSTP/MSTP/VBST will be displayed.

When the network planner has deployed STP/RSTP/MSTP/VBST on the network, you can run the display stp command to check whether the configurations and calculation result.

Example

# When the stp enable command does not run, the status and statistics of STP are displayed.

<Huawei> display stp
 Protocol Status       :Disabled
 Protocol Standard     :IEEE 802.1s
 Version               :3
 CIST Bridge Priority  :32768
 MAC address           :00e0-6343-6800
 Max age(s)            :20
 Forward delay(s)      :15
 Hello time(s)         :2
 Max hops              :20   
Table 5-43  Description table of the display stp command output

Item

Description

Protocol Status

Status of the protocol.
  • Disabled
  • Enabled

Protocol Standard

Standards of the protocol.

Version

Protocol version:
  • 0: STP

  • 2: RSTP

  • 3: MSTP

To set the protocol version, run the stp mode command.

CIST Bridge Priority

Priority of the switch in the CIST. To set the STP priority, run the stp priority command.

MAC address

MAC address of the switch.

Max age (s)

Maximum TTL of BPDU. To set the value of Max Age, run the stp timer max-age command.

Forward delay (s)

Time taken by interface status transition. To set the value of Forward Delay, run the stp timer forward-delay command.

Hello time (s)

Interval for sending BPDUs from the root switch. To set the hello time, run the stp timer hello command.

Max hops

Maximum number of hops in an MST region. To set the maximum number of hops, run the stp max-hops command.

# Display the status of and statistics on the spanning tree instance 0 on Eth0/0/1.

<Huawei> display stp instance 0 interface ethernet 0/0/1
-------[CIST Global Info][Mode MSTP]-------
CIST Bridge         :32768.00e0-fc0e-a421
Bridge Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC      :32768.00e0-fc0e-a421 / 0
CIST RegRoot/IRPC   :32768.00e0-fc0e-a421 / 0
CIST RootPortId     :0.0
BPDU-Protection     :Disabled
TC or TCN received  :0
TC count per hello  :0
STP Converge Mode   :Normal
Time since last TC  :0 days 23h:9m:30s
Number of TC        :1
----[Port3(Ethernet0/0/1)][FORWARDING]----
 Port Protocol       :Enabled
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Legacy)   :Config=auto / Active=19
 Designated Bridge/Port   :32768.00e0-fc0e-a421 / 128.1229
 Port Edged          :Config=disabled / Active=disabled
 Point-to-point      :Config=auto / Active=true
 Transit Limit       :3 packets/hello-time
 Protection Type     :None
 Port STP Mode       :MSTP
 Config-digest-snoop :snooped=false
 Port Protocol Type  :Config=auto / Active=dot1s
 BPDU Encapsulation  :Config=stp / Active=stp
 PortTimes           :Hello 2s MaxAge 20s FwDly 15s RemHop 0
 TC or TCN send      :0
 TC or TCN received  :0
 BPDU Sent           :147
          TCN: 0, Config: 0, RST: 0, MST: 147
 BPDU Received       :0
          TCN: 0, Config: 0, RST: 0, MST: 0    
Table 5-44  Description of the display stp instance command output

Item

Description

CIST Global Info

CIST global information.

Mode MSTP

The operation mode is MSTP. By default, the mode is MSTP. To set the operation mode, run the stp mode command.

CIST Bridge

ID of the CIST bridge.
  • The previous 16 bits are the priority of the switch in CIST.

  • The latter 48 bits is the MAC address of the switch.

CIST Root/ERPC

CIST root bridge ID/External path cost (the path cost from the switch to the CIST root bridge.)

CIST RegRoot/IRPC

Region root bridge ID/Internal path cost (the path cost from the switch to region root bridge.)

CIST RootPortId

CIST root port ID. "0.0" indicates the switch is a root bridge and has no root port.

BPDU-Protection

BPDU protection function:
  • Disabled

  • Enabled

TC or TCN received

Number of the received TC or TCN packets.

TC count per hello

Number of TC packets received within a hello interval.

STP Converge Mode

STP converge mode

Time since last TC

Period from the last topology change to now.

Number of TC

Topology change count.

Port Protocol

The status of the port protocol is as follows:
  • Enable: STP is enabled on the port.

  • disable: STP is disabled on the port.

Port Role

In CIST area, the four port roles are as follows:
  • Root Port

  • Designated Port

  • Alternate Port

  • Backup Port

Port Priority

Priority of the port. To set the priority for a port, run the stp port priority command.

Port Cost(Legacy)

Path cost of the port. It is calculated by dot1t algorithm.
  • config: refers to the path cost that is configure manually.

  • active: refers to the path cost actually.

Designated Bridge/Port

ID of the designated switch and port. The first 16 bits of the switch ID represent the priority of the switch in the CIST region; the last 48 bits represent the MAC address of the switch. The first 4 bits of the port ID represent the priority and the last 12 bits represent the port number.

Port Edged

Edged port that is specified by the administrator:
  • enabled

  • disabled

Config indicates that the value is configured by using the stp edged-port command. Active indicates the actual value.

Point-to-point

Link type of the port. Config indicates that the link type is configured by running the stp point-to-point command. Active indicates the actual link type.

Transit Limit

Limit of the BPDUs sent by the current port during each Hello time. To set the limit of the BPDUs sent by the current port during each Hello time, run the stp transmit-limit (interface view) command.

Protection Type

The protection type is as follows:
  • root-protection: valid only on a designed port.

  • loop-protection: valid only on a root port or an alternate one.

Port STP Mode

STP mode on an interface.

Config-digest-snoop

The configuration digest snooping function. The command output is displayed only after the stp config-digest-snoop command is configured and the configuration digest snooping function is enabled on the port. If the port is not enabled with the function, the command output is not displayed:
  • snooped=false: The configuration digest of the packets on the remote end is the same as that on the local end.

  • snooped=true: The configuration digest of the packets on the remote end is different from that on the local end.

Port Protocol Type

Format of the packets that the interface receives and sends. The formats are as follows:
  • auto

  • legacy

  • dot1s

The default value is auto. Config indicates that the packet format is configured by running the stp compliance command. Active indicates the actual packet format.

PortTimes

Values in the bridge protocol information of the interface:
  • Hello: the period of sending BPDUs.

  • MaxAge: the maximum life cycle of BPDU.

  • FwDly: deferred time of the change of the port status.

  • MaxHop: the maximum hops in the MST region.

TC or TCN send

Number of BPDUs with TC flags or TCN BPDUs sent by the port.

TC or TCN received

Number of BPDUs with TC flags or TCN BPDUs received by the port.

BPDU Sent

Statistics about the packets sent by BPDU is as follows:
  • TCN: topology change notification

  • Config: STP packets

  • RST: RSTP packets

  • MST: MSTP packets

BPDU Received

Statistics about the packets received by BPDU.

display stp abnormal-interface

Function

The display stp abnormal-interface command displays information about abnormal interfaces running the Spanning Tree Protocol (STP).

Format

display stp [ instance instance-id ] abnormal-interface

Parameters

Parameter Description Value
instance instance-id

Displays the status and statistics of a specified spanning tree instance.

If instance instance-id is not specified, the status and statistics of all spanning tree instances will be displayed in the sequence of the interface numbers.

The value is an integer in the range 0 to 4094. The value 0 indicates a common and internal spanning tree (CIST) instance.
NOTE:
instance-id ranges from 0 to 4094. The device supports a maximum of 17 instances.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

If a device has many interfaces and the display stp command output displays vast information, viewing information about abnormal interfaces running STP is difficult.

You can use the display stp abnormal-interface command to view information about abnormal interfaces running STP.

Example

# Display information about abnormal interfaces in process 0 running STP

<Huawei> display stp instance 0 abnormal-interface
MSTID    Interface                     Status          Reason                   
    0    Ethernet          DISCARDING      LOOP-Protected           
    0    Ethernet          DOWN            BPDU-Protected           
    0    Ethernet          DISCARDING      ROOT-Protected           
    0    Ethernet          DISCARDING      LOOP-Detected
Table 5-45  Description of the display stp abnormal-interface command output

Item

Description

MSTID

MSTP instance ID

Interface

Interface type

Status

Status of an interface after the STP protection takes effect
  • DOWN: indicates that the physical status of the interface is Down (including error-down).
  • DISCARDING: indicates the blocked interface after the topology of the spanning tree becomes stable.

Reason

An interface running STP becomes abnormal due to one of the following:
  • Root-Protected: indicates that the root protection takes effect.
  • Loop-Protected: indicates that the loop protection takes effect.
  • BPDU-Protected: indicates that the BPDU protection takes effect.
  • Loop-Detected: indicates that the loop detection takes effect.
Related Topics

display stp active

Function

The display stp active command displays the status of and statistics on spanning trees of all Up interfaces.

Format

display stp active

Parameters

None

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

The display stp active command displays information about spanning trees of Up interfaces only.

Example

# Display information about spanning trees of all Up interfaces.

<Huawei> display stp active
-------[CIST Global Info][Mode MSTP]-------                                     
CIST Bridge         :61440.781d-ba56-f06c                                       
Config Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20                    
Active Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20                    
CIST Root/ERPC      :61440.781d-ba56-f06c / 0                                   
CIST RegRoot/IRPC   :61440.781d-ba56-f06c / 0                                   
CIST RootPortId     :0.0                                                        
BPDU-Protection     :Disabled                                                   
TC or TCN received  :85                                                         
TC count per hello  :0                                                          
STP Converge Mode   :Normal                                                     
Time since last TC  :0 days 9h:10m:8s
Number of TC        :13                                                         
Last TC occurred    :GigabitEthernet1/0/4                                       
----[Port18(GigabitEthernet1/0/10)][FORWARDING]----                             
 Port Protocol       :Enabled                                                   
 Port Role           :Designated Port                                           
 Port Priority       :128                                                       
 Port Cost(Dot1T )   :Config=auto / Active=20000                                
 Designated Bridge/Port   :61440.781d-ba56-f06c / 128.18                        
 Port Edged          :Config=default / Active=enabled                           
 Point-to-point      :Config=auto / Active=true                                 
 Transit Limit       :10 packets/s                                              
 Protection Type     :None                                                      
 Port STP Mode       :MSTP                                                      
 Port Protocol Type  :Config=auto / Active=dot1s                                
 PortTimes           :Hello 2s MaxAge 20s FwDly 15s RemHop 20                   
 TC or TCN send      :5                                                         
 TC or TCN received  :0                                                         
 BPDU Sent           :178445                                                    
          TCN: 0, Config: 0, RST: 0, MST: 178445                                
 BPDU Received       :0                                                         
          TCN: 0, Config: 0, RST: 0, MST: 0                                     
 Last forwarding time: 2012/04/19 16:58:37 UTC+08:00                            
----[Port19(GigabitEthernet2/1/17)][FORWARDING]----                             
 Port Protocol       :Enabled                                                   
 Port Role           :Designated Port                                           
 Port Priority       :128                                                       
 Port Cost(Dot1T )   :Config=auto / Active=20000                                
 Designated Bridge/Port   :61440.781d-ba56-f06c / 128.19                        
 Port Edged          :Config=default / Active=enabled                           
 Point-to-point      :Config=auto / Active=true                                 
 Transit Limit       :10 packets/s                                              
 Protection Type     :None                                                      
 Port STP Mode       :MSTP                                                      
 Port Protocol Type  :Config=auto / Active=dot1s                                
 PortTimes           :Hello 2s MaxAge 20s FwDly 15s RemHop 20                   
 TC or TCN send      :0                                                         
 TC or TCN received  :0                                                         
 BPDU Sent           :5                                                         
          TCN: 0, Config: 0, RST: 0, MST: 5                                     
 BPDU Received       :0                                                         
          TCN: 0, Config: 0, RST: 0, MST: 0                                     
 Last forwarding time: 2012/04/23 20:06:08 UTC+08:00                            
                                                                                
-------[MSTI 1 Global Info]-------                                              
MSTI Bridge ID      :61440.781d-ba56-f06c                                       
MSTI RegRoot/IRPC   :61440.781d-ba56-f06c / 0
MSTI RootPortId     :0.0                                                        
Master Bridge       :61440.781d-ba56-f06c                                       
Cost to Master      :0                                                          
TC received         :2                                                          
TC count per hello  :0                                                          
Time since last TC  :0 days 9h:10m:8s                                           
Number of TC        :9                                                          
Last TC occurred    :GigabitEthernet1/0/4
Table 5-46  Description of the display stp active command output

Item

Description

CIST Bridge

  • The 16 leftmost bits are the switch's priority in the CIST.
  • The 48 rightmost bits are the switch's MAC address.

Config Times

Configured bridge protocol parameters:
  • Hello: interval at which Bridge Protocol Data Units (BPDUs) are sent

  • MaxAge: maximum TTL of a BPDU

  • FwDly: delay in interface status transition

  • MaxHop: maximum number of hops in the MST region

Active Times

Bridge protocol parameters that are being used:
  • Hello: interval at which BPDUs are sent

  • MaxAge: maximum TTL of a BPDU

  • FwDly: delay in interface status transition

  • MaxHop: maximum number of hops in the MST region

CIST Root/ERPC

CIST root bridge ID/external path cost from the switch to the root bridge.

CIST RegRoot/IRPC

ID of the CIST region root bridge/Cost of the internal path (path from the switch to the CIST region root switch)

CIST RootPortId

CIST root port ID. "0.0" indicates that the switch is the root switch without the root port.

BPDU-Protection

Whether BPDU protection is enabled:
  • Disabled: BPDU protection is disabled.

  • Enabled: BPDU protection is enabled.

TC or TCN received

Number of received topology change (TC) or topology change notification (TCN) packets

TC count per hello

Number of TC packets received per Hello time

STP Converge Mode

Convergence mode of the Spanning Tree Protocol (SPT), which can be fast or normal. For details, see stp converge.

Time since last TC

Time since the last topology change

Number of TC

Number of topology changes

Last TC occurred

Interface which causes the last topology change

NOTE:

This parameter does not appear when Number of TC is 0.

Port Protocol

STP status on the interface:
  • Enabled: STP is enabled on the interface.
  • Disabled: STP is disabled on the interface.

Port Role

Role of an interface. In the CIST region, the roles of interfaces are as follows:
  • Root Port
  • Designated Port
  • Alternate Port
  • Backup Port

Port Priority

Interface priority. For details, see stp port priority.

Port Cost(Dot1T)

Path cost (calculated by dot1t) of an interface:
  • Config: configured path cost
  • Active: path cost that is being used

Designated Bridge/Port

Switch ID/Port ID The first 16 bits represent the switch's priority in the CIST region, and the last 48 bits represent the switch's MAC address. The first 4 bits of the port ID represent the port's priority, and the last 12 bits represent the port number.

Port Edged

Whether the edge interface (specified by the administrator) is enabled:
  • enabled: The edge interface is enabled.

  • disabled: The edge interface is disabled.

Config indicates the value that is specified in the stp edged-port command, and Active indicates the value in use.

Point-to-point

Link type of the interface. Config indicates the link type that is specified in the stp point-to-point command, and Active indicates the link type that is being used.

Transit Limit

Maximum number of BPDUs that the current interface can send per second. For details, see stp transmit-limit.

Protection Type

Protection type, which can be:
  • root-protection: Protection takes effect only on the specified interface.

  • loop-protection: Protection takes effect only on the root interface or alternate interface.

Port STP Mode

STP mode of the interface

Port Protocol Type

Format of packets sent and received on the interface, which can be:
  • auto

  • legacy

  • dot1s

The default value is auto. Config indicates the packet format that is specified in the stp compliance command, and Active indicates the packet format in use.

PortTimes

Bridge protocol parameters of the interface:
  • Hello: interval at which BPDUs are sent

  • MaxAge: maximum TTL of a BPDU

  • FwDly: delay in interface status transition

  • RemHop: maximum number of hops in the MST region

TC or TCN send

Number of TC or TCN packets sent on the interface

TC or TCN received

Number of TC or TCN packets received on the interface

BPDU Sent

Statistics on sent BPDUs, including:
  • TCN: TCN BPDUs

  • Config: STP BPDUs

  • RST: Rapid Spanning Tree Protocol (RSTP) BPDUs

  • MST: MSTP BPDUs

BPDU Received

Statistics on received BPDUs

Last forwarding time

Time when the interface last entered the forwarding state

MSTI Bridge ID

Multiple Spanning Tree instance (MSTI) bridge ID

MSTI RegRoot/IRPC

MSTI root bridge ID/Cost of the internal path (path from the switch to the MSTI root switch)

MSTI RootPortId

ID of the MSTI root interface. 0.0 indicates that the switch is the root switch and does not provide any root interface.

Master Bridge

ID of the bridge where the master interface is located.
  • The first 16 bits represent the switch's priority in the CIST.
  • The last 48 bits represent the switch's MAC address.

Cost to Master

Cost of the path from the switch to the bridge where the master interface is located. 0 indicates that the master interface is located at the current bridge.

TC received

Number of received TC packets

display stp bridge

Function

The display stp bridge command displays details about the spanning tree of a bridge.

Format

display stp bridge { root | local }

Parameters

Parameter Description Value
root Displays details about the spanning tree of the root bridge. -
local Displays details about the spanning tree of the local bridge. -

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

When a device provides many interfaces, running the display stp command displays a large amount of information, and it is difficult to find information about the spanning trees of the root and local bridges.

Using the display stp bridge command, you can easily view details about the spanning trees of the root and local bridges.

Precautions

  • If you run this command in the system view without specifying an MSTP process ID, information about MSTP process 0 is displayed by default.

  • If you run this command in the MSTP process view without specifying an MSTP process ID, information about the MSTP process in this view is displayed by default.

Example

# Display details about the spanning tree of the root bridge of MSTP process 0.

<Huawei> display stp bridge root
MSTID              Root ID  Root Cost Hello Max Forward Root Port               
                                       Time Age   Delay                         
----- -------------------- ---------- ----- --- ------- -----------------       
    0 61440.781d-ba56-f06c          0     2  20      15                         
    1 61440.781d-ba56-f06c          0     2  20      15
Table 5-47  Description of the display stp bridge command output

Item

Description

MSTID

MSTP instance ID

Root ID

MSTP root bridge ID

Root Cost

MSTP root path cost

Hello Time

Interval at which Bridge Protocol Data Units (BPDUs) are sent from the root switch

Max Age

Maximum TTL of a BPDU

Forward Delay

Delay in interface status transition

Root Port

Root interface

display stp error packet

Function

The display stp error packet command displays the statistics about error packets received by MSTP and the contents of recently received packets.

Format

display stp error packet

Parameters

None.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

If a device on a Layer 2 network runs MSTP is attacked by MSTP error packets, the display stp error packet command can be used to view recently received MSTP error packets.

Example

# Display the statistics about error packets received by MSTP and the contents of recently received packets.

<Huawei> display stp error packet
 4 error-packet(s) have been received and the last one is received at 2011/05/02 12:45:31.
01 80 C2 00 00 00 38 AA D2 11 11 10 00 69 42 42 
03 00 00 03 02 7C 00 00 38 AA D2 11 11 10 00 00 
00 00 00 00 38 AA D2 11 11 10 80 01 00 00 14 00 
02 00 0F 00 00 00 40 00 33 38 61 61 64 32 31 31 
31 31 31 30 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 AC 36 17 7F 50 28 
3C D4 B8 38 21 D8 AB 26 DE 62 00 00 00 00 00 00 
38 AA D2 11 11 10 14
Table 5-48  Description of the display stp error packet command output

Item

Description

<n> error-packet(s) have been received and the last one is received at <time>

n error packets are received and the time when the last error packet is received is recorded.

<n>: number of error packets

<time>: time when the last error packet is received

display stp global

Function

The display stp global command displays global Spanning Tree Protocol (STP) information.

Format

display stp global

Parameters

None.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

When a device provides many interfaces, the display stp command output contains a large amount of information, and it is difficult to find the desired information quickly and view global information at a glance. The display stp brief command output, by comparison, displays information about spanning trees on interfaces, but not global information.

Using the display stp global command, you can view global STP information conveniently.

Precautions

  • If you run this command in the system view without specifying an MSTP process ID, information about MSTP process 0 is displayed by default.

  • If you run this command in the MSTP process view without specifying an MSTP process ID, information about the MSTP process in this view is displayed by default.

Example

# Display brief STP information about MSTP process 0.

<Huawei> display stp global
Protocol Status            : Enabled                                            
Bpdu-filter default        : Disabled                                           
Tc-protection              : Enabled                                           
Tc-protection threshold    : 1                                                  
Tc-protection interval     : 2s                                                 
Edged port default         : Enabled                                            
Pathcost-standard          : Dot1t                                              
Timer-factor               : 3                                                  
Transmit-limit             : 10                                                 
Bridge-diameter            : 7                                                  
-------[CIST Global Info][Mode MSTP]-------                                     
CIST Bridge         :61440.781d-ba56-f06c                                       
Config Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20                    
Active Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20                    
CIST Root/ERPC      :61440.781d-ba56-f06c / 0                                   
CIST RegRoot/IRPC   :61440.781d-ba56-f06c / 0 (This bridge is the root)                                   
CIST RootPortId     :128.3 (Ethernet5/0/0)                                                         
BPDU-Protection     :Disabled                                                   
TC or TCN received  :85                                                         
TC count per hello  :0                                                          
STP Converge Mode   :Normal                                                     
Time since last TC  :0 days 9h:12m:34s                                          
Number of TC        :13                                                         
Last TC occurred    :Ethernet5/0/0
Table 5-49  Description of the display stp global command output

Item

Description

Protocol Status

Spanning Tree Protocol (STP) status:
  • Enabled: STP is enabled.
  • Disabled: STP is disabled.

Bpdu-filter default

Whether the function of configuring device interfaces as Bridge Protocol Data Unit (BPDU) filter interfaces is enabled:
  • Enabled: The function is enabled.
  • Disabled: The function is disabled.

Tc-protection

Topology change (TC) protection status.

Tc-protection threshold

Threshold of TC packets that the device can handle and immediately refresh forwarding entries in a given period

Tc-protection interval

Time the MSTP takes to handle a given number of TC packets and immediately refresh forwarding entries

Edged port default

Whether the function of configuring all ports of the switch as edge ports is enabled:
  • Enabled: The function is enabled.
  • Disabled: The function is disabled.

Pathcost-standard

Method of calculating the MSTP path cost

Timer-factor

Multiplier of Hello time

Transmit-limit

Maximum number of BPDUs that the current interface can send per Hello time. For details, see stp transmit-limit.

Bridge-diameter

Network diameter of the MSTP

For details, see stp bridge-diameter.

The value of this field depends on the mappings between the IEEE-recommended network diameter and STP time parameters (Hello Time, Forward Delay, and Max Age). If the mapping fails, default value 7 takes effect. Figure 5-2 shows the mappings between the IEEE-recommended network diameter and STP time parameters.

Figure 5-2  Mappings between the IEEE-recommended network diameter and STP time parameters

CIST Bridge

Common and internal spanning tree (CIST) bridge ID
  • The first 16 bits represent the switch's priority in the CIST.
  • The last 48 bits represent the switch's MAC address.

Config Times

Configured bridge protocol parameters:
  • Hello: interval at which BPDUs are sent
  • MaxAge: maximum TTL of a BPDU
  • FwDly: delay in interface status transition
  • MaxHop: maximum number of hops in the MST region

Active Times

Bridge protocol parameters that are being used:
  • Hello: interval at which BPDUs are sent
  • MaxAge: maximum TTL of a BPDU
  • FwDly: delay in interface status transition
  • MaxHop: maximum number of hops in the MST region

CIST Root/ERPC

CIST root switch ID/Cost of the external path (path from the switch to the CIST root switch)

CIST RegRoot/IRPC

ID of the CIST region root bridge/Cost of the internal path (path from the switch to the CIST region root switch)

CIST RootPortId

ID of the CIST root interface. 0.0 indicates that the switch is the root switch and does not provide any root interface.

BPDU-Protection

Whether BPDU protection is enabled:
  • Disabled: BPDU protection is disabled.
  • Enabled: BPDU protection is enabled.

TC or TCN received

Number of received TC or topology change notification (TCN) packets

TC count per hello

Number of TC packets received per Hello time

STP Converge Mode

Convergence mode of the Spanning Tree Protocol (SPT), which can be fast or normal. For details, see stp converge.

Time since last TC

Time since the last topology change

Number of TC

Number of topology changes

Last TC occurred

Interface which causes the last topology change

NOTE:

This parameter does not appear when Number of TC is 0.

display stp region-configuration

Function

The display stp region-configuration command displays the effective configuration of the MST region on the switching device. The configuration includes the region name, revision level and mapping relationship between VLANs and spanning tree instances.

Format

display stp region-configuration [ digest ]

Parameters

Parameter Description Value
digest Displays brief information about the effective MST region. -

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

After an MST region is configured and takes effect on the network running MSTP, you can run the display stp region-configuration command to view the name, revision level, STP instance, and inter-VLAN mapping of the MST region.

Example

# Display the configuration of MST regions.

<Huawei> display stp region-configuration
Oper configuration
   Format selector :0
   Region name     :huawei
   Revision level  :0
   Instance   VLANs Mapped
      0       21 to 4094
      1       1 to 10
      2       11 to 20
# Display brief information about the effective MST region.
<Huawei> display stp region-configuration digest
 Oper configuration
   Format selector    :0
   Region name        :huawei
   Revision level     :0
   Digest             :0xAC36177F50283CD4B83821D8AB26DE62
Table 5-50  Description of the display stp region-configuration command output

Item

Description

Format selector

Selection factors defined by the MSTP protocol.

Region name

Name of the MST region. For the related commands, see region-name.

Revision level

Revision level of the MST region. For the related commands, see revision-level.

Instance VLANs Mapped

Mapping between the spanning tree instance and VLANs of the MST region. For the related commands, see instance or vlan-mapping modulo.

If the mapping is incorrect, run the instance command to re-map the specified VLAN to the specified MSTI and run the active region-configuration command to activate the mapping.

Digest

Brief information about the MST region.

display stp tc-bpdu statistics

Function

The display stp tc-bpdu statistics command displays statistics of sent and received topology change (TC) and topology change notification (TCN) BPDUs on interfaces.

Format

display stp [ instance instance-id ] [ interface interface-type interface-number ] tc-bpdu statistics

Parameters

Parameter Description Value
instance instance-id

Specifies the ID of an MSTP instance of which statistics of TC and TCN BPDUs are displayed.

If the parameter instance instance-id is not specified, statistics of TC and TCN BPDUs on all interfaces are displayed in the sequence of the interface numbers.

The value is an integer that ranges from 0 to 4094. The value 0 indicates a CIST instance.
NOTE:
instance-id ranges from 0 to 4094. The device supports a maximum of 17 instances.
interface interface-type interface-number

Specifies the interface on which statistics of TC and TCN BPDUs are displayed.

If the parameter interface interface-type interface-number is not specified, statistics of TC and TCN BPDUs on all interfaces are displayed in the sequence of the interface numbers.

-

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

If you need to know whether a fault has occurred on interfaces that send and receive TC/TCN BPDUs, you can run this command to view statistics of these BPDUs and locate the fault.

Example

# Display the statistics of TC/TCN BPDUs on interfaces of an MSTP instance.

<Huawei> display stp tc-bpdu statistics
 -------------------------- STP TC/TCN information --------------------------
 MSTID Port                        TC(Send/Receive)      TCN(Send/Receive)
 0     GigabitEthernet1/0/9               3/2                   0/0 
 0     GigabitEthernet1/0/10              1/0                   0/0 
 1     GigabitEthernet1/0/9               14/9                  -/-  
 1     GigabitEthernet1/0/10              8/10                  -/-  
 2     GigabitEthernet1/0/9               3/2                   -/-  
 2     GigabitEthernet1/0/10              1/0                   -/-
Table 5-51  Description of the display stp tc-bpdu statistics command output

Item

Description

MSTID

ID of an MSTP instance

Port

Interface name

TC(Send/Receive)

Statistics of send and received TC BPDUs

TCN(Send/Receive)

Statistics of send and received TCN BPDUs ("-" indicates that MSTP instances except MSTP instance 0 do not have TCN BPDUs sent and received)

Related Topics

display stp topology-change

Function

The display stp topology-change command displays the statistics about topology changes.

Format

display stp [ instance instance-id ] topology-change

Parameters

Parameter Description Value
instance instance-id

Displays statistics about the topology changes of a specified STP instance.

If this parameter is not specified, the statistics about the topology changes of a CIST instance are displayed.

The value is an integer ranging from 0 to 4094. Value 0 refers to CIST.
NOTE:
instance-id ranges from 0 to 4094. The device supports a maximum of 17 instances.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

On a Layer 2 network running MSTP, a device clears ARP entries and MAC entries after receiving topology change packets. If a device receives too many topology change packets, the device will frequently clear ARP entries and MAC entries, causing high CPU usage. As a result, network traffic is instable.

The display stp topology-change command can be used to display the statistics about MSTP topology changes. If the statistics increase, network flapping occurs.

Example

# Display statistics about MSTP topology changes.

<Huawei> display stp topology-change
 CIST topology change information
   Number of topology changes             :5
   Time since last topology change        :0 days 0h:23m:19s
   Topology change initiator(detected)    :Ethernet0/0/1
   Topology hange last received from     :00e0-5b3c-c100
   Number of generated topologychange traps :   5
   Number of suppressed topologychange traps:   3

 MSTI 1 topology change information
   Number of topology changes             :5
   Time since last topology change        :0 days 0h:23m:19s
   Topology change initiator(detected)    :GigabitEthernet1/0/2
   Number of generated topologychange traps :   5
   Number of suppressed topologychange traps:   3

 MSTI 2 topology change information
   Number of topology changes             :5
   Time since last topology change        :0 days 0h:23m:19s
   Topology change initiator(notified)    :GigabitEthernet1/0/3
   Number of generated topologychange traps :   5
   Number of suppressed topologychange traps:   3

 MSTI 3 topology change information
   Number of topology changes             :5
   Time since last topology change        :0 days 0h:23m:19s
Table 5-52  Description of the display stp topology-change command output

Item

Description

Number of topology changes

Total number of topology changes since initialization.

NOTE:

The number of received and sent TC BPDUs in each VLAN may be different during topology convergence, so the number of topology changes in each VLAN may be different.

Time since last topology change

Time since the last topology change

Topology change initiator(detected)

Interface that initiates a topology change because the interface status changes to detected

Topology change initiator(notified)

Interface that initiates a topology change after receiving a topology change packet

Topology change last received from

Source bridge MAC address contained in a topology change packet

Number of generated topologychange traps

Total number of generated topology-change traps.

Number of suppressed topologychange traps

Total number of suppressed topology-change traps.

display stp vlan

Function

The display stp vlan command displays the STP status on an interface added to a specified VLAN.

Format

display stp vlan vlan-id

Parameters

Parameter Description Value
vlan-id

Displays the STP status on an interface added to a specified VLAN.

The value is an integer ranging from 1 to 4094.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

After an interface is added to a VLAN, the display stp vlan command can be used to the display the STP status on the interface. In this case, the mapping between VLANs and instances does not need to be concerned with.

Example

# Display the STP status on an interface added to a specified VLAN.

<Huawei> display stp vlan 1
 InstanceId   Port                        Role  State                           
 ----------------------------------------------------------                     
     0        Ethernet0/0/1               ROOT  FORWARDING                      
     0        Ethernet0/0/1               DESI  FORWARDING  
Table 5-53  Description of the display stp vlan command output

Item

Description

InstanceId.

Instance ID

Port

Interface

Role

Interface role

State

Interface status

instance

Function

The instance command maps a VLAN to a spanning tree instance.

The undo instance command deletes the mapping between a VLAN and a spanning tree instance.

By default, all VLANs are mapped to CIST, that is, instance 0.

NOTE:

The AR500 series do not support this command.

Format

instance instance-id vlan { vlan-id1 [ to vlan-id2 ] } &<1-10>

undo instance instance-id [ vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> ]

Parameters

Parameter Description Value
instance-id Specifies the number of a spanning tree instance. The value is an integer ranging from 0 to 4094. Value 0 refers to CIST.
NOTE:
instance-id ranges from 0 to 4094. The device supports a maximum of 17 instances.

The value of instance-id specified in the undo instance command cannot be 0. This means that instance 0 cannot be deleted.

vlan vlan-id1 Specifies a start VLAN ID. The value is an integer ranging from 1 to 4094. The start VLAN ID must be smaller than the end VLAN ID.
to vlan-id2 Specifies an end VLAN ID. The value is an integer that ranges from 1 to 4094.

Views

MST region view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

MSTP divides a switching network into multiple regions, each of which has multiple spanning trees that are independent of each other. Each spanning tree is called an MSTI and each region is called an MST region.

Two switching devices belong to the same MST region only when they have the following same configurations:
  • MST region name
  • Mappings between MSTIs and VLANs
  • MST region revision level

The instance command is used to set mappings between spanning tree instances and VLANs.

Precautions

When using the undo instance command, note the following points:

  • After the mapping between specified VLANs and a specified spanning tree instance is deleted, these VLANs will be mapped to a CIST, namely, instance 0.

  • If no VLAN is specified, all VLANs that have established mappings with the spanning tree instance will be mapped to a CIST.

If the instance command is run more than once, all configurations take effect.

A VLAN cannot be mapped to different spanning tree instances. If the instance command is run several times, the latest configuration overrides the previous one.

Example

# Map VLAN 2 to spanning tree instance 1.

<Huawei> system-view
[Huawei] stp region-configuration
[Huawei-mst-region] instance 1 vlan 2

max bandwidth-affected-linknumber

Function

The max bandwidth-affected-linknumber command sets the upper threshold for the number of interfaces that determine the bandwidth of an Eth-Trunk.

The undo max bandwidth-affected-linknumber command restores the default upper threshold for the number of interfaces that determine the bandwidth of an Eth-Trunk.

By default, the upper threshold for the number of interfaces that determine the bandwidth of an Eth-Trunk is 8.

Format

max bandwidth-affected-linknumber link-number

undo max bandwidth-affected-linknumber

Parameters

Parameter

Description

Value

link-number

Specifies the upper threshold for the number of interfaces that determine the bandwidth of an Eth-Trunk.

The value is an integer ranging from 1 to 8.

Views

Eth-Trunk interface view

Default Level

2: Configuration level

Usage Guidelines

The upper threshold for the number of interfaces that determine the bandwidth of an Eth-Trunk is used for STP calculation.

For example, device A and device B are connected by two Eth-Trunks. Eth-Trunk1 has three member links that are Up; the Eth-Trunk2 has two member links that are Up. The bandwidth of each member link is 1 Gbit/s, so the bandwidth of Eth-Trunk1 is 3 Gbit/s and the bandwidth of Eth-Trunk2 is 2 Gbit/s. If device A is the root bridge during STP calculation, Eth-Trunk1 on device B is the root port and Eth-Trunk2 is the alternate port. You can run this command to set the upper threshold to 1. Then the bandwidth of Eth-Trunk1 becomes 1 Gbit/s during STP calculation. Bandwidth decrease affects the interface cost, causing STP recalculation. The max bandwidth-affected-linknumber command does not affect traffic forwarding on the Eth-Trunk. The bandwidth used to forward traffic is still 3 Gbit/s.

Example

# Set the upper threshold to 3.

<Huawei> system-view
[Huawei] interface eth-trunk 1
[Huawei-Eth-Trunk1] max bandwidth-affected-linknumber 3

region-name

Function

The region-name command configures the MST region name of the switching device.

The undo region-name command restores the default name.

By default, the MST region name is the MAC address of the management network interface on the MPU of the switching device.

Format

region-name name

undo region-name

Parameters

Parameter Description Value
name Specifies the region name of the switching device.

The value is a case-sensitive string of 1 to 32 characters without spaces.

NOTE:

When double quotation marks are used around the string, spaces are allowed in the string.

Views

MST region view

Default Level

2: Configuration level

Usage Guidelines

MSTP divides a switching network into multiple regions, each of which has multiple spanning trees that are independent of each other. Each spanning tree is called an MSTI and each region is called an MST region.

Two switching devices belong to the same MST region only when they have the following same configurations:
  • MST region name
  • Mappings between MSTIs and VLANs
  • MST region revision level

The region-name command is used to configure MST region names in order to identify different regions.

Example

# Set the MST region name of the switch to "huawei".

<Huawei> system-view
[Huawei] stp region-configuration
[Huawei-mst-region] region-name huawei

reset stp error packet statistics

Function

The reset stp error packet statistics command clears the statistics of error STP packets.

Format

reset stp error packet statistics

Parameters

None

Views

All views

Default Level

3: Management level

Usage Guidelines

Applicable Scenario

You can use the reset stp error packet statistics command to clear the history statistics when you need to observe the statistics of error STP packets in a period from the current time.

Precautions

The reset stp error packet statistics command clears the statistics about error STP packets are cleared and cannot be restored. Therefore, confirm the action before you use the command.

Example

# Clear the statistics about error STP packets.

<Huawei> reset stp error packet statistics

reset stp statistics

Function

The reset stp statistics command clears the statistics of a spanning tree.

Format

reset stp [ interface interface-type interface-number ] statistics

Parameters

Parameter Description Value
interface interface-type interface-number Specifies an interface type and the number of the interface.

-

Views

User view

Default Level

3: Management level

Usage Guidelines

Sometimes, traffic statistics within a certain period is needed. In this situation, clear the existing statistics before restarting the count.

When you run the reset stp statistics command:

  • If you specify an interface, you can clear the statistics of a spanning tree on the interface.

  • If you do not specify an interface, you can clear the statistics of spanning trees on all interfaces.

Example

# Clear the statistics of spanning trees on Eth0/0/1.

<Huawei> reset stp interface ethernet 0/0/1 statistics
Related Topics

revision-level

Function

The revision-level command configures the revision level of MST region of a switching device.

The undo revision-level command restores the default level.

By default, the revision level of MST region is 0.

Format

revision-level level

undo revision-level

Parameters

Parameter Description Value
level Specifies the revision level of the MST region. The value is an integer ranging from 0 to 65535.

Views

MST region view

Default Level

2: Configuration level

Usage Guidelines

MSTP divides a switching network into multiple regions, each of which has multiple spanning trees that are independent of each other. Each region is called an MST region and each spanning tree is called a multiple spanning tree instance (MSTI).

Two switching devices belong to the same MST region only when they have the following same configurations:
  • MST region name
  • Mappings between MSTIs and VLANs
  • MST region revision level

If two switching devices have the same region name and VLAN mapping table, the revision-level command can be used to set different revision levels for the two devices so that the two devices belong to different MST regions.

Example

# Set the MSTP revision level of the switching device to 5.

<Huawei> system-view
[Huawei] stp region-configuration
[Huawei-mst-region] revision-level 5

snmp-agent trap enable feature-name mstp

Function

The snmp-agent trap enable feature-name mstp command enables the trap function for the MSTP module.

The undo snmp-agent trap enable feature-name mstp command disables the trap function for the MSTP module.

By default, the trap function is disabled for the MSTP module.

Format

snmp-agent trap enable feature-name mstp [ trap-name { hwmstpibridgelostrootprimary | hwmstpiedgeportchanged | hwmstpiportbpduguarded | hwmstpiportloopguarded | hwmstpiportrootguarded | hwmstpiportstatediscarding | hwmstpiportstateforwarding | hwmstpproloopbackdetected } ]

undo snmp-agent trap enable feature-name mstp [ trap-name { hwmstpibridgelostrootprimary | hwmstpiedgeportchanged | hwmstpiportbpduguarded | hwmstpiportloopguarded | hwmstpiportrootguarded | hwmstpiportstatediscarding | hwmstpiportstateforwarding | hwmstpproloopbackdetected } ]

Parameters

Parameter Description Value
trap-name Enables the traps of MSTP events of specified types. -
hwmstpibridgelostrootprimary Enables the device to send trap when the current device is no longer the root bridge. -
hwmstpiedgeportchanged Enables the device to send trap when the edge port that is not enabled with the BPDU guard function is no longer the edge port after receiving BPDUs. -
hwmstpiportbpduguarded Enables the device to send trap when the edge port enabled with the BPDU guard function can receive BPDUs. -
hwmstpiportloopguarded Enables the device to send trap when the port enabled with the loop guard function does not receive any BPDU in a specified period. -
hwmstpiportrootguarded Enables the device to send trap when the port enabled with the root guard function receives BPDUs with higher priorities. -
hwmstpiportstatediscarding Enables the device to send trap when the port status changes to Discarding. -
hwmstpiportstateforwarding Enables the device to send trap when the port status changes to Forwarding. -
hwmstpproloopbackdetected Enables the device to send trap when port detected loopback, block the port. -

Views

System view

Default Level

2: Configuration level

Usage Guidelines

The MSTP module is not configured with the function of excessive traps. To enable the traps of one or more events, you can specify trap-name.

Example

# Enables the device to send trap when the current device is no longer the root bridge.

<Huawei> system-view
[Huawei] snmp-agent trap enable feature-name mstp trap-name hwmstpibridgelostrootprimary

stp bpdu-filter

Function

The stp bpdu-filter enable command specifies a port as a BPDU-filter port.

The stp bpdu-filter disable command specifies a port as a non-BPDU-filter port.

The undo stp bpdu-filter command restores the default attribute of a BPDU-filter port.

By default, a port is a non-BPDU-filter port.

Format

stp bpdu-filter { enable | disable }

undo stp bpdu-filter

Parameters

None

Views

Eth-Trunk interface view, Ethernet interface view, GE interface view, Port-group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a network running a spanning tree protocol, if the stp edged-port enable command is used to configure a port as an edge port, the port will not participate in the spanning tree calculation. This speeds up network convergence and improves network stability. This port, however, will still send BPDUs. This may cause BPDUs to be sent to other networks. As a result, these networks flap.

The stp bpdu-filter enable command can be used on the port to address this problem. After the stp bpdu-filter enable command is used on the port, the port will become a BPDU-filter port, and will not process BPDUs.

If the stp bpdu-filter enable command is run on a port, the port will not transmit or process BPDUs. The port cannot negotiate the STP status with the directly connected port on the remote device. Therefore, exercise cautions when using the stp bpdu-filter enable command. Running the stp bpdu-filter enable command only on edge ports is recommended.

Running the stp bpdu-filter enable command in the interface view configures only the current port as a BPDU-filter port. If multiple BPDU-filter ports are required on a device, the stp bpdu-filter default command can be used in the system view to configure all the ports as BPDU-filter ports. If some ports need to participate in spanning tree calculation but do not need to be configured as BPDU-filter ports, the stp bpdu-filter disable command can be used in the view of these ports to configure them as non-BPDU-filter ports. Similarly, if the stp bpdu-filter disable command has been run on a port, the non-BPDU filter port attributes of the port will not change after the stp bpdu-filter default command is run.

Precautions

After the stp bpdu-filter disable command is run on a port, the port becomes a non-BPDU-filter port. The port is still a non-BPDU-filter port even if the stp bpdu-filter default command is run in the system view. After the undo stp bpdu-filter command is run on the port, the BPDU-filter attributes of the port restore to the default ones.

Example

# On a network edge device, specify Eth0/0/1 as a non-BPDU-filter port.
<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] portswitch
[Huawei-Ethernet0/0/1] stp bpdu-filter disable
# On a network edge device, specify Eth0/0/1 as a BPDU-filter port.
<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] portswitch
[Huawei-Ethernet0/0/1] stp bpdu-filter enable

stp bpdu-filter default

Function

The stp bpdu-filter default command specifies all ports of a device as BPDU-filter ports.

The undo stp bpdu-filter default command specifies all ports of a device as non-BPDU-filter ports.

By default, a port is a non-BPDU-filter port.

Format

stp bpdu-filter default

undo stp bpdu-filter default

Parameters

None

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a network running a spanning tree protocol, if the stp edged-port enable command is used to configure a port as an edge port, the port will not participate in the spanning tree calculation. This speeds up network convergence and improves network stability. This port, however, will still send BPDUs. This may cause BPDUs to be sent to other networks. As a result, these networks flap.

The stp bpdu-filter enable command can be used on the port to address this problem. After the stp bpdu-filter enable command is used on the port, the port will become a BPDU-filter port, and will not process BPDUs.

Running the stp bpdu-filter enable command in the interface view configures only the current port as a BPDU-filter port. If multiple BPDU-filter ports are required on a device, the stp bpdu-filter default command can be used in the system view to configure all ports as BPDU-filter ports. Then run the stp bpdu-filter disable command in the interface view to change the interfaces that need not to be configured as BPDU filter interfaces into non-BPDU filter interfaces.

Precautions

After the stp bpdu-filter default command is run, a port that has been configured with the undo stp bpdu-filter command will become a BPDU-filter port. After the stp bpdu-filter disable command is run, the port that has been configured with the undo stp bpdu-filter command, however, will still serve as a non-BPDU-filter port.

After the stp bpdu-filter default and stp edged-port default commands are run in the system view, none of the ports on the device will initiate any BPDUs or initiate a negotiation with the remote device, and all the ports are in the forwarding state. This may lead to a loop and cause a broadcast storm. Exercise cautions when using the stp bpdu-filter default and stp edged-port default commands in the system view.

Example

# On a network edge device, specify all ports as BPDU-filter ports.

<Huawei> system-view
[Huawei] stp bpdu-filter default

stp bpdu-protection

Function

The stp bpdu-protection command enables BPDU protection on a switching device.

The undo stp bpdu-protection command disables BPDU protection on a switching device.

By default, the BPDU protection is disabled.

Format

stp bpdu-protection

undo stp bpdu-protection

Parameters

None.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a Layer 2 network running a spanning tree protocol, a port connected to terminals does not need to participate in spanning tree calculation. If the port participates in spanning tree calculation, the network convergence speed will be affected. In addition, status changes of the port may cause network flapping, interrupting user traffic. To address this problem, you can run the stp edged-port enable command to configure the port as an edge port. Then, the port will not participate in the spanning tree calculation. This speeds up network convergence and improves network stability.

An edge port will lose edge port attributes after receiving BPDUs. To prevent attackers from forging BPDUs to change edge ports to non-edge ports, you can run the stp bpdu-protection command to configure BPDU protection on a switching device.

Precautions

After BPDU protection is enabled, a switching device sets an edge port to error down state if the edge port receives a BPDU and retains the port as an edge port. To configure the edge port in error-down state to automatically restore to the Up state, run the error-down auto-recovery cause bpdu-protection interval interval-value command in the system view.

Example

# Enable the BPDU protection on the switching device.

<Huawei> system-view
[Huawei] stp bpdu-protection

stp bridge-diameter

Function

The stp bridge-diameter command configures the diameter of the spanning tree.

The undo stp bridge-diameter command restores the default diameter.

By default, the diameter of the spanning tree is 7.

Format

stp bridge-diameter diameter

undo stp bridge-diameter

Parameters

Parameter Description Value
diameter Specifies the diameter. The value is an integer ranging from 2 to 7.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a network running a spanning tree protocol, the network diameter is the maximum number of devices between two switching devices. If the network diameter is improperly set, network converge may slow down, affecting users' normal communication.

The stp bridge-diameter command can be used to set a proper network diameter based on the network scale. This helps to accelerate network convergence.

The following time parameters are related to the network scale:
  • Hello Time

  • Forward Delay

  • Max Age

Precautions

After the stp bridge-diameter command is used on a switching device, the switching device will automatically set proper values for Hello Time, Forward Delay, and Max Age based on the configured network diameter.

On an MSTP network, the network diameter configured using the stp bridge-diameter command is valid only for CISTs.

Example

# Set the network diameter to 5.

<Huawei> system-view
[Huawei] stp bridge-diameter 5

stp compliance

Function

The stp compliance command configures the format for the MSTP packets that are received and sent on the switching device.

The undo stp compliance command restores the default format for the MSTP packets that are received and sent on the switching device.

By default, the MSTP packet format is auto.

Format

stp compliance { auto | dot1s | legacy }

undo stp compliance

Parameters

Parameter Description Value
auto Indicates that the protocol format is self-adaptive. -
dot1s Indicates that the format is standard IEEE 802.1s. -
legacy Indicates the private packet format. -

Views

Ethernet interface view, Eth-Trunk interface view, GE interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

MSTP protocol packets have two formats: dot1s (IEEE 802.1s standard packets) and legacy (proprietary protocol packets). The stp compliance command can be used on a device to set an MSTP packet format based on the format of the MSTP packet received from a remote device so that this device can better communicate with the remote device.

The auto mode is set to allow a port to automatically switch to the MSTP protocol packet format used by the remote end based on the MSTP protocol packet format received from the remote end. This enables the two interfaces to use the same MSTP protocol packet format.

Example

# Set the format of the MSTP packets to the standard format of the interface.

<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] stp compliance dot1s

# Restore the self-adaptive format of the MSTP packets that are received and sent by the switching device.

<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] undo stp compliance
Related Topics

stp config-digest-snoop

Function

The stp config-digest-snoop command enables digest snooping.

The undo stp config-digest-snoop command disables digest snooping.

By default, the digest snooping is disabled.

Format

stp config-digest-snoop

undo stp config-digest-snoop

Parameters

None

Views

Ethernet interface view, Eth-Trunk interface view, GE interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

On an MSTP network where Huawei and non-Huawei devices are interconnected, if the Huawei and non-Huawei devices have the same region name, revision level, and VLAN mapping table but different BPDU keys, the stp config-digest-snoop command can be used to enable the Huawei and non-Huawei devices to exchange BPDUs.

Example

# Enable digest snooping on Eth0/0/1.
<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] stp config-digest-snoop
Related Topics

stp converge

Function

The stp converge command sets the converging mode of a spanning tree protocol.

The undo stp converge command restores the default mode.

By default, the converging mode of the spanning tree protocol is normal.

Format

stp converge { fast | normal }

undo stp converge

Parameters

Parameter Description Value
fast Indicates ARP entries that will be directly deleted. -
normal Indicates ARP entries that will age quickly. -

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a Layer 2 network running a spanning tree protocol, if the topology of a spanning tree instance changes, the forwarding paths of VLANs that are mapped to this instance change. As a result, ARP entries related to these VLANs need to be updated. Based on methods for processing ARP entries, the converging modes of a spanning tree protocol are classified into fast and normal:
  • In fast mode, entries that need to be updated in an ARP table are directly deleted.
  • In normal mode, entries that need to be updated in an ARP table quickly age. A switching device sets the EXPIRE time of these ARP entries to 0 in order to age them. If the number of detection times for aging out ARP entries is greater than 0, the switching device detects these ARP entries before deleting them.

The stp converge command can be used to set a converging mode based on the method for processing ARP entries.

Precautions

If the stp converge fast command is run on a switching device and the topology of a spanning tree instance changes, the switching device will directly delete the ARP entries that need to be updated in the ARP table.

If the stp converge normal command is run on a switching device and the topology of a spanning tree instance changes, the switching device will age the ARP entries that need to be updated in the ARP table.

Setting the converging mode of a spanning tree protocol to normal is recommended. If the fast mode is used, frequent ARP entry deletion will affect services and even may cause the CPU usage of the device to reach 100%. As a result, packet processing will time out, causing network flapping.

Example

# Set the converging mode of the spanning tree protocol on the Ethernet switch as normal.

<Huawei> system-view
[Huawei] stp converge normal
Related Topics

stp cost

Function

The stp cost command sets the path cost of a port in a spanning tree.

The undo stp cost command restores the default path cost.

By default, the path cost of a port in a spanning tree is the path cost corresponding to the port rate.

Format

stp [ instance instance-id ] cost cost

undo stp [ instance instance-id ] cost

Parameters

Parameter Description Value
instance instance-id

Specifies the number of a spanning tree instance.

If instance instance-id is not specified, it indicates the path cost of an interface in CIST.

The value is an integer ranging from 0 to 4094. Value 0 refers to CIST.
NOTE:
instance-id ranges from 0 to 4094. The device supports a maximum of 17 instances.
cost Specifies the path cost of an interface. According to different calculation standards, the value ranges are as follows:
  • Huawei legacy standard: 1 to 200,000

  • IEEE 802.1d-1998 standard: 1 to 65535

  • IEEE 802.1t standard: 1 to 200,000,000

Views

Ethernet interface view, Eth-Trunk interface view, GE interface view, port group view,

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The path cost of a port is an important basis for calculating a spanning tree. Path costs determine root port selection. In a spanning tree, the port with the lowest path cost to the root bridge is selected as a root port.

If different path costs are set for a port on an MSTP device in different spanning tree instances, traffic of different VLANs will be forwarded along different physical links and VLAN-based load balancing can be carried out.

Path costs depend on path cost calculation standards. After the path cost calculation standard is determined, set a relatively small path cost within a specified range for a port that has a high link rate. In the Huawei legacy standard, default path costs for ports with different link rates are different, as shown in the following table.
Table 5-54  Mappings between link rates and path costs ( Huawei legacy standard )

Link Rate

Recommended Value

Default, Value

Recommended Value Range

Value Range

10 Mbit/s

2000

200-20000

1-200,000

100 Mbit/s

200

20-2000

1-200,000

1 Gbit/s

20

2-200

1-200,000

10 Gbit/s

2

2-20

1-200,000

Over 10 Gbit/s

1

1-2

1-200,000

Prerequisites

A path cost calculation standard has been set using the stp pathcost-standard command.

Precautions

If the path cost of a port, the spanning tree where the port resides needs to be recalculated.

If the stp pathcost-standard command is used to change the path cost calculation standard, the path cost set using the stp cost command for a port will be restored to the default value.

Example

# Set the path cost of Eth0/0/1 in spanning tree instance 2 to 200.
<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] stp instance 2 cost 200

stp edged-port

Function

The stp edged-port enable command sets the current port as an edge port.

The stp edged-port disable command sets the current port as a non-edge port.

The undo stp edged-port command restores the default attribute of an edge port.

By default, all the ports on the switching device are non-edge ports.

Format

stp edged-port { enable | disable }

undo stp edged-port

Parameters

Parameter Description Value
enable Sets the current port as an edge port. -
disable Sets the current port as a non-edge port. -

Views

Ethernet interface view, Eth-Trunk interface view, GE interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a Layer 2 network running a spanning tree protocol, a port connected to terminals does not need to participate in spanning tree calculation. If the port participates in spanning tree calculation, the network convergence speed will be affected. In addition, status changes of the port may cause network flapping, interrupting user traffic. To address this problem, you can run the stp edged-port enable command to configure the port as an edge port. Then, the port will not participate in the spanning tree calculation. This speeds up network convergence and improves network stability.

Precautions

If a port of a switching device receives a BPDU after being configured as an edge port, the switching device will automatically set the port as a non-edge port and recalculate the spanning tree.

Example

# Configure Eth0/0/1 as an edge port.
<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] stp edged-port enable

stp edged-port default

Function

The stp edged-port default command configures the ports on a switching device as edge ports.

The undo stp edged-port default command restores the default setting.

By default, the ports on a switching device are non-edge ports.

Format

stp edged-port default

undo stp edged-port default

Parameters

None

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a Layer 2 network running a spanning tree protocol, a port connected to terminals does not need to participate in spanning tree calculation. If the port participates in spanning tree calculation, the network convergence speed will be affected. In addition, status changes of the port may cause network flapping, interrupting user traffic. To address this problem, you can run the stp edged-port enable command to configure the port as an edge port. Then, the port will not participate in the spanning tree calculation. This speeds up network convergence and improves network stability.

After the stp edged-port default command is run on a device, all ports of the device will be become edge ports. During network topology calculation, running the stp edged-port default command may cause a loop. Exercise caution when using this command.

Precautions

If a port of a switching device receives a BPDU after being configured as an edge port, the switching device will automatically set the port as a non-edge port and recalculate the spanning tree.

To prevent attackers from forging BPDUs to change edge ports on a switching device to non-edge ports, you can run the stp bpdu-protection command in the system view to configure BPDU protection on the switching device. After BPDU protection is enabled on a switching device, the switching device shuts down the edge port if the edge port receives a BPDU. The attributes of the edge port are not changed.

Example

# Configure all ports on an edge device as edge ports.

<Huawei> system-view
[Huawei] stp edged-port default

stp enable

Function

The stp enable command enables STP/RSTP/MSTP on a switching device or an interface.

The undo stp enable command disables STP/RSTP/MSTP on a switching device or an interface.

The stp disable command disables STP/RSTP/MSTP on a switching device or an interface.

The undo stp disable command enables STP/RSTP/MSTP on a switching device or an interface.

By default, STP/RSTP/MSTP is enabled on a switching device.

Format

stp enable

undo stp enable

stp disable

undo stp disable

Parameters

None

Views

System view, Ethernet interface view, Eth-Trunk interface view, GE interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a complex Layer 2 network, to prevent loops or break loops, STP/RSTP/MSTP can be configured on switching devices.

Running the stp enable command enables STP/RSTP/MSTP. The devices running STP/RSTP/MSTP discover loops on the network by exchanging information with each other and trim the ring topology into a loop-free tree topology by blocking a certain interface. In this manner, replication and circular propagation of packets are prevented on the network. In addition, the processing performance of devices is prevented from deteriorating.

Enabling STP/RSTP/MSTP consumes system resources so that you can run the stp disable command to disable STP/RSTP/MSTP on devices or interfaces that do not participate in the spanning tree calculation.

Pre-configuration Tasks

After STP/RSTP/MSTP is enabled on a ring network, STP/RSTP/MSTP immediately calculates spanning trees on the network. Configurations on a switching device, such as, the switching device priority and port priority, will affect spanning tree calculation. Any change of the configurations may cause network flapping. Therefore, to ensure rapid and stable spanning tree calculation, before enabling STP/RSTP/MSTP, perform basic configurations on the switching device and its interfaces. For example:
  • Run the stp [ instance instance-id ] priority priority command to set the priority of the switching device in the spanning tree.

  • Run the stp [ instance instance-id ] root primary command to set the switching device as the primary root bridge of the spanning tree.

  • Run the stp [ instance instance-id ] root secondary command to set the switching device as the secondary root bridge of the spanning tree.

  • If the spanning tree protocol is MSTP, run the region-name name, instance instance-id vlan { vlan-id [ to vlan-id ] } &<1-10>, vlan-mapping modulo, and revision-level level commands to configure the MST region.

Other configurations are needed based on real-world situations.

Precautions

  • If STP/RSTP/MSTP is enabled on an interface, the interface participates in the spanning tree calculation and determine whether it is in the forwarding state according to the calculation result.

  • If STP/RSTP/MSTP is disabled on an interface, the interface does not participate in the spanning tree calculation and it is always in the forwarding state.

  • STP/RSTP/MSTP must be enabled on all interfaces that participate in the spanning tree calculation. Otherwise, a loop may occur.

  • Spanning tree calculation may result in network flapping. Before network convergence, packets cannot be correctly forwarded. In this case, if the DHCP server is configured on a VLANIF interface, DHCP clients obtain IP addresses slowly. To solve the problem, disable STP or configure the device interface connected to a terminal as the edge interface.

Example

# Enable STP/RSTP/MSTP on a switching device.

<Huawei> system-view
[Huawei] stp enable

# Disable STP/RSTP/MSTP on Eth0/0/1.

<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] stp disable
Related Topics

stp loop-protection

Function

The stp loop-protection command enables loop protection on the current port.

The undo stp loop-protection command disables loop protection on the current port.

By default, loop protection on ports is disabled.

Format

stp loop-protection

undo stp loop-protection

Parameters

None.

Views

Ethernet interface view, Eth-Trunk interface view, GE interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a network running a spanning tree protocol, a switching device maintains the status of the root port and blocked port by continually receiving BPDUs from the upstream switching device. If ports cannot receive BPDUs from the upstream switching device due to link congestion or unidirectional link failures, the switching device will re-select a root port. Then, the previous root port becomes a designated port and the previous blocked port enters the Forwarding state. As a result, loops may occur on the network.

To prevent the preceding problems, deploy loop protection. If the root port or alternate port does not receive BPDUs from the upstream device for a long time, the switch enabled with loop protection sends a notification to the NMS. If the root port is used, the root port enters the Discarding state and becomes the designated port. If the alternate port is used, the alternate port keeps blocked and becomes the designated port. In this case, loops will not occur. After the link is not congested or unidirectional link failures are rectified, the port receives BPDUs for negotiation and restores its original role and status.

NOTE:
  • An Alternate port is the backup of the root port. When the root port can normally send and receive BPDUs, the Alternate port is in the blocked state.

  • Between two interconnected switching devices in a spanning tree, the switching device nearer to the root bridge is the upstream device of the other devices.

Precautions

Loop protection and root protection cannot be configured on the same interface simultaneously.

Example

# Enable loop protection on the Eth0/0/1.
<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] stp loop-protection
Related Topics

stp max-hops

Function

The stp max-hops command sets the maximum hops of a spanning tree in an MST region.

The undo stp max-hops command restores the default value of the maximum hops of a spanning tree.

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

Format

stp max-hops hop

undo stp max-hops

Parameters

Parameter Description Value
hop Specifies the maximum hops. The value ranges from 1 to 40.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

Switching devices on a Layer 2 network running MSTP communicate with each other by exchanging MST BPDUs. An MST BPDU has a field that indicates the number of remaining hops.
  • The number of remaining hops in a BPDU sent by the root switching device equals the maximum number of hops.

  • The number of remaining hops in a BPDU sent by a non-root switching device equals the maximum number of hops minus the number of hops from the non-root switching device to the root switching device.

  • If a switching device receives a BPDU in which the number of remaining hops is 0, the switching device will discard the BPDU.

Therefore, the maximum number of hops of a spanning tree in an MST region determines the network scale. The stp max-hops command can be used to set the maximum number of hops in an MST domain so that the network scale of a spanning tree can be controlled.

Precautions

In an MST region, the maximum number of hops set on the root switching device in a CIST or an MSTI is the maximum number of hops in the CIST or MSTI.

Example

# Set the maximum hops in the MST region to 35.

<Huawei> system-view
[Huawei] stp max-hops 35
Related Topics

stp mcheck

Function

The stp mcheck command configures a port to automatically switch from the STP mode back to the RSTP/MSTP mode.

By default, a port transitions from the STP mode to the RSTP/MSTP mode by receiving BPDUs. A port that does not receive BPDUs cannot transition from the STP mode to the RSTP/MSTP mode.

Format

stp mcheck

Parameters

None

Views

System view, Ethernet interface view, Eth-Trunk interface view, GE interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If a port of an RSTP/MSTP switching device is directly connected to an STP switching device, the port automatically switches to the STP mode and then sends BPDUs. This ensures that the two switching devices properly communicate with each other. If the STP switching device is powered off or removed, the port on the RSTP/MSTP switching device cannot switch back to the RSTP/MSTP mode. As a result, the RSTP/MSTP device cannot communicate with other RSTP/MSTP switching devices.

When the interface goes Up, you can run the stp mcheck command. After this command is run on a port, the port will automatically switch from the STP mode back to the RSTP/MSTP mode.

Precautions

This command does not take effect on a port in Down state.

Running the stp mcheck command in the system view configures all ports on the current switching device to automatically switch back to the RSTP/MSTP mode.

Running the stp mcheck command in the MSTP process view configures all ports bound to the current MSTP process to automatically switch back to the RSTP/MSTP mode.

Running the stp mcheck command in the interface view configures only the current port to automatically switch back to the RSTP/MSTP mode.

Example

# Perform MCheck on Eth0/0/1 and switch it to the MSTP mode.
<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] stp mcheck

stp mode (system view)

Function

The stp mode command sets the operation mode of the spanning tree protocol on a switching device.

The undo stp mode command restores the default operation mode of the spanning tree protocol.

By default, the switching device operates in MSTP mode.

Format

stp mode { mstp | rstp | stp }

undo stp mode

Parameters

Parameter Description Value
mstp Indicates the MSTP mode. -
rstp Indicates the RSTP mode. -
stp Indicates the STP mode. -

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On an STP/RSTP/MSTP network, switching devices running different spanning tree protocols cannot communicate with each other. As a result, spanning trees cannot be properly calculated. A switching device has three operation modes: MSTP, RSTP, and STP.

The stp mode command can be used to set a proper operation mode for a spanning tree protocol on a switching device and enables the switching device to identify BPDUs sent by a switching device that runs a different spanning tree protocol during communication.

By default, all ports on a switching device operate in MSTP mode. When a switching device finds that it is directly connected to an STP switching device, it automatically switch the operation mode the port directly connected to the STP switching device to STP.

Configuration Impact

  • After the stp mode mstp command is run on a switching device, all ports running MSTP on the switching device, excluding the ports directly connected to STP switching devices, operate in MSTP mode and can send MSTP BPDUs. The ports directly connected to STP switching devices operate in STP mode.

  • After the stp mode rstp command is run on a switching device, all ports running RSTP on the switching device, excluding the ports directly connected to STP switching devices, operate in RSTP mode and can send RSTP BPDUs. The ports directly connected to STP switching devices operate in STP mode.

  • After the stp mode stp command is run on a switching device, all ports of the switching device operate in STP mode and send configured BPDUs.

Precautions

  • A port operating in MSTP mode can communicate with a port operating in RSTP mode.

  • The stp mode rstp command can be used to enable a switch that does not support MSTP to communicate with an STP switch.

Example

# Set the operation mode of the switching device to the STP mode.

<Huawei> system-view
[Huawei] stp mode stp
Related Topics

stp no-agreement-check

Function

The stp no-agreement-check command configures the common fast transition mechanism on an interface.

The undo stp no-agreement-check command restores the default fast transition mechanism on an interface.

By default, the enhanced transition mechanism is configured on an interface.

Format

stp no-agreement-check

undo stp no-agreement-check

Parameters

None

Views

Ethernet interface view, Eth-Trunk interface view, GE interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If Huawei and non-Huawei data communication devices are deployed on a network running a spanning tree protocol, the Huawei devices and non-Huawei devices may fail to communicate with each other, because they have different Proposal/Agreement mechanisms. To address this problem, the stp no-agreement-check command can be used to set a common fast transition mechanism or an enhanced transition mechanism on a port.
  • Running the stp no-agreement-check command configures a common fast transition mechanism on a port.

  • Running the undo stp no-agreement-check command configures an enhanced fast transition mechanism on a port.

Precautions

The fast transition mechanism is also called the Proposal/Agreement mechanism. The device currently supports the following modes:
  • Enhanced mode: The current interface counts a root port when it calculates the synchronization flag bit.
    1. An upstream device sends a Proposal message to a downstream device requesting fast status transition. After receiving the message, the downstream device sets the port connected to the upstream device as the root port and blocks all non-edge ports.

    2. The upstream device then sends an Agreement message to the downstream device. After the downstream device receives the message, the root port transitions to the Forwarding state.

    3. The downstream device then responds with an Agreement message. After receiving the message, the upstream device sets the port connected to the downstream device as the designated port, and then the status of the designated port changes to Forwarding.

  • Common mode: The current interface ignores the root port when it calculates the synchronization flag bit.
    1. An upstream device sends a Proposal message to a downstream device requesting fast transition. After receiving the message, the downstream device sets the port connected to the upstream device as the root port and blocks all non-edge ports. Then, the status of the root port changes to Forwarding.

    2. The downstream device then responds with an Agreement message. After receiving the message, the upstream device sets the port connected to the downstream device as the designated port, and then the status of the designated port changes to Forwarding.

NOTE:

Between two interconnected switching devices in a spanning tree, the switching device nearer to the root bridge is the upstream device of the other devices.

Example

# Configure the common fast transition mechanism for the Eth0/0/1.
<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] stp no-agreement-check

stp pathcost-standard

Function

The stp pathcost-standard command sets the standard used to calculate the path cost.

The undo stp pathcost-standard command restores the default standard used to calculate the path cost.

By default, the IEEE 802.1T is used to calculate the path cost.

Format

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

undo stp pathcost-standard

Parameters

Parameter Description Value
dot1d-1998 Indicates IEEE 802.1D standard that used to calculate the path cost. -
dot1t Indicates IEEE 802.1T standard that used to calculate the path cost. -
legacy Indicates Huawei legacy standard that used to calculate the path cost. -

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

A path cost is a port parameter, and is used by a spanning tree protocol to select a link. By calculating path costs, a spanning tree protocol selects stable links, blocks redundant paths, and trims a network into a loop-free network. The path cost range is determined by the path cost calculation standard.

Table 5-55 lists path costs defined by the IEEE 802.1D-1998 standard, IEEE 802.1T standard, and Huawei legacy standard. Different vendors use different standards.
Table 5-55  Path cost list

Interface Rate

Interface Mode

Recommended STP Path Cost

IEEE 802.1D-1998 Standard

IEEE 802.1T Standard

Huawei Legacy Standard

0

-

65535

200,000,000

200,000

10 Mbps

Half-Duplex

100

2,000,000

2000

Full-Duplex

99

1,999,999

1999

Aggregated Link 2 Ports

95

1,000,000

1800

Aggregated Link 3 Ports

95

666,666

1600

Aggregated Link 4 Ports

95

500,000

1400

100 Mbps

Half-Duplex

19

200,000

200

Full-Duplex

18

199,999

199

Aggregated Link 2 Ports

15

100,000

180

Aggregated Link 3 Ports

15

66,666

160

Aggregated Link 4 Ports

15

50,000

140

1000 Mbps

Full-Duplex

4

20,000

20

Aggregated Link 2 Ports

3

10,000

18

Aggregated Link 3 Ports

3

6666

16

Aggregated Link 4 Ports

3

5000

14

10 Gbps

Full-Duplex

2

2000

2

Aggregated Link 2 Ports

1

1000

1

Aggregated Link 3 Ports

1

666

1

Aggregated Link 4 Ports

1

500

1

Precautions

If the path cost calculation standard is changed on a port, the path cost of the port is restored to the default value. The stp cost command can be used to set a path cost for a port.

Usually, all switching devices on the same network use the same path cost calculation standard.

Example

# Use the IEEE 802.1d-1998 to calculate the path cost.

<Huawei> system-view
[Huawei] stp pathcost-standard dot1d-1998
Related Topics

stp point-to-point

Function

The stp point-to-point command sets the link type of a port.

The undo stp point-to-point command restores the default link type.

By default, the link type of the ports on the switching device is auto. That is, the spanning tree protocol detects whether a port is connected to a P2P link.

Format

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

undo stp point-to-point

Parameters

Parameter Description Value
force-true Indicates the link type is P2P. -
force-false Indicates the link type is non-P2P. -
auto Indicates that the spanning tree protocol detects automatically whether the port is connected to a P2P link. -

Views

Ethernet interface view, Eth-Trunk interface view, GE interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a Layer 2 network running a spanning tree protocol, if a port of a switching device is connected to a non-P2P link, the port cannot perform fast status transition.

If a port works in full-duplex mode, the port is connected to a P2P link, and force-true can be set in the stp point-to-point command.

If a port works in half-duplex mode, the stp point-to-point force-true command can be used to forcibly set the type of the link to which the port is connected to P2P, implementing rapid network convergence.

Precautions

The stp point-to-point command configuration on a port takes effect in all spanning tree instances where the port resides.

Example

# Set the link type of Eth0/0/1 as P2P.
<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] stp point-to-point force-true

stp port priority

Function

The stp port priority command sets the priority of a port in a spanning tree.

The undo stp port priority command restores the default priority.

By default, the priority of a port in a spanning tree is 128.

Format

stp [ instance instance-id ] port priority priority

undo stp [ instance instance-id ] port priority

Parameters

Parameter Description Value
instance instance-id

Specifies the spanning tree instance.

If this parameter is not specified, the statistics about the topology changes of a CIST are displayed.

The value is an integer ranging from 0 to . Value 0 refers to CIST.
NOTE:
instance-id ranges from 0 to 4094. The device supports a maximum of 17 instances.
priority Specifies the priority of a port. The priority ranks from 0 to 240 in descending order. The value is an integer multiple of 16, such as, 0, 16, and 32.

Views

Ethernet interface view, Eth-Trunk interface view, GE interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

When ports participate in spanning tree calculation, the PIDs of these ports on switching devices may affect the designated port election result. During spanning tree calculation, the port with the smallest PID is elected as the designated port.

NOTE:

A PID is the ID of a port, and consists of a 4-bit priority and a 12-bit port number.

The stp port priority command can be used to change the priority of a port. This affects the PID of the port and determines whether the port can be elected as the designated port.

Precautions

When the priority of a port changes, a spanning tree protocol recalculates the role of the port and performs status transition for the port.

The priority of a port determines the role of the port in a specified spanning tree instance and process. You can set different priorities for a port in different spanning tree instances or processes so that user traffic can be forwarded along different links and traffic load balancing can be implemented.

Example

# Set the priority of Eth0/0/1 to 16 in the spanning tree instance 2.
<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] stp instance 2 port priority 16

stp priority

Function

The stp priority command sets the priority of the switching device in a spanning tree.

The undo stp priority command restores the default priority.

By default, the priority of the switching device in a spanning tree is 32768.

Format

stp [ instance instance-id ] priority priority

undo stp [ instance instance-id ] priority

Parameters

Parameter Description Value
instance instance-id Specifies the ID of a spanning tree instance.

If the parameter instance instance-id is not specified, the configuration takes effect on a CIST instance.

The value is an integer ranging from 0 to 4094. Value 0 refers to CIST.
NOTE:
instance-id ranges from 0 to 4094. The device supports a maximum of 17 instances.
priority Specifies the priority of the switching device in a spanning tree.

The smaller the value is, the higher the switch priority is.

The priority ranks from 0 to 61440. The value is an integer multiple of 4096, such as 0, 4096 and 8192. The default is 32768.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

Priorities of switching devices are an important factor to calculate a spanning tree and determine the selection of the root bridge.

On an STP/RSTP/MSTP network, each spanning tree has only one root bridge, which is responsible for sending BPDUs. Owning to the importance of the root bridge, the switching device with high performance and network hierarchy is generally chosen as the root bridge. The priority of such a switching device, however, may not be that high. Therefore, setting a high priority for the switching device is necessary so that the device can function as a root bridge.

Other devices with low performance and network hierarchy are not fit to be a root bridge. Therefore, set low priorities for these devices.

On an MSTP network, each switching device can be set with a distinct priority in each spanning tree instance.

Precautions

The smaller the priority value of a switching device is, the higher the possibility that the switching device is selected as the root bridge.

If a switching device has been configured as the primary or secondary root bridge, before changing the priority of the switching device, run the undo stp [ instance instance-id ] root command to disable the root bridge or secondary root bridge function.

If the stp root primary command is run to set a switching device as the primary root bridge, the priority value of the switching device is 0.

If the stp root secondary command is run to set a switching device as the secondary root bridge, the priority value of the switching device is 4096.

Example

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

<Huawei> system-view
[Huawei] stp instance 1 priority 4096
Related Topics

stp region-configuration

Function

The stp region-configuration command displays the MST region view.

The undo stp region-configuration command restores the default configuration of the MST region.

The default parameters of the MST regions are as follows:

  • MST region name: MAC address of the main processing unit of the switching device.

  • MSTP revision level 0.

  • VLAN mapping table: all VLANs are mapped to CIST.

Format

stp region-configuration

undo stp region-configuration

Parameters

None

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

MSTP divides a switching network into multiple regions, each of which has multiple spanning trees and these spanning trees are independent of each other. Each spanning tree is called a multiple spanning tree instance (MSTI) and each region is called a multiple spanning tree (MST) region.

Two switching devices belong to the same MST region if they have the following parameters the same:
  • MST region name
  • Mappings between VLANs and MSTIs
  • Revision level of the MST region

If the preceding parameters need to be set for the current switching device or the current process, run the stp region-configuration command to enter the MST region view first.

Follow-up Procedure

After the stp region-configuration command is run to enter the MST region view, run the following commands:

Example

# Enter the MST region view.

<Huawei> system-view
[Huawei] stp region-configuration
[Huawei-mst-region]

stp root

Function

The stp root command configures a switching device as a root bridge or secondary root bridge of a spanning tree.

The undo stp root command cancels the configuration.

By default, a switching device does not function as the root bridge or secondary root bridge of a spanning tree.

Format

stp [ instance instance-id ] root { primary | secondary }

undo stp [ instance instance-id ] root

Parameters

Parameter Description Value
instance instance-id Specifies the ID of a spanning tree instance.

If the parameter instance instance-id is not specified, the configuration takes effect on a CIST instance.

The value is an integer ranging from 0 to 4094. Value 0 refers to CIST.
NOTE:
instance-id ranges from 0 to 4094. The device supports a maximum of 17 instances.
primary Indicates that the switching device functions as the root bridge of a spanning tree. -
secondary Indicates that the switching device functions as the secondary root bridge of a spanning tree. -

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On an STP/RSTP/MSTP network, each spanning tree has only one root bridge, which is responsible for sending BPDUs. Owning to the importance of the root bridge, the switching device with high performance and network hierarchy is generally chosen as a root bridge. The priority of such a device, however, may be not that high. Therefore, setting a high priority for the switching device is necessary so that the device can function as a root bridge.

To ensure nonstop traffic transmission, run the stp root command to configure the switching device as the secondary root bridge. When the root bridge is faulty or is powered off, the secondary root bridge becomes the root bridge during spanning tree calculation.

NOTE:

After the stp root primary command is run to set a switching device to be the primary root bridge, the priority value of the switching device is 0 in the spanning tree and the priority cannot be modified.

The secondary root bridge specified using the stp root secondary command has the priority value of 4096 and the priority cannot be modified.

Precautions

A spanning tree has only one root bridge.

A switching device in a spanning tree cannot function both as the primary root bridge and as the secondary root bridge.

If multiple secondary root bridges are set in a spanning tree, the one with the smallest MAC address functions as the secondary root bridge of the spanning tree.

Example

# Set the switching device as the root bridge of spanning tree instance 1.

<Huawei> system-view
[Huawei] stp instance 1 root primary

# Set the switching device as the secondary root bridge of spanning tree instance 4.

<Huawei> system-view
[Huawei] stp instance 4 root secondary
Related Topics

stp root-protection

Function

The stp root-protection command enables root protection at the current port.

The undo stp root-protection command restores the default setting of root protection.

By default, root protection is disabled at all ports.

Format

stp root-protection

undo stp root-protection

Parameters

None

Views

Ethernet interface view, Eth-Trunk interface view, GE interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

Owning to incorrect configurations or malicious attacks on the network, a root bridge may receive BPDUs with a higher priority. Consequently, the root bridge is no longer able to serve as the root bridge, and the network topology is changed, triggering a spanning tree recalculation. This spanning tree recalculation may transfer traffic from high-speed links to low-speed links, causing traffic congestion.

If a designated port is enabled with the root protection function, the port role cannot be changed. Once a designated port that is enabled with root protection receives BPDUs with a higher priority, the port enters the Discarding state and does not forward packets. If the port does not receive any BPDUs with a higher priority before a period (generally two Forward Delay periods) expires, the port automatically enters the Forwarding state.

NOTE:

You can run the stp timer forward-delay command to set the Forward Delay period.

Precautions

The root protection function takes effect only on a designated port. In addition, configuring the root protection function on a port that functions as the designated port in all instances is recommended.

If the stp root-protection command is run on other types of ports, the root protection function does not take effect.

Loop protection and root protection cannot be configured on the same interface simultaneously.

Example

# Enable the root protection function on Eth0/0/1.
<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] stp root-protection

stp tc-protection

Function

The stp tc-protection command enables TC BPDU protection.

The undo stp tc-protection command disables TC BPDU protection.

By default, TC BPDU protection is disabled.

Format

stp tc-protection

undo stp tc-protection

Parameters

None

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a Layer 2 network where spanning tree protocol is running, a switching device that receives TC BPDUs will delete the corresponding MAC entries and ARP entries. Frequent deletion operations will greatly affect the CPU, leading to a high CPU usage. In this case, you can run the stp tc-protection command to enable the TC BPDU attack defense function.

After the stp tc-protection command is run to enable the TC BPDU attack defense function, the number of times that TC BPDUs are processed by the switching device within a unit time is configurable (the default unit time is 2s, and the default number of times is 1). If the number of TC BPDUs that the switching device receives within a unit time exceeds the specified threshold, the switching device handles TC BPDUs only for the specified number of times. Additional TC BPDUs are processed by the switching device as a whole for once after the timer (that is, the specified time period) expires. In this manner, the switching device is prevented from frequently deleting its MAC entries and ARP entries so that the CPU is protected against overburden.

NOTE:

The value of the unit time is consistent with the spanning tree protocol's Hello time and can be set using the stp timer hello command.

Follow-up Procedure

After the stp tc-protection command is run, run the stp tc-protection threshold command to set the number of times that TC BPDUs are processed by the switching device within a unit time.

Example

# Enable the TC BPDU protection function.

<Huawei> system-view
[Huawei] stp tc-protection

stp tc-protection interval

Function

The stp tc-protection interval command sets the time for a device to process the maximum number of TC BPDUs.

The undo stp tc-protection interval command restores the default value.

By default, the time is the Hello timer length.

Format

stp tc-protection interval interval-value

undo stp tc-protection interval

Parameters

Parameter Description Value
interval-value Specifies the time for a device to process the maximum number of TC BPDUs. The value is an integer ranging from 1 to 600, in seconds.

Views

System view or MST process region view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a Layer 2 network running a spanning tree protocol, a device deletes MAC address entries and ARP entries after receiving TC packets. Frequent entry deletion may cause high CPU usage.

The TC attack defense function is enabled by default, you can configure the time, which the device takes to handle a given number of TC packets and immediately refresh forwarding entries, by running the stp tc-protection interval command. Within the time specified by interval-value, the device handles a given number of TC packets. Excess TC packets are processed by the device at once after the timer (whose length is the configured time) expires. This mechanism ensures that the device does not frequently delete its MAC entries and ARP entries, and therefore does not have excessive CPU usage.
NOTE:

You can specify the maximum number of TC packets that the device processes can handle in the specified time by running the stp tc-protection threshold command.

Example

# Configure the amount of time, which MSTP process 0 and MSTP process 1 take to handle a given number of TC packets and immediately refreshes forwarding entries, to 10 seconds.
<Huawei> system-view
[Huawei] stp tc-protection interval 10
[Huawei] stp process 1
[Huawei-mst-process-1] stp tc-protection interval 10

stp tc-protection threshold

Function

The stp tc-protection threshold command sets the number of times that a device handles received TC BPDUs and updates forwarding entries within a unit time.

The undo stp tc-protection threshold command restores the default setting.

By default, after a device receives TC BPDUs, the default number of times that the device handles the TC BPDUs and updates forwarding entries is 1 within a unit time.

Format

stp tc-protection threshold threshold

undo stp tc-protection threshold

Parameters

Parameter Description Value
threshold Indicates the number of times that a device handles the TC BPUD and updates forwarding entries per unit of time. The value is an integer ranging from 1 to 255.

Views

System view or MST process region view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a Layer 2 network where MSTP is run, a switching device that receives TC BPDUs will delete the corresponding MAC entries and ARP entries. Frequent deletion operations will greatly affect the CPU, leading to a high CPU usage.

The TC attack defense function is enabled by default, the number of times that TC BPDUs are processed by the switching device within a unit time is configurable (the default unit time is 2s, and the default number of times is 1). If the number of TC BPDUs that the switching device receives within a unit time exceeds the specified threshold, the switching device handles TC BPDUs only for the specified number of times. Additional TC BPDUs are processed by the switching device as a whole for once after the timer (that is, the specified time period) expires. In this manner, the switching device is prevented from frequently deleting its MAC entries and ARP entries so that the CPU is protected against overburden.
NOTE:

The value of the unit time is consistent with the Hello time and can be set using the stp timer hello command.

Example

# Set the threshold update forwarding entries to 5.
<Huawei> system-view
[Huawei] stp tc-protection threshold 5

stp timer forward-delay

Function

The stp timer forward-delay command sets the value of the Forward Delay of a switching device.

The undo stp timer forward-delay command restores the default value of the Forward Delay.

By default, the value of the Forward Delay of a switching device is 1500 centiseconds (15 seconds).

Format

stp timer forward-delay forward-delay

undo stp timer forward-delay

Parameters

Parameter Description Value
forward-delay Specifies the value of the Forward Delay. The value ranges from 400 to 3000 centiseconds by a step of 100.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a network running a spanning tree algorithm, if the network topology is changed, it takes time to advertise new BPDU configuration messages on the network. During this period, interfaces to be blocked may not be blocked in time and interface ever blocked may not be blocked. As a result, a temporary loop may be formed. To prevent this problem, you can use the Forward Delay timer to set a delay time. During the delay time, all interfaces are blocked temporarily.

The stp timer forward-delay command is used to set the Forward Delay timer.

Precautions

The value of the Forward Delay timer set on the root bridge is advertised to other devices of the same spanning tree using BPDUs. Then it becomes the value of the Forward Delay timer of all devices in the spanning tree.

The relationships between the Hello Time, Forward Delay, and MaxAge are as follows. The spanning tree functions properly only if the correct relationships are established. Otherwise, frequent network flapping occurs.
  • 2 x (Forward Delay - 1.0 second) >= Max Age

  • Max Age >= 2 x (Hello Time + 1.0 second)

Running the stp bridge-diameter command to set the network diameter is recommended. After the stp bridge-diameter command is run, the switching device sets optimum values for the three parameters, Hello Time, Forward Delay, and Max Age.

Example

# Set the Forward Delay to 2000 centiseconds (20 seconds) .

<Huawei> system-view
[Huawei] stp timer forward-delay 2000

stp timer hello

Function

The stp timer hello command sets the interval of the switching device to send BPDUs, that is, the value of the Hello Time.

The undo stp timer hello command restores the default setting.

By default, the interval of the switch to send BPDUs is 200 centiseconds (2 seconds).

Format

stp timer hello hello-time

undo stp timer hello

Parameters

Parameter Description Value
hello-time

Specifies the interval of the switch to send BPDUs.

The value ranges from 100 to 1000, in centiseconds by a step of 100.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a network where a spanning tree protocol is enabled, a switching device periodically sends BPDUs to other devices in the same spanning tree at the interval of the Hello Time. Sending BPDUs periodically ensures that the spanning tree is stable. The stp timer hello command can be used to set the BPDU sending interval, that is, the Hello Time.

If no BPDUs are received by the switching device within the timeout period (timeout period = Hello Time x 3 x Timer Factor), the spanning tree is calculated again.
NOTE:

In a spanning tree, the device closer to the root bridge is the upstream device of another connected device.

Precautions

The value of the Hello Time set on the root bridge is advertised to other devices of the same spanning tree using BPDUs. Then it becomes the value of the Hello Time of all devices in the spanning tree.

The relationships between the Hello Time, Forward Delay, and Max Age are as follows. The spanning tree works properly only if the relationships are correctly established. Otherwise, frequent network flapping occurs.
  • 2 x (Forward Delay - 1.0 second) >= Max Age

  • Max Age >= 2 x (Hello Time + 1.0 second)

Running the stp bridge-diameter command to set the network diameter is recommended. After the stp bridge-diameter command is run, the switching device sets optimum values for the three parameters, Hello Time, Forward Delay, and Max Age.

Example

# Set the Hello Time to 400 centiseconds (4 seconds) .

<Huawei> system-view
[Huawei] stp timer hello 400

stp timer max-age

Function

The stp timer max-age command sets the Max Age of a switching device, that is, the BPDU aging time on a port of the switching device.

The undo stp timer max-age command restores the default setting.

By default, the Max Age of a switching device is 2000 centiseconds (20 seconds).

Format

stp timer max-age max-age

undo stp timer max-age

Parameters

Parameter Description Value
max-age

Specifies the BPDU aging time on a port of the switch.

The value ranges from 600 to 4000 in centiseconds with a step of 100.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a network where a spanning tree protocol is enabled, a switching device checks whether the BPDUs received from an upstream switching device time out based on the set Max Age value. If the received BPDUs time out, the switching device ages the BPDUs and blocks the port that receives the BPDUs. Then, the switching device sends the BPDUs with the switching device as the root bridge. This aging mechanism effectively controls the diameter of the spanning tree. After the stp timer max-age command is run, the Max Age value is set to control the timeout period of received BPDUs.
NOTE:

In a spanning tree, the device closer to the root bridge is the upstream device of another connected device.

Precautions

The value of the Max Age set on the root bridge is advertised to other devices of the same spanning tree using BPDUs. Then it becomes the MaxAge value of all devices in the spanning tree.

The timer MaxAge value takes effect for only the CIST and does not take effect for MSTIs.

The relationships between the Hello Time, Forward Delay, and Max Age are as follows. The spanning tree functions properly only if the relationships are correctly established. Otherwise, frequent network flapping occurs.
  • 2 x (Forward Delay - 1.0 second) >= Max Age

  • Max Age >= 2 x (Hello Time + 1.0 second)

Running the stp bridge-diameter command to set the network diameter is recommended. After the stp bridge-diameter command is run, the switching device sets optimum values for the three parameters, Hello Time, Forward Delay, and Max Age.

Example

# Set the Max Age to 1000 centiseconds (10 seconds) .

<Huawei> system-view
[Huawei] stp timer max-age 1000

stp timer-factor

Function

The stp timer-factor command sets the timer factor of the timeout period of a switching device to the Hello Time.

The undo stp timer-factor command restores the default setting.

By default, the timer factor is 3.
NOTE:

If a switching device does not receive BPDUs from an upstream device within the timeout period (timeout period = Hello Time × 3 × Timer Factor), the spanning tree is calculated again.

Format

stp timer-factor factor

undo stp timer-factor

Parameters

Parameter Description Value
factor Specifies the timer factor. The value ranges from 1 to 10.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a network where a spanning tree protocol is enabled, if a switching device does not receive BPDUs from an upstream device within the timeout period, it considers that the upstream device becomes faulty, and will recalculate the spanning tree.

Sometimes, however, the failure of the upstream device to send BPDUs within the timeout period is only because it is busy processing services. In this case, the spanning tree cannot be calculated. Therefore, you can set a long timeout period on a stable network to avoid the waste of network resources.
NOTE:

In a spanning tree, the device closer to the root bridge is the upstream device of another connected device.

Precautions

If the parameter factor is set smaller, the timeout period of the switching device to re-calculate the spanning tree is shorter. In this case, there is a higher probability that the switching device incorrectly considers the upstream device as being faulty.

If the parameter factor is set larger, the timeout period of the switching device to re-calculate the spanning tree is longer. In this case, there is a higher probability that the traffic becomes interrupted because the upstream device has become faulty.

Example

# Set the Timer-Factor of the switching device to 6.

<Huawei> system-view
[Huawei] stp timer-factor 6
Related Topics

stp transmit-limit (interface view)

Function

The stp transmit-limit command sets the maximum number of BPDUs that the current port can send in a specified period.

The undo stp transmit-limit command restores the default maximum BPDUs.

By default, the maximum number of BPDUs that a port sends is 6 per second.

Format

stp transmit-limit packet-number

undo stp transmit-limit

Parameters

Parameter Description Value
packet-number

Specifies the maximum number of BPDUs that a port can send in a specified period.

The value is an integer that ranges from 1 to 255.

Views

Ethernet interface view, Eth-Trunk interface view, GE interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a network where a spanning tree protocol is enabled, a switching device periodically sends BPDUs to other devices in the same spanning tree with the interval of the Hello Time. Sending BPDUs periodically ensures that the spanning tree is stable. If the number of sent BPDUs are great in a specified period, excessive system and bandwidth resources will be consumed.

To prevent this problem from occurring, run the stp transmit-limit command to set the maximum number of BPDUs that can be sent by an interface in a specified period. In this manner, the BPDU sending speed is controlled, preventing excessive use of system and bandwidth resources by MSTP when the network topology flaps.

Precautions

After the stp transmit-limit command is configured, the maximum number of BPDUs sent in a specified period by the interface is determined by the set value.

Example

# Set the maximum BPDUs that Eth0/0/1 can send in a specified period to 5.
<Huawei> system-view
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] stp transmit-limit 5

stp transmit-limit (system view)

Function

The stp transmit-limit command configures the maximum number of Bridge Protocol Data Units (BPDUs) that each interface of the local device can send per second.

The undo stp transmit-limit command restores the maximum number of BPDUs, which can be sent by each interface of the local device per second, to the default value.

By default, each interface can send a maximum of 6 BPDUs per second.

Format

stp transmit-limit packet-number

undo stp transmit-limit

Parameters

Parameter Description Value
packet-number Maximum number of BPDUs that each interface of the local device can send per second The value is an integer ranging from 1 to 255.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a network running the Spanning Tree Protocol (STP), a switch sends BPDUs to other devices in the same spanning tree at the interval of the Hello time, to maintain the spanning tree stability. If a number of BPDUs are sent every second, system and bandwidth resources will be greatly consumed.

NOTE:

You can configure the Hello time by using the stp timer hello command. The Hello time is the length of the Hello timer and specifies the interval at which the switch sends BPDUs.

To prevent excessive usage of system and bandwidth resources, you can run the stp transmit-limit command to configure the maximum number of BPDUs that each interface of the local device can send per second. This configuration controls the BPDU sending rate and prevents the Multiple Spanning Tree Protocol (MSTP) from consuming too many system and bandwidth resources when topology flapping occurs.

Precautions

After the stp transmit-limit command is executed, packet-number controls the maximum number of BPDUs that each interface can send per second.

You can also configure the maximum number of BPDUs that a specific interface can send per second by running the stp transmit-limit (interface view) command in the view of this interface. The stp transmit-limit (interface view) command configuration in the interface view takes precedence over the stp transmit-limit command configuration in the system view. That is, if the stp transmit-limit (interface view) command is configured in the view of an interface, the stp transmit-limit command configuration in the system view does not take effect for this interface.

Example

# Configure the maximum number of BPDUs that each interface of the local device can send per second to 5.
<Huawei> system-view
[Huawei] stp transmit-limit 5

vlan-mapping modulo

Function

The vlan-mapping modulo command enables VLAN-to-instance mapping assignment based on a default algorithm.

The undo vlan-mapping modulo command restores the default mapping.

By default, all VLANs are mapped to CIST, namely, spanning tree instance 0.

Format

vlan-mapping modulo modulo

undo vlan-mapping modulo

Parameters

Parameter Description Value
modulo Specifies the value of a module.

The value is an integer ranging from 1 to 48.

Views

MST region view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

MSTP divides a switching network into multiple regions, each of which has multiple spanning trees that are independent of each other. Each spanning tree is called an MSTI and each region is called an MST region.

Two switching devices belong to the same MST region only when they have the following same configurations:
  • MST region name
  • Mappings between MSTIs and VLANs
  • MST region revision level
The vlan-mapping modulo command is used to enable VLAN-to-instance mapping assignment based on a default algorithm.
NOTE:

In the command, vlan-mapping modulo indicates that the formula (VLAN ID-1)%modulo+1 is used. In the formula, (VLAN ID-1)%modulo means the remainder of (VLAN ID-1) divided by the value of modulo. This formula is used to map a VLAN to the corresponding MSTI. The calculation result of the formula is ID of the mapping MSTI. For example, if the modulus is 16, the switch maps VLAN 1 to MSTI 1, VLAN 2 to MSTI 2 VLAN 16 to MSTI 16, VLAN 17 to MSTI 1, and so on.

Precautions

The instance instance-id vlan { vlan-id [ to vlan-id ] }&<1-10> command is recommended because VLAN-to-instance mapping assignments cannot meet actual mapping requirements.

Example

# Map all VLANs to spanning tree instances modulo 16.

<Huawei> system-view
[Huawei] stp region-configuration
[Huawei-mst-region] vlan-mapping modulo 16
Translation
Download
Updated: 2019-02-18

Document ID: EDOC1000097293

Views: 36190

Downloads: 101

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next