BGP Route Dampening Configuration: Penalty and Reuse Limits - 夜莺博客

BGP Route Dampening Configuration: Penalty and Reuse Limits

BGP route dampening exists for one reason: a route that flaps (advertised and withdrawn over and over) forces every router on the path to burn CPU processing UPDATE messages, and in the pre-1990s hardware era that could destabilize entire backbones. Modern routers are fast, which is why RIPE now recommends dampening be applied selectively - but the mechanics are still worth knowing cold. This article explains the penalty system and shows how to enable dampening globally or per-route on Cisco IOS.

How the Penalty System Works

Each time a route flaps, it receives a penalty of 1000. When the accumulated penalty crosses the suppress limit (default 2000), the route is dampened: it is neither installed in the routing table nor advertised to neighbors. From that moment the penalty decays with a half-life timer (default 15 minutes) - every half-life the penalty halves. Once the penalty drops below the reuse limit (default 750) the route is announced again, and below 50% of the reuse limit the penalty is removed completely.

Configuration: Global Dampening

R2(config)# router bgp 2
R2(config-router)# bgp dampening

That single line enables dampening with all defaults. To tune the behavior, the full syntax is:

R2(config-router)# bgp dampening <half-life> <reuse> <suppress> <max-suppress>
R2(config-router)# bgp dampening 15 750 2000 60

The max-suppress-time (60 minutes by default) caps how long a route can stay dampened even if it keeps flapping - after that the penalty is frozen at the value that yields the maximum suppression period.

Selective Dampening with Route Maps

Because blanket dampening can hide a route that is genuinely bouncing due to a real outage, RIPE-580 recommends dampening only specific prefixes. Attach a route map to bgp dampening to restrict the feature:

R2(config)# route-map DAMPEN-CUSTOMER permit 10
R2(config-route-map)# match ip address prefix-list CUSTOMER-PREFIXES
R2(config-route-map)# set dampening 15 750 2000 60
R2(config)# router bgp 2
R2(config-router)# bgp dampening route-map DAMPEN-CUSTOMER

Verification

R2# show ip bgp dampening parameters
 dampening 15 750 2000 60 (DEFAULT)
  Half-life time      : 15 mins       Decay Time       : 2320 secs
  Max suppress penalty: 12000         Max suppress time: 60 mins
  Suppress penalty    :  2000         Reuse penalty    : 750
R2# show ip bgp dampened-paths
R2# clear ip bgp dampening

show ip bgp dampening parameters confirms the active timers, show ip bgp dampened-paths lists currently suppressed prefixes, and the clear command manually releases dampened routes after an incident is resolved.

Related Reading on This Site

See also BGP route dampening penalty, suppress and reuse limits, BGP neighbor flapping root causes and the BGP timers deep dive.

原文链接:https://networklessons.com/bgp/bgp-route-dampening