Example for Configuring LBDT to Detect Loopbacks on an Interface
Networking Requirements
As shown in Figure 20-7, 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 GE1/0/0 due to incorrect fiber connection or high voltage damage, SwitchA is required to detect loopbacks on GE1/0/0. 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.
Configuration Roadmap
To detect loopbacks on downlink interface GE1/0/0 of SwitchA, configure LBDT on GE1/0/0 of SwitchA. The configuration roadmap is as follows:
- Enable LBDT on GE1/0/0 of SwitchA to detect loopbacks.
- 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
- Enable LBDT on an interface.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] interface gigabitethernet 1/0/0 [SwitchA-GigabitEthernet1/0/0] loopback-detect enable [SwitchA-GigabitEthernet1/0/0] quit
- Configure an action taken after a loopback is detected
and set the recovery time.
[SwitchA] interface gigabitethernet 1/0/0 [SwitchA-GigabitEthernet1/0/0] loopback-detect action block [SwitchA-GigabitEthernet1/0/0] loopback-detect recovery-time 30 [SwitchA-GigabitEthernet1/0/0] quit
- Verify the configuration.
Run the display loopback-detect command to check the LBDT configuration.
[SwitchA] display loopback-detect Loopback-detect sending-packet interval: 5 (A): Auto Loopback-detect ----------------------------------------------------------------- Interface RecoverTime Action Status ----------------------------------------------------------------- GigabitEthernet1/0/0 30 block NORMAL -----------------------------------------------------------------
The preceding command output shows that the LBDT configuration is successful.
After about 5s, run the display loopback-detect command to check whether GE1/0/0 is blocked.
[SwitchA] display loopback-detect Loopback-detect sending-packet interval: 5 (A): Auto Loopback-detect ----------------------------------------------------------------- Interface RecoverTime Action Status ----------------------------------------------------------------- GigabitEthernet1/0/0 30 block BLOCK -----------------------------------------------------------------
The preceding command output shows that GE1/0/0 is blocked, indicating that a loopback occurs on GE1/0/0.
Manually remove the loopback. Run the display loopback-detect command to check whether GE1/0/0 is restored.
[SwitchA] display loopback-detect Loopback-detect sending-packet interval: 5 (A): Auto Loopback-detect ----------------------------------------------------------------- Interface RecoverTime Action Status ----------------------------------------------------------------- GigabitEthernet1/0/0 30 block NORMAL -----------------------------------------------------------------
The preceding command output shows that GE1/0/0 is restored.