As shown in Figure 1, 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.
The new department network has only VLAN 100, so configure LBDT on the Switch to detect loops. The configuration roadmap is as follows:
Configure interfaces on other switching interfaces as trunk or hybrid interfaces and configure these interfaces to allow packets from VLANs to pass through to ensure Layer 2 connectivity on the new network and between the new network and the Switch.
<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] vlan 100 [Switch-vlan100] quit [Switch] interface gigabitethernet 0/0/1 [Switch-GigabitEthernet0/0/1] port link-type hybrid [Switch-GigabitEthernet0/0/1] port hybrid tagged vlan 100 [Switch-GigabitEthernet0/0/1] loopback-detect packet vlan 100 [Switch-GigabitEthernet0/0/1] quit
# Set the interval for sending LBDT packets.
[Switch] loopback-detect packet-interval 10
# Configure an action taken after a loop is detected.
[Switch] interface gigabitethernet 0/0/1 [Switch-GigabitEthernet0/0/1] loopback-detect action shutdown [Switch-GigabitEthernet0/0/1] quit
Run the display loopback-detect command to check the LBDT configuration.
[Switch] display loopback-detect Loopback-detect sending-packet interval: 10 (A): Auto Loopback-detect ----------------------------------------------------------------- Interface RecoverTime Action Status ----------------------------------------------------------------- GigabitEthernet0/0/1 30 shutdown NORMAL -----------------------------------------------------------------
The preceding command output shows that the LBDT configuration is successful.
Construct loops on the downstream network and run the display loopback-detect command to check whether GE0/0/1 is shut down.
[Switch] display loopback-detect Loopback-detect sending-packet interval: 10 (A): Auto Loopback-detect ----------------------------------------------------------------- Interface RecoverTime Action Status ----------------------------------------------------------------- GigabitEthernet0/0/1 30 shutdown SHUTDOWN -----------------------------------------------------------------
The preceding command output shows that GE0/0/1 is shut down.