After loopback detection is enabled on an interface, the interface sends a loopback detection packet every 5s by default. If a loopback detection packet is sent back to the interface, there is a loopback on the interface, indicating that a loop occurs on the network connected to the interface. Then the interface switches to the loopback detection state. The interface automatically restores to the previous status three detection intervals after the loop is removed.
You can configure the action performed on an interface when a loopback is detected, as shown in the following table.
Action | Description |
Trap | Sends a trap. |
Block | Sends a trap and blocks the interface. The interface can be unblocked automatically. |
Shutdown | Sends a trap and shuts down the interface. The interface needs to be started manually. |
Nolearning | Sends a trap and disables MAC address learning on the interface. MAC address learning can be re-enabled automatically. |
After loopback detection is enabled on an interface, the interface sends untagged loopback detection packets by default. You can configure the interface to send loopback detection packets of a specified VLAN.
Various interfaces send loopback detection packets as follows:
Access interfaces and dot1q tunnel interfaces can send only untagged loopback detection packets.
Trunk interfaces and hybrid interfaces can send both untagged and tagged loopback detection packets. If a VLAN is specified on a trunk or hybrid interface, the interface sends loopback detection packets with the specified VLAN tag. A maximum of eight VLANs can be specified on an interface. If an interface does not belong to the specified VLAN, the interface does not send loopback detection packets with the specified VLAN tag. If no VLAN is specified on an interface, the interface sends untagged loopback detection packets.
Loopback detection cannot be configured on an Eth-Trunk or its member interfaces.




