BGP Route Dampening: Penalty, Suppress and Reuse - 夜莺博客

BGP Route Dampening: Penalty, Suppress and Reuse

BGP route dampening protects routers from flapping routes - prefixes that are advertised and withdrawn over and over again, each flap triggering a BGP UPDATE and burning CPU. Cisco IOS implements the dampening mechanism with four parameters (penalty, half-life, suppress and reuse limits), and this article explains how they interact, how to enable dampening globally or with a route-map, and how to verify dampened routes with show commands.

How BGP Route Dampening Works

Each flap adds a penalty of 1000 to the route. When the accumulated penalty exceeds the suppress limit (default 2000), the route is dampened: it is neither installed in the routing table nor advertised to neighbors. The penalty decays with a half-life timer (default 15 minutes), halving every interval, and the route is reused once the penalty drops below the reuse limit (default 750). The maximum suppress time (default 60 minutes) prevents routes from being dampened forever.

Configuration: Global or Route-Map

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

For selective dampening, use a route-map with explicit parameters (half-life 15, reuse 750, suppress 2000, max-suppress 60):

R2(config)# ip access-list standard R1_L0
R2(config-std-nacl)# permit host 1.1.1.1
R2(config)# route-map DAMPENING permit 10
R2(config-route-map)# match ip address R1_L0
R2(config-route-map)# set dampening 15 750 2000 60
R2(config)# router bgp 2
R2(config-router)# bgp dampening route-map DAMPENING

Verification Commands

R2# show run all | include dampening
R2# show ip bgp dampening parameters
R2# show ip bgp dampening flap-statistics
R2# show ip bgp dampening dampened-paths
R2# show ip bgp 1.1.1.1/32

show ip bgp dampening parameters displays the half-life, max suppress penalty, suppress and reuse values; show ip bgp dampening dampened-paths lists routes currently suppressed with their reuse time.

Watching Damping in Action

R2# debug ip bgp dampening
R1(config)# interface Loopback 0
R1(config-if)# shutdown          ! flap 1: penalty 1000
R1(config-if)# no shutdown
R1(config-if)# shutdown          ! flap 2: penalty 1835
R1(config-if)# no shutdown
R1(config-if)# shutdown          ! flap 3: penalty 2691 (above 2000)
R1(config-if)# no shutdown
R2# 
BGP(0): suppress 1.1.1.1/32 path 1 for 00:24:40 (penalty 2349)
halflife-time 15, reuse/suppress 750/2000

The route is now dampened (*d in the BGP table), not installed in the routing table, and not advertised. As the penalty decays below 750 the route is unsuppressed automatically; to force it, run clear ip bgp dampening 1.1.1.1 255.255.255.255.

Operational Guidance

Dampening should not be enabled blindly - RIPE publishes recommendations (RIPE-580) on safe default parameters because overly aggressive dampening can suppress stable routes for long periods. Apply it mainly to EBGP-learned routes and keep the defaults close to RFC 2439 values.

Related articles: Junos BGP flap damping parameters and configuration and BGP timers: hold, keepalive and MRAI explained.

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