08-19-2013 06:41 AM - edited 03-07-2019 03:00 PM
Hi Guys,
A quick question regarding bgp dampening. Lets say router A is the redistribution point between ospf and bgp. Some routes learning from ospf on router A are redistributed into bgp. Can i configure bgp dampening on router A such a way that if specific routes (learnt from ospf) flap, router A supresses these routes and stop advertising to its bgp neighbors??
If not possible, any other option to acheive this?
Regards
Y
Solved! Go to Solution.
08-19-2013 02:47 PM
Hello,
I actually understood the question but my assumption that this would work was very wrong. I just tested this out with the following topology:
R1 (192.168.1.1)---------(192.168.1.2) R2 (192.168.2.2)-------(192.168.2.3) R3
R1 and R2 are eBGP peers, R2 and R3 are iBGP and OSPF peers as well. R3 has loopbacks lo1 and lo2 with IP addresses of 1.1.1.1/32 and 2.2.2.2/32 respectively. I am advertising these into OSPF:
R3#show run | section router ospf
router ospf 1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 0
network 2.2.2.2 0.0.0.0 area 0
network 192.168.2.0 0.0.0.255 area 0
On R2, I am redistributing OSPF routes into BGP:
R2#show run | section router bgp
router bgp 2
no synchronization
bgp log-neighbor-changes
bgp dampening
redistribute ospf 1
neighbor 192.168.1.1 remote-as 1
neighbor 192.168.2.3 remote-as 2
neighbor 192.168.2.3 next-hop-self
no auto-summary
I have applied bgp dampening on both R1 and R2. I shut down lo1 several times and while I can see dampening taking into effect on R1, I see no results on R2.
The reason for this is that dampening works on BGP route withdrawal updates. With a debug ip bgp dampening and debug ip bgp ipv4 unicast updates, we can clearly see that the dampening process only kicks in when a withdrawal update is received for a prefix. On R1:
BGP(0): 192.168.1.2 rcv UPDATE about 1.1.1.1/32 -- withdrawn
EvD: charge penalty 1000, new accum. penalty 1000, flap count 1
EvD: unsuppress item left in reuse timer array with penalty 1000
BGP(0): charge penalty for 1.1.1.1/32 path 2 with halflife-time 15 reuse/suppress 750/2000
BGP(0): flapped 1 times since 00:00:00. New penalty is 1000
On R2, even with the debugs on, no withdrawal updates are received for that prefix. This would be because R2 doesn't reallly have a BGP peer that stopped advertising this prefix - it simply had an OSPF peer which stopped sending this prefix. Once the loopback was shut, it was no longer advertised into OSPF and it was no longer redistributed into BGP. That does not constitute a 'flap' from a dampening perspective.
It is important to note that dampening happens not per perfix; it is per prefix-per path. Which is why a withdrawal message is what triggers the process.
I hope this helps.
Regards,
Aninda
08-19-2013 07:34 AM
Hello,
I am fairly new to BGP but I think it is possible. With BGP dampening, you can also pass a route -map to it. Within the route-map, you can match the specific routes that you are interested in (using an access-list etc). This should apply the dampening feature only to these specific routes and suppress them based on your timers.
Perhaps someone with more experience can confirm.
Regards,
Aninda
08-19-2013 12:28 PM
I am afraid you didn't understand the question. dampening can be done using route-map but the question was can we apply dampening on routes that are being redistributed from ospf into bgp on same router instead of learning them from ebgp neighbor.
Y.
08-19-2013 02:47 PM
Hello,
I actually understood the question but my assumption that this would work was very wrong. I just tested this out with the following topology:
R1 (192.168.1.1)---------(192.168.1.2) R2 (192.168.2.2)-------(192.168.2.3) R3
R1 and R2 are eBGP peers, R2 and R3 are iBGP and OSPF peers as well. R3 has loopbacks lo1 and lo2 with IP addresses of 1.1.1.1/32 and 2.2.2.2/32 respectively. I am advertising these into OSPF:
R3#show run | section router ospf
router ospf 1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 0
network 2.2.2.2 0.0.0.0 area 0
network 192.168.2.0 0.0.0.255 area 0
On R2, I am redistributing OSPF routes into BGP:
R2#show run | section router bgp
router bgp 2
no synchronization
bgp log-neighbor-changes
bgp dampening
redistribute ospf 1
neighbor 192.168.1.1 remote-as 1
neighbor 192.168.2.3 remote-as 2
neighbor 192.168.2.3 next-hop-self
no auto-summary
I have applied bgp dampening on both R1 and R2. I shut down lo1 several times and while I can see dampening taking into effect on R1, I see no results on R2.
The reason for this is that dampening works on BGP route withdrawal updates. With a debug ip bgp dampening and debug ip bgp ipv4 unicast updates, we can clearly see that the dampening process only kicks in when a withdrawal update is received for a prefix. On R1:
BGP(0): 192.168.1.2 rcv UPDATE about 1.1.1.1/32 -- withdrawn
EvD: charge penalty 1000, new accum. penalty 1000, flap count 1
EvD: unsuppress item left in reuse timer array with penalty 1000
BGP(0): charge penalty for 1.1.1.1/32 path 2 with halflife-time 15 reuse/suppress 750/2000
BGP(0): flapped 1 times since 00:00:00. New penalty is 1000
On R2, even with the debugs on, no withdrawal updates are received for that prefix. This would be because R2 doesn't reallly have a BGP peer that stopped advertising this prefix - it simply had an OSPF peer which stopped sending this prefix. Once the loopback was shut, it was no longer advertised into OSPF and it was no longer redistributed into BGP. That does not constitute a 'flap' from a dampening perspective.
It is important to note that dampening happens not per perfix; it is per prefix-per path. Which is why a withdrawal message is what triggers the process.
I hope this helps.
Regards,
Aninda
08-20-2013 06:32 AM
Aninda,
Thanks for simulating and the explaination. I also read more and reached to same conclusion. I didn't get the last part, the important note, can you please explain and also if you could give me source of this info.
"It is important to note that dampening happens not per perfix; it is per prefix-per path. Which is why a withdrawal message is what triggers the process."
Regards
Y
08-20-2013 08:00 AM
Hello,
Let's say that R1 also received the same prefix, 1.1.1.1/32 via a different router (and hence a different path) say R4 which is directly connected to R1. When R2 sends a withdrawal to R1, this triggers the dampening process ONLY for the 1.1.1.1/32 prefix that was learned from R2. The other prefix learned via R4 will remain unaffected.
In this manner, dampening applies only to a specific path for a specific prefix and not to every instance of the prefix in the BGP table. In our scenario, it is only being applied to the path via R2 for prefix 1.1.1.1/32.
I hope this clarifies what I meant by that statement.
Regards,
Aninda
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide