Configuring Loop Detection

You can configure loop detect and block priorities in the interface view.

Context

Perform the following steps on each PE.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface { ethernet | gigabitethernet | eth-trunk } interface-number or interface { ethernet | gigabitethernet | eth-trunk } interface-number

    The Ethernet interface view is displayed.

  3. Run loop-detect enable

    The loop detection function is enabled on the interface.

  4. Run loop-detect mac-withdraw enable

    The sub-interface of the AC interface or a main interface is enabled to delete MAC address entries when its loop detection status changes.

    The loop-detect mac-withdraw enable command speeds up traffic switching.

  5. (Optional) Run loop-detect priority priority

    The blocking priority of the interface is configured.

    • The smaller the value of priority is, the higher blocking priority is for the interface. The interface with a higher blocking priority is blocked preemptively when a loop is detected. The default priority value is 0.

    • If the blocking priority values are the same, the blocking management component compares the MAC addresses of the two AC interfaces. The interface with a smaller MAC address has a higher blocking priority, and is therefore blocked.
    • If MAC addresses are also the same, the blocking management component compares the interface indices, that is, the interface indices for configuring loop detect. The interface with a smaller interface index has a higher blocking priority, and is therefore blocked.

  6. Run loop-detect block [ block-time ]

    The interface is blocked when a loop is detected.

    • By specifying the parameter block-time, you can set the interval for unblocking an interface. That is, if the blocked interface receives no loop detect packet during block-time, the interface is unblocked. In order to avoid interface flapping, if the immediate Down/Up function is enabled on the blocked interface, that is step 6, the block-time should be no shorter than 10 seconds.

    • If the parameter block-time is not set, the interface is blocked permanently. That is, when no loop occurs on the network, and the blocked interface receives no loop detect packet any more, the interface is still in the blocking state.

    • For the interface in the permanent blocking state, if the blocking priorities of the interfaces on the network are adjusted, the interface is unblocked when another interface is set with a higher blocking priority. The interface with a higher blocking priority is then blocked permanently. For example, GE 0/1/0.1 and GE 0/1/8.1 are in the same VPLS, and a loop occurs on these GE interfaces. The blocking priority of GE 0/1/0.1 is 50, and the blocking priority of GE 0/1/8.1 is 100. In this case, GE 0/1/0.1 is in the permanent blocking state. If the blocking priority of GE 0/1/8.1 is adjusted to 25, GE 0/1/0.1 is unblocked, and GE 0/1/8.1 enters the blocking state.

  7. (Optional) Run loop-detect trigger interface-down enable

    The immediate interface Down/Up event is triggered after a loop is detected.

    By default, the blocked interface only stops forwarding traffic, but the physical and protocol status of the interface is still Up. Therefore, each table on the interface, such as the MAC address table, cannot be updated immediately. As a result, the user traffic is still sent to the interface continuously after the interface is blocked, which leads to traffic interruption. If the immediate Down/Up function is enabled on the blocked interface, the interface goes Down, and relevant tables on the interface are updated. When the timer times out after approximately five seconds, the interface goes Up. In this manner, the user traffic is not lost.

    Do not add interfaces to or delete members from an Eth-Trunk interface when it is triggered to go Down by the immediate Down/Up function. This is because when the Eth-Trunk interface goes Down, all its members go Down; when the Eth-Trunk interface goes Up, all its members go Up.
    • If you add interfaces to an Eth-Trunk interface that is triggered to go Down by the immediate Down/Up function, after the Eth-Trunk interface recovers (goes Up), all its members automatically go Up.
    • If you delete interfaces from an Eth-Trunk interface that is triggered to go Down by the immediate Down/Up function, the deleted interfaces remain Down and cannot go Up automatically.
    You can add interfaces or delete members from an Eth-Trunk interface after it recovers.

  8. Run loop-detect only-alarm

    The interface is configured to report an alarm only if a loop is detected, without blocking itself.

    After the loop-detect only-alarm command is run on an interface, if the interface detects a loop, it reports an alarm only and does not block the loop interface. The command configuration has the following impacts:
    • If a loop is detected on an interface after the loop-detect only-alarm command is run on the interface, the interface reports an alarm only and does not block itself.
    • If the loop-detect only-alarm command is run on an interface on which a loop has been detected, blocking on the interface is disabled. In this case, if the undo loop-detect only-alarm command is run to restore the default configuration on the interface, block the interface again to prevent the loop.

  9. Run loop-detect identifier identifier-value

    An authentication identifier for L2VPN loop detection is configured on the interface.

    If an authentication identifier for L2VPN loop detection is configured in both the interface view and global view, the configuration in the interface view is preferentially used.

    After an authentication identifier is configured on the local device, if the identifier in the detection packet received from a peer device is different from the local one, the local device discards the packet.

  10. (Optional) Run loop-detect detection vid low-vid [ to high-vid ]

    A VLAN range for the main interface to send loop detection packets is set.

    This command can be run on a sub-interface for dot1q VLAN tag termination or its main interface. For details about the configuration on a sub-interface for dot1q VLAN tag termination, see (Optional) Configuring the VLAN Range for Loop Detection Packets Sent by a Sub-interface for VLAN Tag Termination.

  11. Run commit

    The configuration is committed.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >