Applicable Scenario
LDT and LBDT can be used to detect loopbacks on an interface, a loop on the downstream network or device or a loop between two device interfaces. LBDT can detect loops based on VLANs and interfaces, whereas LDT can detect loops based on VLANs only. LDT can detect loops in a maximum of 4094 VLANs, whereas LBDT can detect loops in a maximum of eight VLANs.
Automatic loop detection is enabled in the VLAN specified by the PVID on an interface by default.
Detecting Loopbacks on an Interface
Figure 20-2 shows a loopback on an interface of the Switch. During network deployment, incorrect fiber connection or high voltage damage on the interface causes loopbacks to occur between the Tx (transmit end) and Rx (receive end) ends of an interface. Packets sent from one interface are forwarded back to the same interface, resulting in possible traffic forwarding errors or MAC address flapping on the interface.
You can configure LDT or 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 by LBDT cannot be restored.
Detecting a Loop on the Downstream Network or Device
Figure 20-3 shows two network examples whereas a loop is detected on a downstream network or device connected to the Switch. Packets sent from Interface1 that pass through the downstream network or device are sent back to Interface1.
You can configure LDT or 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 by LBDT cannot be restored.
Detecting a Loop Between Two Device Interfaces
As shown in Figure 20-4, a loop occurs on the network where the Switch resides. Packets sent from Interface1 are forwarded by devices on other networks and looped back to Interface2.
You can configure LDT or 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 by LBDT cannot be restored.
Automatically Detecting Loops in the VLAN Specified by the PVID on an Interface
The switch joins VLAN 1 by default, and the PVID of all interfaces is VLAN 1. When the interface changes from Down to Up, a loop may occur. You can configure the switch to automatically detect loops in the VLAN specified by the PVID on an interface.
By default, the switch is configured to automatically detect loops in the VLAN specified by the PVID on an interface. You can run the loopback-detect auto disable command to disable automatic loop detection.