loopback-detection action

Syntax

loopback-detection action { no-learning | shutdown }

undo loopback-detection action

View

Ethernet interface view, port group view

Default level

2: System level

Parameters

no-learning: Disables MAC address learning on the interface.

shutdown: Shuts down the Ethernet interface. To bring up the interface again, use the undo shutdown command.

Description

Use loopback-detection action to configure the action for loop protection on Ethernet interfaces.

Use undo loopback-detection action to restore the default.

By default, a looped interface does not receive or send packets; the system generates traps and log messages, and deletes all MAC address entries of the looped interface.

When you change the link type of an Ethernet interface by using the port link-type command, the switch removes the protective action configured on the interface. For more information about the port link-type command, see "VLAN configuration commands."

Examples

# Configure the access port Ethernet 1/0/1 to shut down when a loop is detected.

<Sysname> system-view
[Sysname] loopback-detection enable
[Sysname] interface ethernet 1/0/1
[Sysname-Ethernet1/0/1] loopback-detection enable
[Sysname-Ethernet1/0/1] loopback-detection action shutdown

# Configure the trunk port Ethernet 1/0/2 to shut down when a loop is detected.

<Sysname> system-view
[Sysname] loopback-detection enable
[Sysname] interface ethernet 1/0/2
[Sysname-Ethernet1/0/2] port link-type trunk
[Sysname-Ethernet1/0/2] loopback-detection enable
[Sysname-Ethernet1/0/2] loopback-detection control enable
[Sysname-Ethernet1/0/2] loopback-detection action shutdown