- Table of Contents
-
- 03-Layer 2—LAN Switching Command Reference
- 00-Preface
- 01-MAC address table commands
- 02-Bulk interface commands
- 03-Ethernet interface commands
- 04-Ethernet link aggregation commands
- 05-M-LAG commands
- 06-Port isolation commands
- 07-VLAN commands
- 08-MVRP commands
- 09-Loopback, null, and inloopback interface commands
- 10-QinQ commands
- 11-VLAN mapping commands
- 12-Loop detection commands
- 13-Spanning tree commands
- 14-LLDP commands
- 15-L2PT commands
- 16-Service loopback group commands
- 17-Layer 2 forwarding commands
- Related Documents
-
Title | Size | Download |
---|---|---|
12-Loop detection commands | 135.14 KB |
Contents
loopback-detection delay-timer
loopback-detection global action
loopback-detection delay-timer
loopback-detection global enable
loopback-detection interval-time
loopback-detection protected-vlan
loopback-detection enable s-vid c-vid
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 [ loop-info ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
loop-info: Displays only information about ports where loops have been detected. If you do not specify this keyword, the command will also display information about the ports shut down by loop detection. A port shut down by loop detection stays in looped state until it comes up.
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:
Interface Action mode VLANs/VSI
HundredGigE1/0/2 Shutdown 5
HundredGigE1/0/3 None 10
HundredGigE1/0/4 VLAN-block 20
# Display only information about ports where loops have been detected.
<Sysname> display loopback-detection loop-info
Loop detection is enabled.
Global loop detection interval is 30 second(s).
Loop is detected on following interfaces:
Interface Action mode VLANs/VSI
HundredGigE1/0/3 None 10
HundredGigE1/0/4 VLAN-block 20
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). · VLAN-block—When a loop is detected in a protected VLAN on an interface, the device generates a log and blocks the traffic from the protected VLAN on all interfaces configured with this action. |
VLANs/VSI |
VLANs or VSI to which the interface belongs and 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
loopback-detection action { block | no-learning | shutdown | vlan-block }
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.
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 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).
vlan-block: Enables the VLAN-block mode. If a loop is detected in a protected VLAN on an interface, the device generates a log and blocks traffic from the protected VLAN on all interfaces in this mode.
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.
On an interface, the VLAN-block mode is mutually exclusive with spanning tree, RRPP, ERPS, and Smart Link.
Example
# Set the loop protection action to shutdown on HundredGigE 1/0/1.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/1
[System-HundredGigE1/0/1] loopback-detection action shutdown
display loopback-detection
loopback-detection global action
loopback-detection delay-timer
Use loopback-detection delay-timer to set the loop protection delay timer on an interface.
Use undo loopback-detection delay-timer to disable loop protection delay on an interface.
Syntax
loopback-detection delay-timer time
undo loopback-detection delay-timer
Default
Loop protection delay is disabled on an interface.
Views
Layer 2 Ethernet interface view
Layer 2 aggregate interface view
Predefined user roles
network-admin
Parameters
time: Sets the loop protection delay timer, in seconds. The value range for this argument is 1 to 1000.
Usage guidelines
On a network protected by loop detection, the shutdown or block action taken on a looped interface of an upstream device might cause traffic interruption to its downstream devices. To minimize the impacts of loop detection on downstream traffic, set the loop protection delay timer on upstream devices. This delay allows the downstream devices to remove loops before the upstream devices take an action.
The global delay timer applies to all interfaces enabled with loop detection. An interface-specific delay timer applies only to the interface on which it is configured. On an interface, the interface-specific delay timer takes precedence over the global delay timer.
Example
# Set the loop protection delay timer to 100 seconds on HundredGigE 1/0/1.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/1
[System-HundredGigE1/0/1] loopback-detection delay-timer 100
Related commands
loopback-detection global delay-timer
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 HundredGigE 1/0/1 for VLAN 10 through VLAN 20.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/1
[System-HundredGigE1/0/1] 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 delay-timer
Use loopback-detection delay-timer to set the global loop protection delay timer.
Use undo loopback-detection delay-timer to disable loop protection delay globally.
Syntax
loopback-detection delay-timer time
undo loopback-detection delay-timer
Default
Loop protection delay is disabled on globally.
Views
System view
Predefined user roles
network-admin
Parameters
time: Sets the loop protection delay timer, in seconds. The value range for this argument is 1 to 1000.
Usage guidelines
On a network protected by loop detection, the shutdown or block action taken on a looped interface of an upstream device might cause traffic interruption to its downstream devices. To minimize the impacts of loop detection on downstream traffic, set the loop protection delay timer on upstream devices. This delay allows the downstream devices to remove loops before the upstream devices take an action.
The global delay timer applies to all interfaces enabled with loop detection. An interface-specific delay timer applies only to the interface on which it is configured. On an interface, the interface-specific delay timer takes precedence over the global delay timer.
Example
# Set the global loop protection delay timer to 100 seconds.
<Sysname> system-view
[Sysname] loopback-detection global delay-timer 100
Related commands
loopback-detection delay-timer
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
loopback-detection protected-vlan
Use loopback-detection protected-vlan to configure protected VLANs.
Use undo loopback-detection protected-vlan to delete protected VLANs.
Views
loopback-detection protected-vlan vlan-id-list
undo loopback-detection protected-vlan vlan-id-list
Default
No protected VLANs are configured for loop detection.
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 format of vlan-id1 to vlan-id2. The end VLAN ID must be greater than the start VLAN ID. The value range for VLAN IDs is 1 to 4094.
Usage guidelines
The loopback-detection protected-vlan, instance, and stp vlan enable commands are mutually exclusive with one another. For more information about the instance and stp vlan enable commands, see "Spanning tree commands."
After you configure protected VLANs, you cannot change the spanning tree mode between PVST and any other mode.
Example
# Configure VLAN 100 as a protected VLAN.
<Sysname> system-view
[Sysname] loopback-detection protected-vlan 100
Related commands
instance
loopback-detection action
stp mode
stp vlan enable
VXLAN loop detection commands
display loopback-detection
Use display loopback-detection to display the loop detection configuration and status.
Syntax
display loopback-detection [ loop-info ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
loop-info: Displays only information about ACs where loops have been detected. If you do not specify this keyword, the command will also display information about the ACs shut down by loop detection.
Example
# Display the loop detection configuration and status.
<Sysname> display loopback-detection
Loop detection is enable.
Global loop detection interval is 30 second(s).
Loop is detected on following interfaces:
* indicates the loop protection action was not triggered.
# indicates the loop protection action failed.
Interface Action mode VLANs/VSI
HundredGigE1/0/1 srv100 None vsi1
HundredGigE1/0/2 srv100 Block* vsi2
HundredGigE1/0/3 srv100 Block# vsi3
HundredGigE1/0/1 srv200 Shutdown vsi4
HundredGigE1/0/2 srv200 Shutdown* vsi5
# Display only information about ACs where loops have been detected.
<Sysname> display loopback-detection loop-info
Loop detection is enable.
Global loop detection interval is 30 second(s).
Loop is detected on following interfaces:
* indicates the loop protection action was not triggered.
# indicates the loop protection action failed.
Interface Action mode VLAN/VSI
HundredGigE1/0/1 srv100 None vsi1
HundredGigE1/0/2 srv100 Block* vsi2
HundredGigE1/0/3 srv100 Block# vsi3
Table 2 Command output
Field |
Description |
Action mode |
Loop protection action: · Block—When a loop is detected on an interface, the device generates a log, disables the interface from learning MAC addresses, and blocks the interface. An asterisk (*) indicates that the block action is not triggered because the loop detection priority of the AC on the interface is higher than that in received loop detection frames. A pound sign (#) indicates that the system failed to execute the block action. · None—When a loop is detected on an interface, the device generates a log but performs no action on the interface. · Shutdown—When a loop is detected on an interface, the device generates a log, shuts down the interface to disable it from receiving or sending frames. An asterisk (*) indicates that the shutdown action is not triggered because the loop detection priority of the AC on the interface is higher than that in received loop detection frames. No marker carried indicates that the current AC triggers the loop protection action and the interface where the AC resides is shut down. |
VLANs/VSI |
VLANs or VSI to which the interface belongs and where loops are detected. |
loopback-detection action
Use loopback-detection action to set the loop protection action on a per-VSI basis.
Use undo loopback-detection action to restore the default.
Syntax
loopback-detection action { block | shutdown }
undo loopback-detection action
Default
When the device detects a loop on an AC, it generates a log but performs no action on the AC.
Views
VSI view
Predefined user roles
network-admin
Parameters
block: Enables the block mode. If a loop is detected on an AC whose loop detection priority is lower than that in received loop detection frames, the device performs the following operations:
· Generates a log.
· Disables MAC address learning on the AC.
· Blocks the AC.
shutdown: Enables the shutdown mode. If a loop is detected on an AC whose loop detection priority is lower than that in received loop detection frames, the device generates a log and shuts down the interface where the AC resides to disable it from receiving or sending frames. The device automatically sets the interface to the forwarding state after the time interval set by using the shutdown-interval command.
Usage guidelines
The global loop detection action does not take effect on VSIs.
Example
# Set the loop protection action to block on VSI vsi1.
<Sysname> system-view
[Sysname] l2vpn enable
[Sysname] vsi vsi1
[Sysname-vsi-vsi1] loopback-detection action block
Related commands
display loopback-detection
shutdown-interval (Fundamentals Command Reference)
loopback-detection enable
Use loopback-detection enable to enable single-tagged loop detection on a VSI.
Use undo loopback-detection enable to disable single-tagged loop detection on a VSI.
Syntax
loopback-detection enable [ vlan vlan-id-list ]
undo loopback-detection enable [ vlan vlan-id-list ]
Default
Loop detection is disabled on VSIs.
Views
VSI view
Predefined user roles
network-admin
Parameters
vlan 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 value for vlan-id2 cannot be smaller than the value for vlan-id1. If you do not specify any VLAN IDs, each AC of the VSI sends loop detection frames tagged with the VLAN IDs that the AC matches.
Usage guidelines
This command enables the ACs of a VSI to send loop detection frames with one layer of VLAN tags or without VLAN tags.
If you execute this command multiple times for a VSI, all specified VLAN IDs take effect.
This command is mutually exclusive with the loopback-detection enable s-vid c-vid command. Do not use them together on a VSI.
Do not execute both the loopback-detection enable and loopback-detection enable vlan vlan-id-list commands on a VSI.
Example
# Enable single-tagged loop detection on VSI vsi1.
<Sysname> system-view
[Sysname] l2vpn enable
[Sysname] vsi vsi1
[Sysname-vsi-vsi1] loopback-detection enable
Related commands
display loopback-detection
loopback-detection enable s-vid c-vid
loopback-detection priority
loopback-detection enable s-vid c-vid
Use loopback-detection enable s-vid c-vid to enable double-tagged loop detection on a VSI.
Use undo loopback-detection enable s-vid c-vid to disable double-tagged loop detection on a VSI.
Syntax
loopback-detection enable s-vid vlan-id-list c-vid vlan-id-list
undo loopback-detection enable s-vid vlan-id-list c-vid vlan-id-list
Default
Loop detection is disabled on interfaces.
Views
VSI view
Predefined user roles
network-admin
Parameters
s-vid: Specifies SVLAN IDs.
c-vid: Specifies CVLAN IDs.
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 value for vlan-id2 cannot be smaller than the value for vlan-id1.
Usage guidelines
This command enables the ACs of a VSI to send loop detection frames with two layers of VLAN tags. The VLAN tags of the loop detection frames are all combinations of the specified CVLANs and SVLANs. For example, if you execute the loopback-detetion enable s-vid 2 to 3 c-vid 5 to 6 command for a VSI, the ACs of the VSI send loop detection frames tagged with the following VLAN IDs:
· SVLAN ID 2 and CVLAN ID 5.
· SVLAN ID 2 and CVLAN ID 6.
· SVLAN ID 3 and CVLAN ID 5.
· SVLAN ID 3 and CVLAN ID 6.
If you execute this command multiple times for a VSI, all specified VLAN IDs take effect.
This command is mutually exclusive with the loopback-detection enable command. Do not use them together on a VSI.
You can use the undo loopback-detection enable s-vid c-vid command to remove CVLAN and SVLAN IDs for double-tagged loop detection on a VSI. If you specify a CVLAN or SVLAN ID not in the CVLAN or SVLAN list, the system ignores your operation. If you remove all CVLAN and SVLAN IDs, the system disables double-tagged loop detection on the VSI.
Example
# Enable double-tagged loop detection on VSI vsi2. Specify the SVLANs as VLANs 5 through 10 and CVLANs as VLANs 10 through 20.
<Sysname> system-view
[Sysname] l2vpn enable
[Sysname] vsi vsi2
[Sysname-vsi-vsi2] loopback-detetion enable s-vid 5 to 10 c-vid 10 to 20
Related commands
display loopback-detection
loopback-detection enable
loopback-detection priority
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
VSI view
Predefined user roles
network-admin
Parameters
interval: Sets the loop detection interval in the range of 1 to 32768 seconds.
Usage guidelines
The global loop detection interval does not take effect on VSIs.
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 on VSI vsi1.
<Sysname> system-view
[Sysname] l2vpn enable
[Sysname] vsi vsi1
[Sysname-vsi-vsi1] loopback-detetion interval-time 10
Related commands
display loopback-detection
loopback-detection priority
Use loopback-detection priority to set the priority value in the loop detection priority of a VSI.
Use undo loopback-detection priority to restore the default.
Syntax
loopback-detection priority priority
undo loopback-detection priority
Default
The priority value is 7 in the loop detection priority of a VSI.
Views
VSI view
Predefined user roles
network-admin
Parameters
priority: Sets the priority value in the range of 1 to 7. The smaller the value, the higher the priority.
Usage guidelines
The loop detection frames sent by an AC carry the loop detection priority of the VSI mapped to the AC. The loop detection priority of a frame contains the priority value, the bridge MAC address, and the AC's link ID. When an AC receives a loop detection frame, it compares its own loop detection priority with that in the frame to identify whether a loop exists. If the loop detection priority in the frame is higher, a loop exists and the loop protection action is triggered. If the loop detection priority of the AC is higher, the system only records the loop information.
An AC uses the following procedure to compare its loop detection priority with that in an incoming loop detection frame:
1. Compares the priority values. The smaller the value, the higher the priority.
2. Compares the bridge MAC addresses if the priority values are the same. A lower bridge MAC address has a higher priority.
3. Compares the link IDs if the bridge MAC addresses are the same, which indicates the loop detection frame is sent by another AC of the device. A smaller link ID has a higher priority.
Example
# Set the priority value in the loop detection priority to 3 on VSI vsi1.
<Sysname> system-view
[Sysname] l2vpn enable
[Sysname] vsi vsi1
[Sysname-vsi-vsi1] loopback-detetion priority 3
Related commands
display loopback-detection