3.13. Loopback Detection Commands

3.13.1. loopback-detect enable

Command Purpose

Using the loopback-detect enable command, you can enable loopback detection on an interface.

Using the no loopback-detect enable command, you can disable loopback detection on an interface. By default, loopback detection is disabled on an interface.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

loopback-detect enable

no loopback-detect enable

Command Mode

Interface Configuration

Default

Disable

Usage

The loopback-detect enable command enables loopback detection on an interface. This function enables the system to detect a loopback on the interface quickly and minimizes impact of the loopback on the entire network. After loopback detection is enabled on an interface, the interface sends loopback detection packets at intervals. Loopback detection occupies CPU resources; therefore, disable this function when it is not required.

Examples

This example shows how to enable loopback detect on port eth-0-1:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# loopback-detect enable

3.13.2. loopback-detect packet-interval

Command Purpose

Using the loopback-detect packet-interval command, you can set the interval for sending loopback detection packets on all interfaces.

Using the no loopback-detect packet-interval command, you can restore the default interval for sending loopback detection packets on all interfaces.

By default, the interval for sending loopback detection packets is 5s

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

loopback-detect packet-interval INTERVAL

no loopback-detect packet-interval

Parameter

Parameter Description

Parameter Value

INTERVAL

loopback detect packet send interval

1-300, unit:second

Command Mode

Global Config

Default

5 seconds

Usage

The loopback-detect packet-interval command is used to adjust the interval for sending loopback detection packets. After loopback detection is enabled on an interface, the interface sends loopback detection packets at the interval specified by the loopback-detect packet-interval command. If a shorter interval is set, the system sends more loopback detection packets in a certain period. This enables the system to detect loopbacks more quickly and accurately, but more system sources are consumed.

Examples

This example shows how to set the interval for sending loopback detection packets to 10s:

Switch# configure terminal
Switch(config)# loopback-detect packet-interval 10

Related Commands

show loopback-detect

3.13.3. loopback-detect recovery-time

Command Purpose

Using the loopback-detect recovery-time command, you can set the time for interface recovery from abnormal status.

Using the no loopback-detect recovery-time command, you can restore the default time.

By default, the value for recovery time is the packet-interval * 3

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

loopback-detect recovery-time TIME

no loopback-detect recovery-time

Parameter

Parameter Description

Parameter Value

TIME

recovery time in seconds

1-255, unit:second

Command Mode

Interface Configuration

Default

recovery-time is packet-interval * 3

Usage

If the interface is shutdown, this command is useless.

Examples

This example shows how to set the value for recoverying time to 10s:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# loopback-detect recovery-time 10

Related Commands

show loopback-detect

3.13.4. loopback-detect delay-time

Command Purpose

Using the loopback-detect delay-time on interface for set aciton.

Using the no loopback-detect delay-time to set not delay.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

loopback-detect delay-time TIME

no loopback-detect delay-time

Parameter

Parameter Description

Parameter Value

TIME

delay time

1-255, unit:second

Command Mode

Interface Configuration

Default

None

Usage

The no loopback-detect delay-time command is used to set on the interface, if received loopback-detect packet, then set action that set on the interface.

Examples

This example shows how to set the value for delay time set action to 5s:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# loopback-detect delay-time 5

Related Commands

show loopback-detect

3.13.5. loopback-detect action

Command Purpose

Using the loopback-detect action command, you can configure an action to perform when a loopback is detected on an interface.

Using the no loopback-detect action command, you can restore the default action.

By default, an interface is blocked when a loopback is detected on the interface.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

loopback-detect action { shutdown | trap | block }

no loopback-detect action

Parameter

Parameter Description

Parameter Value

shutdown

Shuts down an interface when a loopback is detected on the interface.

-

Trap

Only sends a trap message when a loopback is detected.

-

block

Block the interface and continue to send loopback-detect packets

-

Command Mode

Interface Configuration

Default

Trap

Usage

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. The loopback-detect action command configures the action.

Examples

This example shows how to configure the system action to shutdown interface eth-0-1 when a loopback occurs:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# loopback-detect action shutdown

Related Commands

show loopback-detect

loopback-detect enable

3.13.6. loopback-detect packet vlan

Command Purpose

Using the loopback-detect packet vlan command, you can specify the VLAN IDs of loopback detection packets on an interface.

Using the no loopback-detect packet vlan command, you can cancel the configuration.

By default, detection packets do not have a VLAN ID.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

loopback-detect packet vlan VID

no loopback-detect packet vlan VID

Parameter

Parameter Description

Parameter Value

VID

VLAN ID

1-4094

Command Mode

Interface Configuration

Default

No vlan id.

Usage

By default, loopback detection packets do not contain VLAN IDs. 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

Examples

This example shows how to set the VLAN ID of loopback detection packets sent by interface eth-0-1 to 30:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# loopback-detect packet vlan 30

Related Commands

show running-config

3.13.7. show loopback-detect

Command Purpose

Using the show loopback-detect command, you can view the loopback detection configuration and status of loopback detection enabled interfaces.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show loopback-detect { interface IFNAME | packet-interval }

Parameter

Parameter Description

Parameter Value

interface IFNAME

Show loopback detection status and configuration on interface.

Support physical ports

packet-interval

Show loopabck detect packet interval.

-

Command Mode

Privileged EXEC

Default

None

Usage

This command is used to check the loopback detection configuration and status of each interface on which loopback detection is enabled.

Examples

Display the loopback detection configuration and status of loopback detection enabled interfaces:

Switch# show loopback-detect


Loopback detection packet interval(second) 5
Interface   Action   Status   Delay(s) DLeft(s) Recovery(s) RLeft(s) Send            Recv       Count
eth-0-47    trap     NORMAL   30       -        15          -        N/A              N/A       0
eth-0-48    trap     NORMAL   -        -        15          -      2023-01-05 034721  N/A       0

Related Commands

loopback-detect action

loopback-detect enable

3.13.8. loopback-detect in-loop-enable

Command Purpose

Using the loopback-detect in-loop enable, you can enable in-loop mode.

Using the no loopback-detect in-loop-enable,you can disable in-loop mode.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

loopback-detect in-loop-enable

no loopback-detect in-loop-enable

Command Mode

Global Config

Default

Disable

Usage

Using this command can switch loopback-detect to the in-loop mode in Global Config mode. In this mode, a loop alarm is triggered when the port receives the packets from the same port, and when the port receives the packets from other ports on the same board, the loop alarm is triggered.

Examples

This example shows how to enable in-loop mode in global configration:

Switch# configure terminal
Switch(config)# loopback-detect in-loop-enable

Related Commands

None