Configuring Port Loopback Detection

Loop detection is disabled by default. Loop detection can be enabled on a physical port or on a VLAN.
  1. Enter the global configuration mode.
    device# configure terminal
  2. Enable loop detection on a physical port (strict mode) or on a VLAN (loose mode).
    device(config)# interface 1/1/1
    device(config-if-e1000-1/1/1)# loop-detection
    device(config)# vlan 10
    device(config-vlan-10)# loop-detection
  3. Exit the interface or VLAN configuration mode and enter the global configuration mode.
    device(config-if-e10000-1/1/1)# exit
    device(config-vlan-10)# exit
  4. Set global loop detection interval.
    device(config)# loop-detection-interval 50

    When loop detection is enabled, the loop detection time unit is 0.1 second, with a default of 10 (one second). The loop detection interval ranges from 1 (one tenth of a second) through 300 (30 seconds). In the example, loop-detection-interval is set to 5 seconds (50 x 0.1).

  5. Configure the device to automatically re-enable ports that were disabled due to loop detection.
    device(config)# errdisable recovery cause loop-detection
  6. Specify the recovery time interval.
    device(config)# errdisable recovery interval 120

    By default, the device will wait for 300 seconds before re-enabling the ports. You can optionally change this interval to a value from 10 through 65535 seconds. In the example, the device is configured to wait for 120 seconds (2 minutes) before re-enabling the ports.

  7. Clear loop detection statistics.
    device# clear loop-detection
    The clear loop-detection command clears the loop detection statistics and re-enables all the ports that are in Err-Disable state because of loop detection.

The following example shows how to enable loop detection on a port, 1/1/1.

device# configure terminal
device(config)# interface 1/1/1
device(config-if-e1000-1/1/1)# loop-detection
device(config-if-e10000-1/1/1)# exit
device(config)# loop-detection-interval 50
device(config)# errdisable recovery interval 120

The following example shows how to enable loop detection on a VLAN, VLAN-10.

device# configure terminal
device(config)# vlan 10
device(config-vlan-10)# loop-detection
device(config-vlan-10)# exit
device(config)# loop-detection-interval 50
device(config)# errdisable recovery interval 120