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

S12700 V200R013C00 Command Reference

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).
Loop Detection Configuration Commands

Loop Detection Configuration Commands

Command Support

Commands provided in this section and all the parameters in the commands are supported by all switch models by default, unless otherwise specified. For details, see specific commands.

display loop-detection

Function

The display loop-detection command checks the loop detection configuration and status of interfaces with loop detection enabled.

Format

display loop-detection [ interface interface-type interface-number ]

Parameters

Parameter

Description

Setting

interface interface-type interface-number

Displays the configuration of a specified interface.
  • interface-type: interface type.
  • interface-number: interface number.
If interface-type and interface-number are not set, the configuration of the global loop detection function is displayed.

-

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

The display loop-detection command checks whether loop detection is enabled on an interface. If loop detection is enabled, the system displays the interval for sending loop detection packets, ID of the VLAN with loop detection enabled, and the interfaces that are blocked, shutdown, and disabled from learning MAC addresses.

Example

# View the configuration of the global loop detection function.

<HUAWEI> display loop-detection
Loop Detection is enabled.
Detection interval time is 10 seconds.
Following VLANs enable loop-detection:
 VLAN  100
Following ports are blocked for loop:
NULL
Following ports are shutdown for loop:
NULL  
Following ports are nolearning for loop:                         
NULL                                                                            
Following ports are trapped for loop:                                            
NULL 
Following ports are quitvlan for loop:
NULL

# View the loop detection configuration of GigabitEthernet 1/0/0.

<HUAWEI> display loop-detection interface gigabitethernet 1/0/0
The port is enabled.
The port's status list:
Status              WorkMode            Recovery-time       EnabledVLAN
-----------------------------------------------------------------------
Normal              Shutdown            30                 100
Table 5-117  Description of the display loop-detection command output

Item

Description

Detection interval time

Interval for sending loop detection packets on an interface. This parameter is set using the loop-detection interval-time command.

Following VLANs enable loop-detection

VLANs with loop detection enabled. This parameter is set using the loop-detection enable vlan command.

Following ports are blocked for loop

Interfaces that are blocked due to loops.

Following ports are shutdown for loop

Interfaces that are temporarily shut down due to loops.

Following ports are nolearning for loop

Interfaces that are disabled from learning MAC addresses due to loops.

Following ports are trapped for loop

Interfaces that enter the trap state due to loops.

Following ports are quitvlan for loop

Interfaces that are removed from VLANs due to loops.

Status

Status of an interface with loop detection enabled. The options are:
  • Normal
  • Shutdown
  • Block
  • Nolearning
  • Trap
  • Quitvlan

WorkMode

Action that an interface takes after a loop is detected. The options are:
  • Trap
  • Block
  • Nolearning
  • Shutdown
  • Quitvlan
This parameter is set using the loop-detection mode command.

Recovery-time

Interface recovery time. This parameter is set using the loop-detection recovery-time command.

EnabledVLAN

Local VLAN of an interface with loop detection enabled.

display snmp-agent trap feature-name ldttrap all

Function

The display snmp-agent trap feature-name ldttrap all command displays all trap messages of the Loop Detection module.

Format

display snmp-agent trap feature-name ldttrap all

Parameters

None

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

After the trap function of a specified feature is enabled, you can run the display snmp-agent trap feature-name ldttrap all command to check the status of all traps of Loop Detection. You can use the snmp-agent trap enable feature-name ldttrap command to enable the trap function of Loop Detection.

Prerequisites

SNMP has been enabled. See snmp-agent.

Example

# Display all trap messages of the Loop Detection module.

<HUAWEI> display snmp-agent trap feature-name ldttrap all
------------------------------------------------------------------------------                                                      
Feature name: LDTTRAP                                                                                                               
Trap number : 2                                                                                                                     
------------------------------------------------------------------------------                                                      
Trap name                       Default switch status   Current switch status                                                       
hwLdtPortLoop                   off                     off                                                                         
hwLdtPortRecovry                off                     off                       
Table 5-118  Description of the display snmp-agent trap feature-name ldttrap all command output

Item

Description

Feature name

Name of the module to which a trap message belongs.

Trap number

Number of trap messages.

Trap name

Name of a trap message of the Loop Detection module:

  • hwLdtPortLoop: A Huawei proprietary trap when the loopback on the interface of the Loop Detection module.

  • hwLdtPortRecovry: A Huawei proprietary trap when the loopback recovery on the interface of the Loop Detection module.

Default switch status

Status of the default trap function:

  • on: indicates that the trap function is enabled.
  • off: indicates that the trap function is disabled.

Current switch status

Status of the current trap function:

  • on: indicates that the trap function is enabled.
  • off: indicates that the trap function is disabled.

To specify the parameter, run the snmp-agent trap enable feature-name ldttrap command.

loop-detection disable

Function

The loop-detection disable command disables an interface from detecting loops in the local VLAN.

The undo loop-detection disable command enables an interface to detect loops in the local VLAN.

By default, loop detection is enabled on each interface.

Format

loop-detection disable

undo loop-detection disable

Parameters

None

Views

GE interface view, XGE interface view, 40GE interface view, 100GE interface view, port group view, Eth-Trunk interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

After the global loop detection function is enabled and loop detection is enabled in a VLAN, all interfaces in this VLAN detect loops.

If MSTP is configured on an interface, run the loop-detection disable command to disable the interface from detecting loops.

Prerequisites

The global loop detection function has been enabled, and loop detection has been enabled in the specified VLAN.

Precautions

The loop-detection disable command takes effect on all VLANs that the interface allows.

Example

# Disable loop detection on GE1/0/0.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 1/0/0
[HUAWEI-GigabitEthernet1/0/0] loop-detection disable

loop-detection enable

Function

The loop-detection enable command enables global loop detection.

The undo loop-detection enable command disables global loop detection.

By default, the global loop detection function is disabled.

Format

loop-detection enable

undo loop-detection enable

Parameters

None

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

When a loop occurs on a network, broadcast, multicast, and unknown unicast packets are repeatedly transmitted on the network. This wastes network resources or even causes service interruption on the entire network. To reduce the impact on the network, you can enable loop detection in a VLAN to detect loops and set interfaces in the VLAN to be blocked, shut down, or disabled from learning MAC addresses.

In the system view, loop detection can be enabled in a VLAN or on an interface only after global loop detection is enabled.

Precautions

Loop detection occupies resources; therefore, disable this function when it is not required.

Example

# Enable global loop detection.

<HUAWEI> system-view
[HUAWEI] loop-detection enable

loop-detection enable vlan

Function

The loop-detection enable vlan command enables loop detection in a specified VLAN.

The undo loop-detection enable vlan command disables loop detection in a specified VLAN.

By default, loop detection is disabled in all VLANs.

Format

loop-detection enable vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all }

undo loop-detection enable vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all }

Parameters

Parameter

Description

Setting

vlan-id1 [ to vlan-id2 ]

Specifies the ID of a VLAN with loop detection enabled. The options are:
  • vlan-id1: start VLAN ID.
  • to vlan-id2: end VLAN ID. The value of vlan-id2 must be larger than that of vlan-id1. If to vlan-id2 is not specified, loop detection is enabled only on the VLAN specified by vlan-id1.
A maximum of 10 VLAN ID ranges are supported. The ranges cannot overlap.

The value of vlan-id1 or vlan-id2 is an integer that ranges from 1 to 4094.

all

Specifies all VLANs created on the switch.

-

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

When global loop detection is enabled, the system does not detect loops in any VLAN by default. You can run the loop-detection enable vlan command to enable loop detection in a specified VLAN.

NOTE:

By default, loop detection is disabled in the VLANs that are created after global loop detection is enabled.

Prerequisites

Global loop detection has been enabled.

Configuration Impact

If you run the loop-detection enable vlan command multiple times, all specified VLANs are enabled with loop detection.

The switch supports loop detection in a maximum of 4094 VLANs.

Example

# Enable loop detection in VLAN 2.

<HUAWEI> system-view
[HUAWEI] loop-detection enable vlan 2

loop-detection interval-time

Function

The loop-detection interval-time command sets the interval for sending loop detection packets on an interface.

The undo loop-detection interval-time command restores the default interval for sending loop detection packets on an interface.

The default interval is 5 seconds.

Format

loop-detection interval-time interval-time

undo loop-detection interval-time [ interval-time ]

Parameters

Parameter

Description

Setting

interval-time

Specifies the interval for sending loop detection packets on an interface.

The value is an integer that ranges from 5 to 300, in seconds.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

An interface with loop detection enabled periodically sends loop detection packets. You can adjust the interval for sending loop detection packets on an interface based on the site requirements. A shorter interval indicates that the system sends more loop detection packets in a certain period. This enables the system to detect loops more quickly and accurately, but consumes more system resources.

Prerequisites

Global loop detection has been enabled.

If you run the loop-detection interval-time command multiple times, only the latest configuration takes effect.

Example

# Set the interval for sending loop detection packets to 10 seconds.

<HUAWEI> system-view
[HUAWEI] loop-detection interval-time 10

loop-detection mode

Function

The loop-detection mode command configures the action performed on an interface when a loop is detected.

The undo loop-detection mode command restores the default setting.

The default action is Shutdown.

Format

loop-detection mode { port-trap | port-blocking | port-nolearning | port-shutdown | port-quitvlan }

undo loop-detection mode { port-trap | port-blocking | port-nolearning | port-shutdown | port-quitvlan }

Parameters

Parameter

Description

Setting

port-trap

Indicates that the interface sends a trap message but does not perform any action.

This action is selected when users only need to report alarms. The forwarding on the interface is not affected.

-

port-blocking

Indicates that the interface sends a trap message and is blocked. It can forward only BPDUs.

This action is selected when users disable the interface from forwarding data packets but still want to forward protocol packets using other protocols such as LLDP.

-

port-nolearning

Indicates that the interface sends a trap message and is disabled from learning MAC addresses.

This action is selected when the interface still needs to properly forward data packets after a loop is detected.

-

port-shutdown

Indicates that the interface sends a trap message and enters the Shutdown state.

This action is selected when users disable the interface from computing and forwarding. The interface is in the default state Shutdown.

-

port-quitvlan

Indicates that the interface quits the VLAN in which a loop occurs.

-

Views

GE interface view, XGE interface view, 40GE interface view, port group view, Eth-Trunk interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

After loop detection is enabled, the interface periodically detects loops. When a loop is detected, the device configures the interface based on the configuration of the loop-detection mode command.

Prerequisites

Global loop detection has been enabled, and loop detection is enabled on the interface.

Precautions

The parameter settings in the undo loop-detection mode command must be the same as those in the loop-detection mode command.

If you run the loop-detection mode command multiple times, only the latest configuration takes effect.

Example

# Configure the trap action performed on an interface when a loop is detected.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 1/0/0
[HUAWEI-GigabitEthernet1/0/0] loop-detection mode port-trap

loop-detection recovery-time

Function

The loop-detection recovery-time command sets the interface recovery time.

The undo loop-detection recovery-time command restores the default setting.

The default recovery time is 255 seconds.

Format

loop-detection recovery-time recovery-time

undo loop-detection recovery-time [ recovery-time ]

undo loop-detection recovery-time ( port group view )

Parameters

Parameter

Description

Setting

recovery-time

Specifies the interface recovery time.

The value is an integer that ranges from 0 to 255, in seconds.

NOTE:
The value 0 indicates that the interface does not recover.

Views

GE interface view, XGE interface view, 40GE interface view, 100GE interface view, port group view, Eth-Trunk interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The interface with loop detection enabled periodically sends loop detection packets to detect loops in the local VLAN. If a loop is detected, the interface is blocked, shut down, or disabled from learning MAC addresses. Users can set the interface recovery time after a loop is removed. If the system does not receive loop detection packets from the interface within the recovery time, the system considers that the loop is removed and sets the interface to a normal state.

Prerequisites

Global loop detection has been enabled.

Configuration Impact

If you run the loop-detection recovery-time command multiple times, only the latest configuration takes effect.

To prevent interface status flapping, set the interface recovery time to be larger than the interval for sending loop detection packets.

Example

# Set the interface recovery time to 30 seconds.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 1/0/0
[HUAWEI-GigabitEthernet1/0/0] loop-detection recovery-time 30

snmp-agent trap enable feature-name ldttrap

Function

The snmp-agent trap enable feature-name ldttrap command enables the trap function for the Loop Detection module.

The undo snmp-agent trap enable feature-name ldttrap command disables the trap function for the Loop Detection module.

By default, the trap function is disabled for the Loop Detection module.

Format

snmp-agent trap enable feature-name ldttrap [ trap-name { hwldtportloop | hwldtportrecovry } ]

undo snmp-agent trap enable feature-name ldttrap [ trap-name { hwldtportloop | hwldtportrecovry } ]

Parameters

Parameter Description Value
trap-name

Enables or disables the trap function for the specified event.

-
hwldtportloop

Sends a Huawei proprietary trap when the loopback on the interface of the Loop Detection module.

-
hwldtportrecovry

Sends a Huawei proprietary trap when the loopback recovery on the interface of the Loop Detection module.

-

Views

System view

Default Level

2: Configuration level

Usage Guidelines

When the trap function is enabled, the device generates traps during running and sends traps to the NMS through SNMP. When the trap function is not enabled, the device does not generate traps and the SNMP module does not send traps to the NMS.

You can specify trap-name to enable the trap function for one or more events.

Example

# Enable the device to send a Huawei proprietary trap when the loopback on the interface of the Loop Detection module.

<HUAWEI> system-view
[HUAWEI] snmp-agent trap enable feature-name ldttrap trap-name hwldtportloop
Translation
Download
Updated: 2019-04-09

Document ID: EDOC1100065659

Views: 115395

Downloads: 83

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