3.13. Configuring Loopback Detection
Overview
Function Introduction
The loopback in the networks would cause the device continued to send broadcast, multicast and unknow unicast packets. It will waste the resource of network even paralysis the whole network. To detect the loopback in the layer 2 network rapidly and avoid to effect the whole network, system need to provide a detection function to notice the userchecking the network connection and configuration, and control the error interface when the network appears loopback.
Loopback Detection can detects whether the interface of device exists loopback. When enable loopback detection on a interface, device will send detection packets from this interface by periodically. If the device receives detection packets sent from the interface, this interface is considered that there is a loop existed and the device can send alarm information to network management system. Administraitors discover loopback problem througt alarm information and resolve the problem to avoid longtime network abnormal. In addition, the device can control the specific interface and configured Trap according the requirement, and disable the interface to quickly reduce the impact in the network of loopback to the minimum.
Principle Description
N/A
Configuration
Enable Loopback Detect
step 1 Enter the configure mode
Switch# configure terminal
step 2 Enter the interface configure mode, and enable Loopback Detect
Switch(config)# interface eth-0-1
Switch(config-if)# loopback-detect enable
step 3 Exit the configure mode
Switch(config-if)# end
step 4 Validation
By default, loopback detection is disable. When the interface enable loopback detection, system send the detection packets to detect the loopback. Default detection packets transmission interval is 5 second.
Use the following command to display the loopback detection states
Switch# show loopback-detect
Loopback detection packet interval(second): 5
Loopback detection recovery time(second): 15
Interface Action Status
eth-0-2 shutdown NORMAL
Configuring Loopback Detect packet interval
The network is changing all the time, therefor the loopback detection is an continued process. The interface sent loopback detection packets in a certain interval of time, the packets transimission time is loopback detection packets sending period.
The device send the lopback detection packets time interval range is 1 to 300 seconds.The loopback status recover period default is 3 times of the interface send interval.
step 1 Enter the configure mode
Switch# configure terminal
step 2 set the packet interval of Loopback Detect
Switch(config)# loopback-detect packet-interval 10
step 3 Exit the configure mode
Switch(config)# end
step 4 Validation
Use the following command to display the packet interval of Loopback Detect:
Switch# show loopback-detect packet-interval
Loopback detection packet interval(second): 10
Configuring Loopback Detect action
If a loopback is detected on the interface and loopback is enabled on this interfac, the system can configure an action to send alarm, shutdown the interface, block the interface or other action.
After loopback detection is enabled on an interface, the interface sends loopback detection packets at intervals. When a loopback is detected on the interface, the system performs an action to minimize the impact on the entire network.
step 1 Enter the configure mode
Switch# configure terminal
step 2 Enter the interface configure mode, and set the action of Loopback Detect
Switch(config)# interface eth-0-1
Switch(config-if)# loopback-detect action shutdown
step 3 Exit the configure mode
Switch(config)# end
step 4 Validation
Use the following command to display the information of Loopback Detect on the interface:
Switch# show loopback-detect interface eth-0-1
Interface Action Status
eth-0-1 shutdown NORMAL
Configuring specify VLAN Loopback Detection
Specify the VLAN IDs of loopback detection packets on an interface After loopback detection is enabled on an interface, system send untagged loopback detection packets by default. It means the device dosen’t detect any specify vlan loopback packets. When interface is configured Tagged mode in vlan, the loopback detection packets sent by this interface will be discard on the link, and interface won’t receive the loop packets which is sent by itself. So we should specify the VLAN IDs of loopback detection packets on an interface.
After the loopback-detect packet vlan command is executed on an interface, the interface sends an untagged loopback detection packet and the loopback detection packets with the specified VLAN tags. The specified VLANs exist and the interface has been added to the VLANs in tagged mode. If you run the loopback-detect packet vlan command multiple times in the same interface view, multiple VLAN IDs are specified. You can specify a maximum of eight VLAN IDs
step 1 Enter the configure mode
Switch# configure terminal
step 2 Enter the interface configure mode, and set the specify vlan of Loopback Detect
Switch(config)# interface eth-0-1
Switch(config-if)# loopback-detect packet vlan 20
step 3 Exit the configure mode
Switch(config-if)# end
step 4 Validation
Use the following command to display the configuration of Loopback Detect:
Switch# show running-config interface eth-0-1
Building configuration...
!
interface eth-0-1
loopback-detect enable
loopback-detect packet vlan 20
!
Application cases
N/A