Configuring an Action Taken After a Loop Is Detected
Context
By default, when a loop on an interface or the network connected to the interface, the device does not take any action. To notify users of network connections and configurations when a loop occurs on an interface, and minimize the impact of loops on the device and entire network, configure an action taken on the problematic interface.
- Trap: The device reports a trap to the NMS and records a log, but does not take any action on the interface.
- Block: The device isolates an interface where a loop occurs from other interfaces, and can forward only BPDUs.
- No learning: The interface is disabled from learning MAC addresses.
- Shutdown: The device shuts down the interface.
- Quitvlan: The interface is removed from the VLAN where a loop occurs.
For details about the actions, see Action Taken After a Loop Is Detected. You can configure one of the actions according to actual networking.
Procedure
- Run:
system-view
The system view is displayed.
- Run:
snmp-agent trap enable
Or, run:
snmp-agent trap enable feature-name ldttrap
The trap function is enabled for LDT. This function allows the device to send traps of LDT.
By default, the trap function is disabled for LDT.
- Run:
interface interface-type interface-number
The interface view is displayed.
- Run:
loop-detection mode { port-trap | port-blocking | port-nolearning | port-shutdown | port-quitvlan }
An action taken after a loop is detected is configured.
By default, an interface is shut down after LDT detects a loop.
When a loop occurs on the network-side interface where the block or shutdown action is configured, all services on the device are interrupted. Do not deploy LDT on the network-side interface.
- The Quitvlan action cannot be used with such functions as GVRP and the function of removing an interface from the VLAN where MAC address flapping occurs. These functions dynamically delete an interface from a VLAN.