01-20 LBDT Configuration
01-20 LBDT Configuration
Switches
Configuration Guide - Ethernet Switching 20 LBDT Configuration
20 LBDT Configuration
NOTE
LBDT can only detect loops on a single node, but cannot eliminate loops in the same
manner as ring network technologies including ERPS, RRPP, SEP, Smart Link, STP, RSTP,
MSTP, and VBST.
Detection Packet
LBDT periodically sends detection packets on an interface to check whether the
packets return to the local device to determine whether loops occur on the
interface, on the downstream network or device, or between two device interfaces.
The following conditions must be met:
● Detection packets sent from an interface are sent back to the local device
when a loop occurs on an interface, or network connected to the interface.
● The system identifies detection packets sent from the local device, and
detection packets that the interface sends.
Detection packets sent from a device carry the device's MAC address and
outbound interface number. The device can identify the packets sent by itself as
well as the source interface. The packets also carry the broadcast or multicast
destination MAC address to ensure that the packets can be sent back to the local
device when a loop occurs on the interface or network connected to the interface.
Figure 20-1 shows the format of LBDT packets.
DMAC The destination MAC address of a tagged packet is all Fs; the
destination MAC address of an untagged packet is a BPDU MAC
address, broadcast MAC address (all Fs), or multicast MAC
address.
The broadcast destination MAC address, multicast destination
MAC address, or BPDU MAC address ensures that the detection
packet can be sent back to the local device when a loop occurs
on the interface or network connected to the interface.
SMAC Source MAC address. The value is the system MAC address of the
device, which identifies packets sent from the local device.
802.1Q Tag Tag Protocol Identifier (TPID). The value of the TPID is 0x8100,
representing the 802.1Q tagged frame.
LBDT sends both tagged and untagged detection packets, so it can detect loops
based on interfaces and VLANs.
Trap The device only sends a trap to Select this action when only traps
the NMS and records a log. need to be reported without
affecting traffic forwarding on the
interface.
This action cannot suppress
broadcast storms.
Block The device sends a trap to the Select this action when the
NMS, blocks the interface, and interface needs to be disabled
allows only BPDUs to pass from forwarding data packets and
through. needs to forward BPDUs such as
Link Layer Discovery Protocol Data
Units (LLDPDUs).
This action can suppress broadcast
storms.
Shutdo The device sends a trap to the Select this action to prevent
wn NMS and shuts down the broadcast storms when the
interface. interface does not participate in
any calculation or forwarding.
This action can suppress broadcast
storms.
No The device sends a trap to the Select this action when the
learnin NMS and disables the interface interface needs to process data
g from learning new MAC packets and send them to the
addresses. correct link.
This action cannot suppress
broadcast storms.
Quitvl The device sends a trap to the Select this action when loops in a
an NMS and removes the interface VLAN need to be eliminated
from the VLAN where the loop without affecting traffic
occurs. forwarding in other VLANs.
This action can suppress broadcast
storms.
LBDT can only detect loops on a single node, but cannot eliminate loops on the
entire network. After a loop is detected, you are advised to eliminate the loop
immediately.
NOTE
● The interface that is disabled by LBDT cannot be restored after the recovery time.
● After the LBDT action of an interface is changed, the interface is restored. Then the
changed LBDT action is taken when a loop is detected.
● When VLAN-based LBDT is configured on an interface:
● If detection of this VLAN is canceled, the interface is restored automatically.
● If GVRP is not enabled on the interface and the interface is removed from the
VLAN manually, the interface is restored automatically.
● If GVRP is enabled on the interface, the interface is manually removed from the
VLAN or dynamically removed from the VLAN through GVRP, and the action to be
taken is not shutdown, the interface can be restored automatically.
● If GVRP is enabled on the interface, the interface is manually removed from the
VLAN or dynamically removed from the VLAN through GVRP, and the action to be
taken is shutdown, the interface cannot be restored automatically. In the alarm
periodically reported by the device, information about the VLAN where loops are
detected is empty. You must run the shutdown and undo shutdown commands to
manually restore the interface or run the restart command to enable the interface
again.
Tx Rx
You can configure LBDT on the interface of the Switch to detect loopbacks. When
detecting a loopback on the interface, the Switch reports a trap and records a log,
and takes a preconfigured action (such as Shutdown, Block, No learning, or
Quitvlan) on the interface to reduce the impact of the loopback on the Switch.
When the Switch detects that the loopback is eliminated on the interface, the
interface can be restored. However, the interface shut down cannot be restored.
Interface1
Interface1
You can configure LBDT on Interface1 of the Switch to detect whether a loop
occurs on the downstream network or device. When detecting a loop on the
downstream network or device, the Switch reports a trap and records a log, and
takes a preconfigured action (such as Shutdown, Block, No learning, or
Quitvlan) on the interface to reduce the impact of the loop on the Switch. When
the Switch detects that the loop is eliminated on the downstream network or
device, the interface can be restored. However, the interface shut down cannot be
restored.
Switch
Interface1 Interface2
You can configure LBDT on Interface1 and Interface2 of the Switch to detect
whether a loop occurs on the local network or between two device interfaces.
When detecting a loop, the Switch reports a trap and records a log, and takes
preconfigured actions (such as Shutdown, Block, No learning, or Quitvlan) on
Interface1 and Interface2 to reduce the impact of the loop on the Switch. When
the Switch detects that the loop is eliminated on the local network or between
two interfaces, Interface1 or Interface2 can be restored. However, the interface
shut down cannot be restored.
Licensing Requirements
LBDT configuration commands are available only after the S1720GW, S1720GWR,
and S1720X have the license (WEB management to full management Electronic
RTU License) loaded and activated and the switches are restarted. LBDT
configuration commands on other models are not under license control.
For details about how to apply for a license, see S Series Switch License Use
Guide.
Version Requirements
S2710SI V100R006(C03&C05)
S5710-C-LI V200R001C00
S5730SI V200R011C10
S5730S-EI V200R011C10
NOTE
To know details about software mappings, see Hardware Query Tool.
Feature Limitations
● In V200R008C00 and earlier versions, LBDT does not take effect in dynamic
VLANs. In V200R008C00 and later versions, the LBDT-enabled switch can
detect loops in dynamic VLANs, but the Quitvlan action is invalid for dynamic
VLANs.
● LBDT requires that the device should send a large number of detection
packets to detect loops, occupying system resources. Therefore, disable LBDT
if loops do not need to be detected.
● LBDT cannot be configured on an Eth-Trunk or its member interfaces.
● The blocked ports of LBDT cannot block GVRP packets. To ensure that GVRP
runs normally and prevent GVRP loops, do not enable GVRP on the blocked
port of LBDT.
● The S2700SI and S2710SI support only detection of self-loops on an interface,
and do not support detection loops on the downstream device or between
interfaces.
Context
The switch joins VLAN 1 by default, and the PVID of all interfaces is VLAN 1.
When an interface changes from Down to Up, a loop may occur. You can
configure automatic LBDT to detect loops in the VLAN specified by the PVID on an
interface. When the switch is enabled with MAC address flapping detection, if
MAC address flapping is detected in a VLAN, automatic LBDT is triggered to detect
loops in the VLAN.
Procedure
Step 1 Run system-view
NOTE
----End
Follow-up Procedure
To enable LBDT triggered by MAC address flapping, first configure MAC address
flapping detection. For details on how to configure MAC address flapping
detection, see 3.9 Configuring MAC Address Flapping Detection.
By default, global MAC address flapping detection is enabled. The switch detects
MAC address flapping in all VLANs.
NOTE
The quitvlan action that is configured using this command takes effect only in the scenario
where automatic LBDT is triggered to detect a loop between interfaces in the VLAN where
MAC address flapping is detected. The trap action is used in the scenario where automatic
LBDT is triggered to detect a loop on the downstream network or device in the VLAN
where MAC address flapping is detected.
Context
An LBDT-enabled interface sends LBDT packets at intervals. A shorter interval
indicates that the system sends more LBDT packets in a given period and detects
loops more accurately. However, more system resources are consumed and system
performance is affected. You can adjust the interval for sending LBDT packets
according to actual networking to balance system performance and LBDT
accuracy.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run loopback-detect packet-interval packet-interval-time
The interval for sending LBDT packets is set.
By default, the interval for sending LBDT packets is 5s.
----End
Context
An LBDT-enabled interface periodically sends LBDT packets to detect loops. After a
loop is detected, an action configured by the loopback-detect action command is
taken on the interface. In addition, the system counts the time. After the
configured recovery time expires, the system attempts to restore the problematic
interface. If the device does not receive detection packets from the problematic
interface within the next recovery time, it considers that the loop is eliminated on
the interface and restores the interface.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run loopback-detect recovery-time recovery-time
The interface recovery time after a loop is removed is set.
By default, the interface recovery time is three times the interval for sending LBDT
packets.
NOTE
It is recommended that the interface recovery time be three times the packet sending
interval at least. If the packet sending interval has been set to a small value, the interface
recovery time should be at least 10 seconds longer than the packet sending interval.
----End
NOTICE
● LBDT needs to send a large number of LBDT packets to detect loops, occupying
system resources. Therefore, disable LBDT if loops do not need to be detected.
● The blocked ports of LBDT cannot block GVRP packets. To ensure that GVRP
runs normally and prevent GVRP loops, do not enable GVRP on the blocked
port of LBDT.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run the following commands as required.
● Enable LBDT on all interfaces.
Run the loopback-detect enable command to enable LBDT on all interfaces.
When LBDT needs to be configured on most interfaces, perform this
operation. This operation simplifies the configuration.
● Enable LBDT on an interface.
a. Run the interface interface-type interface-number command to enter the
interface view.
b. Run the loopback-detect enable command to enable LBDT on the
interface.
By default, LBDT is disabled on an interface.
Step 3 Run the following commands as required.
If LBDT Detecting Loopbacks on an Interface is required, skip this step.
If Detecting a Loop on the Downstream Network or Device or Detecting a
Loop Between Two Device Interfaces is required, perform this step.
● Configuring LBDT in a specified VLAN
a. Run interface interface-type interface-number
The interface view is displayed.
b. Select either of the following configurations to add the VLAN where
loops need to be detected.
▪ Access interface
1) Run port link-type access
The link type of the interface is configured as access.
▪ Hybrid interface
1) Run port link-type hybrid
The link type of the interface is configured as hybrid.
2) Run port hybrid tagged vlan { { vlan-id1 [ to vlan-
id2 ] }&<1-10> | all } or port hybrid untagged vlan { { vlan-id1
[ to vlan-id2 ] }&<1-10> | all }
The hybrid interface is added to the VLAN where loops need to
be detected.
▪ Trunk interface
1) Run port link-type trunk
The link type of the interface is configured as trunk.
2) Run port trunk allow-pass vlan { { vlan-id1 [ to vlan-
id2 ] }&<1-10> | all }
The trunk interface is added to the VLAN where loops need to
be detected.
c. Run loopback-detect packet vlan { vlan-id1 [ to vlan-id2 ] } &<1-8>
Configure LBDT in a specified VLAN.
By default, LBDT is disabled in a VLAN.
NOTE
– An interface sends tagged LBDT packets only when the specified VLAN has been
created.
– When the PVID of the interface in the loop is the detected VLAN ID or the
interface joins the detected VLAN in untagged mode, VLAN tags of LBDT packets
are removed. As a result, the packet priority changes and the system may fail to
detect loops.
● Configuring the destination MAC address of untagged LBDT packets
Run the loopback-detect untagged mac-address mac-address command to
set the destination MAC address of untagged LBDT packets.
By default, the destination MAC address of untagged LBDT packets is 0180-
C200-000A.
Do not configure the destination MAC address of untagged LBDT packets as
the destination MAC address of other protocols. You are advised to set the
destination MAC address of untagged LBDT packets to a broadcast MAC
address (all Fs).
----End
Context
An LBDT-enabled interface sends LBDT packets at intervals. A shorter interval
indicates that the system sends more LBDT packets in a given period and detects
loops more accurately. However, more system resources are consumed and system
performance is affected. You can adjust the interval for sending LBDT packets
according to actual networking to balance system performance and LBDT
accuracy.
Procedure
Step 1 Run system-view
----End
Context
By default, when a loop on an interface or the network connected to the interface,
the device does not take any action on the interface. In this case, the interface
needs to be shut down to prevent the impact of the loopback on the device and
entire network.
You can preconfigure an action to be taken after LBDT detects a loop. After
detecting a loop, the device takes the preconfigured action on the interface to
prevent the impact of the loop on the device and entire network.
The device provides the following actions after LBDT detects a loop:
● Trap: The device reports a trap to the NMS and records a log, but does not
take any action on the interface.
● Block: The device isolates an interface where a loop occurs from other
interfaces, and can forward only BPDUs.
● No learning: The interface is disabled from learning MAC addresses.
● Shutdown: The device shuts down the interface.
● Quitvlan: The interface is removed from the VLAN where a loop occurs.
For details about the actions, see Action Taken After a Loop Is Detected. You can
configure one of the actions according to actual networking.
Procedure
Step 1 Run system-view
NOTE
● When the Quitvlan action is used, the configuration file remains unchanged.
● The LBDT action and MAC address flapping action affect each other, and cannot be
configured simultaneously.
● The Quitvlan action of LBDT conflicts with dynamic removal from VLANs (for example,
GVRP and HVRP), and cannot be configured simultaneously.
----End
Context
An LBDT-enabled interface periodically sends LBDT packets to detect loops. After a
loop is detected, an action configured by the loopback-detect action command is
taken on the interface. In addition, the system counts the time. After the
configured recovery time expires, the system attempts to restore the problematic
interface. If the device does not receive detection packets from the problematic
interface within the next recovery time, it considers that the loop is eliminated on
the interface and restores the interface.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run loopback-detect recovery-time recovery-time
The interface recovery time after a loop is removed is set.
By default, the interface recovery time is three times the interval for sending LBDT
packets.
NOTE
● It is recommended that the interface recovery time be three times the packet sending
interval at least. If the packet sending interval has been set to a small value, the
interface recovery time should be at least 10 seconds longer than the packet sending
interval.
● Automatic recovery is valid for Trap, Quitvlan, Block, and No learning. After a loop is
eliminated, the shutdown interface cannot be restored automatically. You must run the
shutdown and undo shutdown commands or run the restart command to restore the
interface.
----End
Procedure
● Run the display loopback-detect command to check the LBDT configuration
and status of LBDT-enabled interfaces.
----End
Networking Requirements
As shown in Figure 20-5, aggregation switch SwitchA on an enterprise network
connects to a new access switch SwitchB. To prevent a loopback from occurring
between the Tx and Rx ends of GE0/0/1 due to incorrect fiber connection or high
voltage damage, SwitchA is required to detect loopbacks on GE0/0/1. Furthermore,
it is required that the interface be blocked to reduce the impact of the loopback
on the network when a loopback is detected, and the interface be restored after
the loopback is removed.
GE0/0/1
Tx Rx
GE0/0/1
SwitchB
Configuration Roadmap
To detect loopbacks on downlink interface GE0/0/1 of SwitchA, configure LBDT on
GE0/0/1 of SwitchA. The configuration roadmap is as follows:
1. Enable LBDT on GE0/0/1 of SwitchA to detect loopbacks.
2. Configure an action taken after a loopback is detected and set the recovery
time. After a loopback is detected, the system blocks the interface to reduce
the impact of the loopback on the network. After a loop is eliminated, the
system restores the interface.
Procedure
Step 1 Enable LBDT on an interface.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] loopback-detect enable
[SwitchA-GigabitEthernet0/0/1] quit
Step 2 Configure an action taken after a loopback is detected and set the recovery time.
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] loopback-detect action block
[SwitchA-GigabitEthernet0/0/1] loopback-detect recovery-time 30
[SwitchA-GigabitEthernet0/0/1] quit
----End
Configuration Files
SwitchA configuration file
#
sysname SwitchA
#
interface GigabitEthernet0/0/1
loopback-detect recovery-time 30
loopback-detect enable
loopback-detect action block
#
return
Networking Requirements
As shown in Figure 20-6, a new department of an enterprise connects to
aggregation switch Switch, and this department belongs to VLAN 100. Loops may
occur due to incorrect connections or configurations. As a result, communication
on the Switch and uplink network may be affected.
It is required that the Switch should detect loops on the new network to prevent
the impact of loops on the Switch and connected network.
Figure 20-6 Networking for configuring LBDT to detect loops on the downstream
network
Switch
GE0/0/1
New department
VLAN 100
Configuration Roadmap
The new department network has only VLAN 100, so configure LBDT on the
Switch to detect loops. The configuration roadmap is as follows:
1. Enable LBDT on the GE0/0/1 of the Switch to detect loops in a specified VLAN
so that loops on the downstream network can be detected.
2. Set LBDT parameters so that the Switch can immediately shut down GE0/0/1
after a loop is detected. This prevents the impact of the loop on the Switch
and connected network.
NOTE
Procedure
Step 1 Enable LBDT on the interface.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] loopback-detect enable
[Switch-GigabitEthernet0/0/1] quit
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
vlan batch 100
#
loopback-detect packet-interval 10
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid tagged vlan 100
loopback-detect packet vlan 100
loopback-detect enable
#
return
Networking Requirements
As shown in Figure 20-7, a small-scale enterprise uses Layer 2 networking and
belongs to VLAN 100. Because employees often move, the network topology
changes frequently. Loops may occur due to incorrect connections or
configurations during the change. As a result, broadcast storms may occur and
affect communication of the Switch and entire network.
The requirements are as follows: The Switch detects loops. When a loop exists, the
interface is blocked to reduce the impact of the loop on the Switch and network.
When the loop is eliminated, the interface can be restored.
Figure 20-7 Networking for configuring LBDT to detect loops on the local network
Switch
GE0/0/1 GE0/0/2
VLAN 100
Configuration Roadmap
To detect loops on the network where the Switch is deployed, configure LBDT on
GE0/0/1 and GE0/0/2 of the Switch. In this example, untagged LBDT packets sent
by the Switch will be discarded by other switches on the network. As a result, the
packets cannot be sent back to the Switch, and LBDT fails. Therefore, LBDT is
configured in a specified VLAN. The configuration roadmap is as follows:
1. Enable LBDT on an interface and configure the Switch to detect loops in
VLAN 100 to implement LBDT on the network where the Switch is deployed.
2. Configure an action taken after a loop is detected and set the recovery time.
After a loop is detected, the Switch blocks the interface to reduce the impact
of the loop on the network. After a loop is eliminated, the Switch restores the
interface.
NOTE
Procedure
Step 1 Enable LBDT on an interface.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] loopback-detect enable
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] loopback-detect enable
[Switch-GigabitEthernet0/0/2] quit
Step 3 Configure an action taken after a loop is detected and set the recovery time.
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] loopback-detect action block
[Switch-GigabitEthernet0/0/1] loopback-detect recovery-time 30
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] loopback-detect action block
[Switch-GigabitEthernet0/0/2] loopback-detect recovery-time 30
[Switch-GigabitEthernet0/0/2] quit
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
vlan batch 100
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid tagged vlan 100
loopback-detect recovery-time 30
loopback-detect packet vlan 100
loopback-detect enable
loopback-detect action block
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid tagged vlan 100
loopback-detect recovery-time 30
loopback-detect packet vlan 100
loopback-detect enable
loopback-detect action block
#
return