Configuring OSPFv3 Neighbor Relationship Flapping Suppression
Context
If an interface carrying OSPFv3 services alternates between Up and Down, OSPFv3 neighbor relationship flapping occurs on the interface. During the flapping, OSPFv3 frequently sends Hello packets to reestablish the neighbor relationship, synchronizes LSDBs, and recalculates routes. In this process, a large number of packets are exchanged, adversely affecting neighbor relationship stability, OSPFv3 services, and other OSPFv3-dependent services, such as LDP and BGP. OSPFv3 neighbor relationship flapping suppression can address this problem by delaying OSPFv3 neighbor relationship reestablishment or preventing service traffic from passing through flapping links.
Pre-configuration Tasks
Before configuring OSPFv3 neighbor relationship flapping suppression, complete the following tasks:
- Configure an IP address for each interface to ensure that neighboring routers are reachable at the network layer.
- Configure basic OSPFv3 functions.
Procedure
- Run system-view
The system view is displayed.
By default, OSPFv3 neighbor relationship flapping suppression is enabled globally. To disable this function globally, run the suppress-flapping peer disable command in the OSPFv3 view.
- Run interface interface-type interface-number
The interface view is displayed.
By default, OSPFv3 neighbor relationship flapping suppression is enabled on all interfaces in the same OSPFv3 process. To disable the function from one of the interfaces, run the ospfv3 suppress-flapping peer disable command.
- On an Ethernet interface, run undo portswitch
The interface is switched to Layer 3 mode.
By default, an Ethernet interface works in Layer 2 mode.
The mode switching function takes effect when the interface only has attribute configurations (for example, shutdown and description configurations). Alternatively, if configuration information supported by both Layer 2 and Layer 3 interfaces exists (for example, mode lacp and lacp system-id configurations), no configuration that is not supported after the working mode of the interface is switched can exist. If unsupported configurations exist on the interface, delete the configurations first and then run the undo portswitch command.
If many Ethernet interfaces need to be switched to Layer 3 mode, run the undo portswitch batch interface-type { interface-number1 [ to interface-number2 ] } &<1-10> command in the system view to switch these interfaces to Layer 3 mode in batches.
- Run ospfv3 suppress-flapping peer hold-down interval [ instance instance-id ]
The Hold-down mode is configured, and its duration is set.
Flapping suppression works in either Hold-down or Hold-max-cost mode.
- Hold-down mode: In the case of frequent flooding and topology changes during neighbor relationship establishment, interfaces prevent neighbor relationship reestablishment during Hold-down suppression, which minimizes LSDB synchronization attempts and packet exchanges.
- Hold-max-cost mode: If the traffic forwarding path changes frequently, interfaces use 65535 as the cost of the flapping link during Hold-max-cost suppression, which prevents traffic from passing through the flapping link.
Flapping suppression can also work first in Hold-down mode and then in Hold-max-cost mode.
By default, the Hold-down mode is disabled, and the Hold-max-cost mode is enabled.
To disable the Hold-max-cost mode, run the ospfv3 suppress-flapping peer hold-max-cost disable [ instance instance-id ] command.
- Run ospfv3 suppress-flapping peer { detecting-interval detecting-interval | threshold threshold | resume-interval resume-interval } * [ instance instance-id ]
Detection parameters are configured for OSPFv3 neighbor relationship flapping suppression.
Each OSPFv3 interface on which OSPFv3 neighbor relationship flapping suppression is enabled starts a flapping counter. If the interval between two successive neighbor status changes from Full to a non-Full state is shorter than detecting-interval, a valid flapping_event is recorded, and the flapping_count increases by 1. When the flapping_count reaches or exceeds threshold, flapping suppression takes effect. If the interval between two successive neighbor status changes from Full to a non-Full state is longer than resume-interval, the flapping_count is reset.
The value of resume-interval must be greater than that of detecting-interval.By default, the detection interval of OSPFv3 neighbor relationship flapping suppression is 60s, the suppression threshold is 10, and the interval for exiting from suppression is 120s. Using the default detection parameters is recommended.
- Run commit
The configuration is committed.