Junos BGP Flap Damping: Parameters and Configuration Guide - 夜莺博客

Junos BGP Flap Damping: Parameters and Configuration Guide

BGP route flap damping is the classic defense against unstable peers that continuously advertise and withdraw routes, but on Junos OS it is disabled by default and needs both a parameter set and a routing policy to work. This guide explains the four damping parameters — half-life, max-suppress, reuse and suppress — with their Junos defaults, and shows how to enable flap damping correctly without accidentally suppressing stable routes. It is the Junos-specific companion to our general BGP route flap damping article.

What Junos Flap Damping Does

Junos marks flapping routes as ineligible for selection as the active route, which delays propagation but dramatically reduces the number of update messages between BGP peers. Damping is normally applied to EBGP routes and to confederation-boundary routes. Do not apply flap damping to IBGP routes — routing consistency inside an AS matters more than update reduction, and Junos ignores damping on IBGP routes anyway. From Junos 12.2 you can apply damping at the address family level, which works for both IBGP and EBGP.

Default Damping Parameters

Parameter Description Default Possible values
half-life (minutes) Time after which a penalty is halved if the route stays stable 15 1–45
max-suppress (minutes) Maximum hold-down time of a suppressed route 60 1–720
reuse Threshold below which a suppressed route is reused 750 1–20000
suppress Threshold above which a route is suppressed and no longer advertised 3000 1–20000

Configuring Damping with a Routing Policy

To change the defaults, create a named set of damping parameters and reference it from a routing policy using the damping action, then enable damping on BGP:

policy-options {
    damping my-damping {
        half-life 20;
        max-suppress 120;
        reuse 1000;
        suppress 4000;
    }
    policy-statement damp-flaps {
        term damp {
            from {
                protocol bgp;
                route-type external;
            }
            then {
                damping my-damping;
                accept;
            }
        }
    }
}
protocols bgp {
    group ebgp-peers {
        import damp-flaps;
    }
}

With damping enabled, the route's penalty increases on each flap; once it crosses the suppress threshold the route is held down for up to max-suppress minutes, and it is reused again when the penalty decays below the reuse threshold.

Damping Tuning Best Practices

Start with conservative thresholds and monitor actual flaps before tightening them. Aggressive damping can take down legitimate routes during temporary network incidents — the same trap documented in our BGP route flap damping explained article. Also review BGP neighbor flapping root causes before deciding damping is the answer, and see BGP ECMP configuration on Cisco, Juniper and Arista for related tuning.

原文链接:https://www.juniper.net/documentation/us/en/software/junos/routing-policy/bgp/topics/concept/routing-policy-security-damping-parameter-understanding.html