As shown in Figure 1, 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.
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:
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] loopback-detect enable [SwitchA-GigabitEthernet0/0/1] quit
[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
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 ----------------------------------------------------------------- GigabitEthernet0/0/1 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 GE0/0/1 is blocked.
[SwitchA] display loopback-detect Loopback-detect sending-packet interval: 5 (A): Auto Loopback-detect ----------------------------------------------------------------- Interface RecoverTime Action Status ----------------------------------------------------------------- GigabitEthernet0/0/1 30 block BLOCK -----------------------------------------------------------------
The preceding command output shows that GE0/0/1 is blocked, indicating that a loopback occurs on GE0/0/1.
Manually remove the loopback. Run the display loopback-detect command to check whether GE0/0/1 is restored.
[SwitchA] display loopback-detect Loopback-detect sending-packet interval: 5 (A): Auto Loopback-detect ----------------------------------------------------------------- Interface RecoverTime Action Status ----------------------------------------------------------------- GigabitEthernet0/0/1 30 block NORMAL -----------------------------------------------------------------
The preceding command output shows that GE0/0/1 is restored.