BGP route dampening is a mechanism used in the Border Gateway
Protocol (BGP) to mitigate the negative effects of route flapping. Route
flapping occurs when a BGP route is repeatedly advertised and withdrawn,
causing instability in the network. This instability can lead to increased CPU
load on routers, excessive BGP updates, and potential routing loops.
BGP route dampening works by assigning a penalty to a route
each time it flaps. If the route continues to flap, the penalty accumulates.
Once the penalty exceeds a certain threshold, the route is dampened, meaning it
is suppressed and not considered for routing decisions. This prevents the
flapping route from causing further disruption to the network.
After some time, the penalty for a dampened route
begins to decrease. Once the penalty falls below another threshold, the route
is un-dampened and can be used again. This allows the route to recover if the
underlying issue causing the flapping has been resolved.
BGP route dampening helps to improve network stability and
reduce the load on routers by preventing the propagation of flapping routes.
However, it can also lead to temporary loss of connectivity for some
destinations if routes are dampened for extended periods. Therefore, it is
important to carefully configure the dampening parameters to balance stability
and availability.
R1(config)#interface loopback 1
R1(config-if)#ip address 1.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface fastethernet 2/0
R1(config-if)#ip address 10.1.1.1 255.0.0.0
R1(config-if)#no keepalive
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface fastethernet 0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R2(config)#interface fastethernet 0/0
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial 4/0
R2(config-if)#ip address 192.168.4.2 255.255.255.0
R2(config-if)#no keepalive
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial 4/1
R2(config-if)#ip address 192.168.3.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R3(config)#interface loopback 1
R3(config-if)#ip address 3.3.3.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface fastethernet 2/0
R3(config-if)#ip address 30.1.1.1 255.0.0.0
R3(config-if)#no keepalive
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface serial 4/1
R3(config-if)#ip address 192.168.3.1 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R4(config)#interface loopback 1
R4(config-if)#ip address 4.4.4.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#exit
R4(config)#interface fastethernet 2/0
R4(config-if)#ip address 40.1.1.1 255.0.0.0
R4(config-if)#no keepalive
R4(config-if)#no shutdown
R4(config-if)#exit
R4(config)#interface serial 4/0
R4(config-if)#ip address 192.168.4.1 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#exit
R1(config)#router bgp 65100
R1(config-router)#neighbor 192.168.1.2 remote-as 65100
R1(config-router)#network 10.0.0.0
R1(config-router)#network 1.1.1.0 mask 255.255.255.0
R1(config-router)#network 192.168.1.0 mask 255.255.255.0
R1(config-router)#no auto-summary
R1(config-router)#no synchronization
R1(config-router)#exit
R2(config)#router bgp 65100
R2(config-router)#neighbor 192.168.1.1 remote-as 65100
R2(config-router)#neighbor 192.168.4.1 remote-as 65400
R2(config-router)#neighbor 192.168.3.1 remote-as 65300
R2(config-router)#network 192.168.1.0 mask 255.255.255.0
R2(config-router)#network 192.168.3.0 mask 255.255.255.0
R2(config-router)#network 192.168.4.0 mask 255.255.255.0
R2(config-router)#neighbor 192.168.1.1 next-hop-self
R2(config-router)#bgp log-neighbor-changes
R2(config-router)#no synchronization
R2(config-router)#no auto-summary
R2(config-router)#exit
R3(config)#router bgp 65300
R3(config-router)#neighbor 192.168.3.2 remote-as 65100
R3(config-router)#network 3.3.3.0 mask 255.255.255.0
R3(config-router)#network 30.0.0.0
R3(config-router)#network 192.168.3.0 mask 255.255.255.0
R3(config-router)#bgp log-neighbor-changes
R3(config-router)#no synchronization
R3(config-router)#no auto-summary
R3(config-router)#exit
R4(config)#router bgp 65400
R4(config-router)#neighbor 192.168.4.2 remote-as 65100
R4(config-router)#network 40.0.0.0
R4(config-router)#network 4.0.0.0 mask 255.255.255.0
R4(config-router)#network 192.168.4.0 mask 255.255.255.0
R4(config-router)#no auto-summary
R4(config-router)#no synchronization
R4(config-router)#bgp log-neighbor-changes
R4(config-router)#exit
R1#show ip bgp
BGP table version is 11, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 0.0.0.0 0 32768 i
*>i3.3.3.0/24 192.168.1.2 0 100 0 65300 i
*> 10.0.0.0 0.0.0.0 0 32768 i
*>i30.0.0.0 192.168.1.2 0 100 0 65300 i
*>i40.0.0.0 192.168.1.2 0 100 0 65400 i
* i192.168.1.0 192.168.1.2 0 100 0 i
*> 0.0.0.0 0 32768 i
*>i192.168.3.0 192.168.1.2 0 100 0 i
*>i192.168.4.0 192.168.1.2 0 100 0 i
R2(config)#router bgp 65100
R2(config-router)#bgp dampening
R2(config-router)#end
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(config)#router bgp 65100
R2(config-router)#neighbor 192.168.1.1 advertisement-interval 1
R3(config)#interface loopback 1
R3(config-if)#shutdown
R3(config-if)#no shutdown
R3(config-if)#no shutdown
R3(config-if)#shutdown
R3(config-if)#no shutdown
*Feb 4 13:14:50.315: EvD: charge penalty 1000, new accum. penalty 1000, flap count 1
*Feb 4 13:14:50.319: BGP(0): charge penalty for 3.3.3.0/24 path 65300 with half life-time 15 reuse/suppress 750/2000
*Feb 4 13:14:50.319: BGP(0): flapped 1 times since 00:00:00. New penalty is 1000
*Feb 4 13:14:50.655: EvD: accum. penalty decayed to 1000 after 0 second(s)
R2#show ip bgp dampening flap-statistics
BGP table version is 17, local router ID is 192.168.4.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network From Flaps Duration Reuse Path
*> 3.3.3.0/24 192.168.3.1 1 00:00:39 65300
R2#show ip bgp 3.3.3.3
BGP routing table entry for 3.3.3.0/24, version 17
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
Advertised to update-groups:
1 2
65300
192.168.3.1 from 192.168.3.1 (3.3.3.3)
Origin IGP, metric 0, localpref 100, valid, external, best
Dampinfo: penalty 936, flapped 1 times in 00:01:32
R2#show ip bgp
BGP table version is 20, local router ID is 192.168.4.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.0/24 192.168.1.1 0 100 0 i
h 3.3.3.0/24 192.168.3.1 0 0 65300 i
*>i10.0.0.0 192.168.1.1 0 100 0 i
*> 30.0.0.0 192.168.3.1 0 0 65300 i
*> 40.0.0.0 192.168.4.1 0 0 65400 i
* i192.168.1.0 192.168.1.1 0 100 0 i
*> 0.0.0.0 0 32768 i
* 192.168.3.0 192.168.3.1 0 0 65300 i
*> 0.0.0.0 0 32768 i
* 192.168.4.0 192.168.4.1 0 0 65400 i
*> 0.0.0.0 0 32768 i