06-08-2022 02:54 AM - edited 06-08-2022 02:55 AM
Hello!
We have about 4 eBGP neighborships with our customer devices and the links are often highly unstable (international submarine cable issues and the like).
This causes the BGP neighborships to flap.
- We're using BFD
- All neighbors advertise the same routes to us and we to them
- Local preference is used to set an order for outbound routing
- AS path prepend is used to influence inbound routing
- If a preferred neighbor goes down, the traffic fails overs to the next but then falls back to the preferred neighbor once it's back up
- This causes issues especially during multiple link flaps and we also have voice traffic on this
Is there a way to force the flapping BGP neighborship to stay down until the link stabilizes (maybe as measured by ICMP)?
Route-dampening won't work here I think as all neighbors are advertising the same routes.
Had read about EEM but that needs manual intervention to get the neighbor backup. Looking for something more automated.
Solved! Go to Solution.
07-07-2022 11:19 AM
in your case not the route is flap the neighbor is flapping
I do small lab for using IP SLA for add remove the neighbor from BGP config,
take look.
06-08-2022 04:08 AM - last edited on 08-17-2022 04:10 AM by Translator
Hello,
I think you could use EEM scripts in combination with IP SLAs that use icmp-jitter operations. The scripts are fully automated and do not require manual intervention.
The EEM script would shut the respective neighbor when the IP SLA is down, and efour nable it when the IP SLA is up. In the example below, the default interval and packets are being used, you can change these values according to what your network is actually experiencing (see the document linked below).
For four ISPs you would need eight scripts. Below is a sample (BGP neighbors are 1.1.1.2/2.2.2.2/3.3.3.2/4.4.4.2:
track 1 ip sla 1
!
ip sla 1
icmp-jitter 1.1.1.2 source-ip 1.1.1.1
!
ip sla schedule 1 start-time now life forever
!
event manager applet ISP_1_BGP_DOWN
event track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "router bgp 65535"
action 4.0 cli command "neighbor 1.1.1.2 shutdown"
action 5.0 cli command "end"
!
event manager applet ISP_1_BGP_UP
event track 1 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "router bgp 65535"
action 4.0 cli command "no neighbor 1.1.1.2 shutdown"
action 5.0 cli command "end"
track 2 ip sla 2
!
ip sla 2
icmp-jitter 2.2.2.2 source-ip 2.2.2.1
!
ip sla schedule 2 start-time now life forever
!
event manager applet ISP_2_BGP_DOWN
event track 2 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "router bgp 65535"
action 4.0 cli command "neighbor 2.2.2.2 shutdown"
action 5.0 cli command "end"
!
event manager applet ISP_2_BGP_UP
event track 2 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "router bgp 65535"
action 4.0 cli command "no neighbor 2.2.2.2 shutdown"
action 5.0 cli command "end"
track 3 ip sla 3
!
ip sla 3
icmp-jitter 3.3.3.2 source-ip 3.3.3.1
!
ip sla schedule 3 start-time now life forever
!
event manager applet ISP_3_BGP_DOWN
event track 3 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "router bgp 65535"
action 4.0 cli command "neighbor 3.3.3.2 shutdown"
action 5.0 cli command "end"
!
event manager applet ISP_3_BGP_UP
event track 3 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "router bgp 65535"
action 4.0 cli command "no neighbor 3.3.3.2 shutdown"
action 5.0 cli command "end"
track 4 ip sla 4
!
ip sla 4
icmp-jitter 4.4.4.2 source-ip 4.4.4.1
!
ip sla schedule 4 start-time now life forever
!
event manager applet ISP_4_BGP_DOWN
event track 4 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "router bgp 65535"
action 4.0 cli command "neighbor 4.4.4.2 shutdown"
action 5.0 cli command "end"
!
event manager applet ISP_4_BGP_UP
event track 4 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "router bgp 65535"
action 4.0 cli command "no neighbor 4.4.4.2 shutdown"
action 5.0 cli command "end"
06-08-2022 04:25 AM - last edited on 08-17-2022 04:11 AM by Translator
""Route-dampening won't work here I think as all neighbors are advertising the same routes.""
I think that wrong, because the prefix will not check as prefix only but as
prefix/next-hop/path
06-08-2022 04:33 AM - last edited on 08-17-2022 04:13 AM by Translator
Can you check the following
use selective BGP dampening with
route-map
and use match neighbor.
06-08-2022 06:29 AM - last edited on 08-17-2022 04:14 AM by Translator
Hello
As stated by @MHM Cisco World bgp dampending would be applicable, as you could base it on preflix dampening from specific ISP ASNs
Example of such would be :
ip as-path access-list 1 permit ^2222$
route-map BGPDAMP
match as-path 1
set dampening 15 750 2000 60
router bgp x
bgp dampening route-map BGPDAMP
06-08-2022 08:02 AM
Thanks, Paul.
All 4 of the neighbors are in the same AS and advertise the same routes with the exact same attributes.
Would dampening still be a solution?
06-08-2022 08:14 AM
Are next hop same?
No selective dampening using match next hop.
06-08-2022 09:36 AM - last edited on 08-17-2022 04:18 AM by Translator
No, all
next-hop
IPs are different.
Appreciate if you can help with useful articles.
06-08-2022 09:58 AM - last edited on 08-17-2022 04:15 AM by Translator
hope the below config solve your issue
route-map DAMP
match next-hop
set dampening <value depend on your monitor>
router bgp x
bgp dampening route-map DAMP
06-10-2022 12:57 PM
Friend I check and find that Selective damping base on
AS-PATH <-this is same
Community <- you can match it
Prefix <- this is same
07-05-2022 03:33 PM
please check this note
06-08-2022 08:14 AM - last edited on 08-17-2022 04:17 AM by Translator
Yes,
next-hop
tracking supports dampening and that will track the specific neighbor who is flapping
06-08-2022 07:22 AM - last edited on 08-17-2022 04:16 AM by Translator
You can use a monitor and a
route-map
to change the metric of the route. Once the route comes back you use the monitor to check for stability and then you can change the metric again with the route map.
06-08-2022 07:28 AM
good suggest but he ask more automate solution.
but thanks for sharing this solution
06-08-2022 07:58 AM
Then as you and others suggested, he would have to use BGP dampening
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