- Table of Contents
-
- 04-Layer 2 - LAN Switching Command Reference
- 00-Preface
- 01-MAC address table commands
- 02-Ethernet link aggregation commands
- 03-DRNI commands
- 04-Port isolation commands
- 05-VLAN commands
- 06-MVRP commands
- 07-QinQ commands
- 08-VLAN mapping commands
- 09-Loop detection commands
- 10-Spanning tree commands
- 11-LLDP commands
- Related Documents
-
Title | Size | Download |
---|---|---|
09-Loop detection commands | 67.97 KB |
Contents
loopback-detection global action
loopback-detection global enable
loopback-detection interval-time
Loop detection commands
display loopback-detection
Use display loopback-detection to display the loop detection configuration and status.
Syntax
display loopback-detection
Views
Any view
Predefined user roles
network-admin
network-operator
Example
# Display the loop detection configuration and status.
<Sysname> display loopback-detection
Loop detection is enabled.
Global loop detection interval is 30 second(s).
Loop is detected on following interfaces:
* indicates the loop protection action was not triggered because of low priority.
# indicates the loop protection action failed.
Interface Action mode VLANs/VSI
Ten-GigabitEthernet1/1/13 None 10
Table 1 Command output
Field |
Description |
Action mode |
Loop protection action: · Block—When a loop is detected on an interface, the device performs the following operations: ¡ Generates a log. ¡ Disables the interface from learning MAC addresses. ¡ Blocks the interface. · None—When a loop is detected on an interface, the device generates a log but performs no action on the interface. · No-learning—When a loop is detected on an interface, the device generates a log and disables the interface from learning MAC addresses. · Shutdown—When a loop is detected on an interface, the device performs the following operations: ¡ Generates a log. ¡ Shuts down the interface to disable the interface from receiving or sending frames. The device automatically sets the interface to the forwarding state after a time interval. Set the time interval by using the shutdown-interval command (see Fundamentals Command Reference). |
VLANs/VSI |
VLANs where loops are detected. |
loopback-detection action
Use loopback-detection action to set the loop protection action on an interface.
Use undo loopback-detection action to restore the default.
Syntax
In Layer 2 Ethernet interface view:
loopback-detection action { block | no-learning | shutdown }
undo loopback-detection action
In Layer 2 aggregate interface view:
loopback-detection action shutdown
undo loopback-detection action
Default
When the device detects a loop on an interface, it generates a log but performs no action on the interface.
Views
Layer 2 Ethernet interface view
Layer 2 aggregate interface view
Predefined user roles
network-admin
Parameters
block: Enables the block mode. If a loop is detected, the device performs the following operations:
· Generates a log.
· Disables MAC address learning.
· Blocks the interface.
Layer 2 aggregate interfaces do not support this keyword.
no-learning: Enables the no-learning mode. If a loop is detected, the device generates a log and disables MAC address learning on the interface. Layer 2 aggregate interfaces interfaces do not support this keyword.
shutdown: Enables the shutdown mode. If a loop is detected, the device generates a log and shuts down the interface. The device automatically sets the interface to the forwarding state after the time interval set by using the shutdown-interval command (see Fundamentals Command Reference).
Usage guidelines
To set the loop protection action globally, use the loopback-detection global action command.
The global action applies to all interfaces. An interface-specific action applies only to the interface on which the action is configured. On an interface, the interface-specific action takes precedence over the global action.
Example
# Set the loop protection action to shutdown on Ten-GigabitEthernet 1/1/11.
<Sysname> system-view
[Sysname] interface ten-gigabitethernet 1/1/11
[System-Ten-GigabitEthernet1/1/11] loopback-detection action shutdown
display loopback-detection
loopback-detection global action
loopback-detection enable
Use loopback-detection enable to enable loop detection on an interface.
Use undo loopback-detection enable to disable loop detection on an interface.
Syntax
loopback-detection enable vlan { vlan-id-list | all }
undo loopback-detection enable vlan { vlan-id-list | all }
Default
Loop detection is disabled on interfaces.
Views
Layer 2 Ethernet interface view
Layer 2 aggregate interface view
Predefined user roles
network-admin
Parameters
vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN ID or a range of VLAN IDs in the form of vlan-id1 to vlan-id2. The value range for VLAN IDs is 1 to 4094. The ID for vlan-id2 must be no less than the ID for vlan-id1.
all: Specifies all existing VLANs.
Usage guidelines
You can enable loop detection globally or on a per-interface basis. When an interface receives a detection frame in any VLAN, the loop protection action is triggered on that interface, regardless of whether loop detection is enabled on it.
Example
# Enable loop detection on Ten-GigabitEthernet 1/1/11 for VLAN 10 through VLAN 20.
<Sysname> system-view
[Sysname] interface ten-gigabitethernet 1/1/11
[System-Ten-GigabitEthernet1/1/11] loopback-detection enable vlan 10 to 20
display loopback-detection
loopback-detection global enable
loopback-detection global action
Use loopback-detection global action to set the global loop protection action.
Use undo loopback-detection global action to restore the default.
Syntax
loopback-detection global action shutdown
undo loopback-detection global action
Default
When the device detects a loop on an interface, it generates a log but performs no action on the interface.
Views
System view
Predefined user roles
network-admin
Parameters
shutdown: Enables the shutdown mode. If a loop is detected, the device generates a log and shuts down the interface. The device automatically sets the interface to the forwarding state after you set the time interval by using the shutdown-interval command (see Fundamentals Command Reference).
Usage guidelines
To set the loop protection action on a per-interface basis, use the loopback-detection action command in interface view.
The global action applies to all interfaces. An interface-specific action applies only to the interface on which it is configured. On an interface, the interface-specific action takes precedence over the global action.
Example
# Set the global loop protection action to shutdown.
<Sysname> system-view
[System] loopback-detection global action shutdown
Related commands
display loopback-detection
loopback-detection action
loopback-detection global enable
Use loopback-detection global enable to enable loop detection globally.
Use undo loopback-detection global enable to disable loop detection globally.
Syntax
loopback-detection global enable vlan { vlan-id-list | all }
undo loopback-detection global enable vlan { vlan-id-list | all }
Default
Loop detection is globally disabled.
Views
System view
Predefined user roles
network-admin
Parameters
vlan-id-list: Specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN ID or a range of VLAN IDs in the form of vlan-id1 to vlan-id2. The value range for VLAN IDs is 1 to 4094. The ID for vlan-id2 must be equal to or greater than the ID for vlan-id1.
all: Specifies all existing VLANs.
Usage guidelines
You can enable loop detection globally or on a per-interface basis. When an interface receives a detection frame in any VLAN, the loop protection action is triggered on that interface, regardless of whether loop detection is enabled on it.
Example
# Globally enable loop detection for VLAN 10 through VLAN 20.
<Sysname> system-view
[System] loopback-detection global enable vlan 10 to 20
Related commands
display loopback-detection
loopback-detection enable
loopback-detection interval-time
Use loopback-detection interval-time to set the loop detection interval.
Use undo loopback-detection interval-time to restore the default.
Syntax
loopback-detection interval-time interval
undo loopback-detection interval-time
Default
The loop detection interval is 30 seconds.
Views
System view
Predefined user roles
network-admin
Parameters
interval: Sets the loop detection interval in the range of 1 to 300 seconds.
Usage guidelines
With loop detection enabled, the device sends loop detection frames at the specified interval. A shorter interval offers more sensitive detection but consumes more resources. Consider the system performance and loop detection speed when you set the loop detection interval.
Example
# Set the loop detection interval to 10 seconds.
<Sysname> system-view
[Sysname] loopback-detection interval-time 10
Related commands
display loopback-detection