BGP IPv4 - Route Dampening
Route Dampening
BGP (Border Gateway Protocol) IPv4 Route Dampening is a mechanism designed to mitigate the impact of route instability in BGP networks. When a route undergoes frequent changes, such as flapping (repeatedly transitioning between up and down states), it can lead to increased network instability and unnecessary consumption of resources. BGP Route Dampening aims to suppress such volatile routes temporarily, reducing the likelihood of propagating unstable routing information throughout the network. This is achieved by assigning penalty values to flapping routes, and when a certain penalty threshold is exceeded, the route is dampened, effectively suppressing updates for a specified period. By implementing BGP IPv4 Route Dampening, network administrators can enhance network stability, minimize the convergence time, and alleviate the potential negative impact of unstable routes on BGP routing tables and overall network performance.
Lab:
BGP Topology
Disclaimer
This Configuration Guide is designed to assist members to enhance their skills in particular technology area. While every effort has been made to ensure that all material is as complete and accurate as possible, the enclosed material is presented on an “as is” basis. Neither the authors nor Forum assume any liability or responsibility to any person or entity with respect to loss or damages incurred from the information contained in this guide. This configuration guide was developed by Forum. Any similarities between material presented in this configuration guide and any other material is completely coincidental. Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.2(4)M1, DEVELOPMENT TEST SOFTWARE
Task 1: Configure IPv4 BGP Process for Autonomous
Step 1: In the configuration mode of router configure IPv4 BGP Process by following command:
R1:
router bgp 100
neighbor 12.0.0.2 remote-as 65002
neighbor 12.0.0.2 soft-reconfiguration inbound
address-family ipv4
network 11.0.1.0 mask 255.255.255.0
network 11.0.2.0 mask 255.255.255.0
network 11.0.3.0 mask 255.255.255.0
exit
R2:
router bgp 65002
neighbor 23.0.0.3 remote-as 65001
neighbor 23.0.0.3 soft-reconfiguration inbound
neighbor 12.0.0.1 remote-as 100
neighbor 12.0.0.1 soft-reconfiguration inbound
address-family ipv4
network 22.0.1.0 mask 255.255.255.0
network 22.0.2.0 mask 255.255.255.0
network 22.0.3.0 mask 255.255.255.0
exit
R3:
router bgp 65001
neighbor 23.0.0.2 remote-as 65002
neighbor 23.0.0.2 soft-reconfiguration inbound
neighbor 34.0.0.4 remote-as 65001
neighbor 34.0.0.4 soft-reconfiguration inbound
address-family ipv4
network 33.0.1.0 mask 255.255.255.0
network 33.0.2.0 mask 255.255.255.0
network 33.0.3.0 mask 255.255.255.0
exit
R4:
router bgp 65001
neighbor 34.0.0.3 remote-as 65001
neighbor 34.0.0.3 soft-reconfiguration inbound
address-family ipv4
network 44.0.1.0 mask 255.255.255.0
network 44.0.2.0 mask 255.255.255.0
network 44.0.3.0 mask 255.255.255.0
exit
Step 2: In the configuration mode of router configure IPv4 OSPF Process by following command:
R1:
router ospf 1
network 0.0.0.0 0.0.0.0 area 0
exit
R2:
router ospf 1
network 0.0.0.0 0.0.0.0 area 0
exit
R3:
router ospf 1
network 0.0.0.0 0.0.0.0 area 0
exit
R4:
router ospf 1
network 0.0.0.0 0.0.0.0 area 0
exit
Step 3: Verify IPv4 BGP routes by following command:
R1#show ip bgp
BGP table version is 13, local router ID is 11.0.3.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 11.0.1.0/24 0.0.0.0 0 32768 i
*> 11.0.2.0/24 0.0.0.0 0 32768 i
*> 11.0.3.0/24 0.0.0.0 0 32768 i
*> 22.0.1.0/24 12.0.0.2 0 0 65002 i
*> 22.0.2.0/24 12.0.0.2 0 0 65002 i
*> 22.0.3.0/24 12.0.0.2 0 0 65002 i
*> 33.0.1.0/24 12.0.0.2 0 65002 65001 i
*> 33.0.2.0/24 12.0.0.2 0 65002 65001 i
*> 33.0.3.0/24 12.0.0.2 0 65002 65001 i
*> 44.0.1.0/24 12.0.0.2 0 65002 65001 i
*> 44.0.2.0/24 12.0.0.2 0 65002 65001 i
*> 44.0.3.0/24 12.0.0.2 0 65002 65001 i
R2#show ip bgp
BGP table version is 13, local router ID is 22.0.3.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 11.0.1.0/24 12.0.0.1 0 0 100 i
*> 11.0.2.0/24 12.0.0.1 0 0 100 i
*> 11.0.3.0/24 12.0.0.1 0 0 100 i
*> 22.0.1.0/24 0.0.0.0 0 32768 i
*> 22.0.2.0/24 0.0.0.0 0 32768 i
*> 22.0.3.0/24 0.0.0.0 0 32768 i
*> 33.0.1.0/24 23.0.0.3 0 0 65001 i
*> 33.0.2.0/24 23.0.0.3 0 0 65001 i
*> 33.0.3.0/24 23.0.0.3 0 0 65001 i
*> 44.0.1.0/24 23.0.0.3 0 0 65001 i
*> 44.0.2.0/24 23.0.0.3 0 0 65001 i
*> 44.0.3.0/24 23.0.0.3 0 0 65001 i
R3#show ip bgp
BGP table version is 13, local router ID is 33.0.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 11.0.1.0/24 23.0.0.2 0 65002 100 i
*> 11.0.2.0/24 23.0.0.2 0 65002 100 i
*> 11.0.3.0/24 23.0.0.2 0 65002 100 i
*> 22.0.1.0/24 23.0.0.2 0 0 65002 i
*> 22.0.2.0/24 23.0.0.2 0 0 65002 i
*> 22.0.3.0/24 23.0.0.2 0 0 65002 i
*> 33.0.1.0/24 0.0.0.0 0 32768 i
*> 33.0.2.0/24 0.0.0.0 0 32768 i
*> 33.0.3.0/24 0.0.0.0 0 32768 i
*>i 44.0.1.0/24 34.0.0.4 0 100 0 i
*>i 44.0.2.0/24 34.0.0.4 0 100 0 i
*>i 44.0.3.0/24 34.0.0.4 0 100 0 i
R4#show ip bgp
BGP table version is 13, local router ID is 44.0.3.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*>i 11.0.1.0/24 23.0.0.2 0 100 0 65002 100 i
*>i 11.0.2.0/24 23.0.0.2 0 100 0 65002 100 i
*>i 11.0.3.0/24 23.0.0.2 0 100 0 65002 100 i
*>i 22.0.1.0/24 23.0.0.2 0 100 0 65002 i
*>i 22.0.2.0/24 23.0.0.2 0 100 0 65002 i
*>i 22.0.3.0/24 23.0.0.2 0 100 0 65002 i
*>i 33.0.1.0/24 34.0.0.3 0 100 0 i
*>i 33.0.2.0/24 34.0.0.3 0 100 0 i
*>i 33.0.3.0/24 34.0.0.3 0 100 0 i
*> 44.0.1.0/24 0.0.0.0 0 32768 i
*> 44.0.2.0/24 0.0.0.0 0 32768 i
*> 44.0.3.0/24 0.0.0.0 0 32768 i
Task 2: Verify BGP Route Dampening
Step 1: Enable and verify BGP Dampening
R2:
router bgp 65002
address-family ipv4
bgp dampening
exit
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
Step 2: Shutdown interface loopback 1 on router R1
R1:
interface loopback 1
shutdown
*Jun 30 09:37:19.550: %LINK-5-CHANGED: Interface Loopback1, changed state to
administratively down
*Jun 30 09:37:20.550: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1,
changed state to down
Step 3: Verify output 3 mins after on router R2
R2#debug ip bgp dampening
BGP dampening debugging is on for all address families
R2#
*Jun 30 11:00:46.144: EvD: charge penalty 1000, new accum. penalty 1000, flap count 1
*Jun 30 11:00:46.144: EvD: unsuppress item left in reuse timer array with penalty 1000
*Jun 30 11:00:46.144: BGP(0): charge penalty for 11.0.1.0/24 path 100 with halflife-time 15
reuse/suppress 750/2000
*Jun 30 11:00:46.144: BGP(0): flapped 1 times since 00:00:00. New penalty is 1000
R2#show ip bgp
BGP table version is 22, local router ID is 22.0.3.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
h 11.0.1.0/24 12.0.0.1 0 0 100 i
*> 11.0.2.0/24 12.0.0.1 0 0 100 i
*> 11.0.3.0/24 12.0.0.1 0 0 100 i
*> 22.0.1.0/24 0.0.0.0 0 32768 i
*> 22.0.2.0/24 0.0.0.0 0 32768 i
*> 22.0.3.0/24 0.0.0.0 0 32768 i
*> 33.0.1.0/24 23.0.0.3 0 0 65001 i
*> 33.0.2.0/24 23.0.0.3 0 0 65001 i
*> 33.0.3.0/24 23.0.0.3 0 0 65001 i
*> 44.0.1.0/24 23.0.0.3 0 65001 i
*> 44.0.2.0/24 23.0.0.3 0 65001 i
*> 44.0.3.0/24 23.0.0.3 0 65001 i
R2#show ip bgp 11.0.1.0
BGP routing table entry for 11.0.1.0/24, version 22
Paths: (1 available, no best path)
Not advertised to any peer
Refresh Epoch 1
100 (history entry)
12.0.0.1 from 12.0.0.1 (11.0.3.1)
Origin IGP, metric 0, localpref 100, external
Dampinfo: penalty 1681, flapped 2 times in 00:04:29
Step 4: Flap the loopback interface 1 of router R1 4 times till the penalty limit reaches
R1:
interface loopback 1
shutdown
*Jun 30 09:37:19.550: %LINK-5-CHANGED: Interface Loopback1, changed state to
administratively down
*Jun 30 09:37:20.550: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1,
changed state to down
no shutdown
*Jun 30 11:01:35.817: %LINK-3-UPDOWN: Interface Loopback1, changed state to up
*Jun 30 11:01:36.817: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1,
changed state to up
shutdown
*Jun 30 09:37:19.550: %LINK-5-CHANGED: Interface Loopback1, changed state to
administratively down
*Jun 30 09:37:20.550: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1,
changed state to down
no shutdown
*Jun 30 11:01:35.817: %LINK-3-UPDOWN: Interface Loopback1, changed state to up
*Jun 30 11:01:36.817: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1,
changed state to up
shutdown
*Jun 30 09:37:19.550: %LINK-5-CHANGED: Interface Loopback1, changed state to
administratively down
*Jun 30 09:37:20.550: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1,
changed state to down
no shutdown
*Jun 30 11:01:35.817: %LINK-3-UPDOWN: Interface Loopback1, changed state to up
*Jun 30 11:01:36.817: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1,
changed state to up
Step 5: Verify output 3 mins after on router R2
R2#debug ip bgp dampening
BGP dampening debugging is on for all address families
R2#
*Jun 30 11:00:46.144: EvD: charge penalty 1000, new accum. penalty 1000, flap count 1
*Jun 30 11:00:46.144: EvD: unsuppress item left in reuse timer array with penalty 1000
*Jun 30 11:00:46.144: BGP(0): charge penalty for 11.0.1.0/24 path 100 with halflife-time 15
reuse/suppress 750/2000
*Jun 30 11:00:46.144: BGP(0): flapped 1 times since 00:00:00. New penalty is
*Jun 30 11:34:18.947: BGP(0): suppress 11.0.1.0/24 path 100 for 00:24:00 (penalty 2284)
*Jun 30 11:34:18.947: halflife-time 15, reuse/suppress 750/2000
*Jun 30 11:34:18.947: EvD: accum. penalty 2284, now suppressed with a reuse intervals of
144
R2#show ip bgp 11.0.1.0
BGP routing table entry for 11.0.1.0/24, version 26
Paths: (1 available, no best path)
Not advertised to any peer
Refresh Epoch 1
100, (suppressed due to dampening), (received & used)
12.0.0.1 from 12.0.0.1 (11.0.3.1)
Origin IGP, metric 0, localpref 100, valid, external
Dampinfo: penalty 2266, flapped 4 times in 00:33:43, reuse in 00:01:59
R2#show ip bgp
BGP table version is 26, local router ID is 22.0.3.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*d 11.0.1.0/24 12.0.0.1 0 0 100 i
*> 11.0.2.0/24 12.0.0.1 0 0 100 i
*> 11.0.3.0/24 12.0.0.1 0 0 100 i
*> 22.0.1.0/24 0.0.0.0 0 32768 i
*> 22.0.2.0/24 0.0.0.0 0 32768 i
*> 22.0.3.0/24 0.0.0.0 0 32768 i
*> 33.0.1.0/24 23.0.0.3 0 0 65001 i
*> 33.0.2.0/24 23.0.0.3 0 0 65001 i
*> 33.0.3.0/24 23.0.0.3 0 0 65001 i
*> 44.0.1.0/24 23.0.0.3 0 65001 i
*> 44.0.2.0/24 23.0.0.3 0 65001 i
*> 44.0.3.0/24 23.0.0.3 0 65001 i
R2#show ip bgp dampening flap-statistics
BGP table version is 26, local router ID is 22.0.3.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network From Flaps Duration Reuse Path
*d 11.0.1.0/24 12.0.0.1 4 00:39:09 00:07:34 100
Task 2: Configure and define BGP Dampening Parameters
Step 1: Set BGP Dampening parameters using route-map
R2:
access-list 1 permit 11.0.1.0
route-map selective_dampening permit 10
set dampening 5 1900 2000 10 // 5=half-life, 1900=reuse limit, 2000=suppress
exit limit, 10=max-suppress-limit
router bgp 65002
address-family ipv4
bgp dampening route-map selective_dampening
exit
*Jun 30 11:51:20.469: BGP(0): Created dampening structures with halflife time 5,
reuse/suppress 1900/2000
Step 2: Verify BGP Dampening parameters
R2#show ip bgp dampening parameters
dampening 5 1900 2000 10 (route-map selective_dampening 10)
Half-life time : 5 mins Decay Time : 575 secs
Max suppress penalty: 7600 Max suppress time: 10 mins
Suppress penalty : 2000 Reuse penalty : 1900