cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2319
Views
30
Helpful
21
Replies

Supress flapping BGP neighbors

lionell01
Level 1
Level 1

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.

1 Accepted Solution

Accepted Solutions

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.

eem.png

 

View solution in original post

21 Replies 21

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"


https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipsla/configuration/xe-3se/3650/sla-xe-3se-3650-book/sla_icmp_jitter.pdf

""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

 

Can you check the following 
use selective BGP dampening with

 route-map 

and use match neighbor.

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

Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

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?

 

Are next hop same?

No selective dampening using match next hop.

 

No, all

next-hop

IPs are different.

Appreciate if you can help with useful articles.

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

Friend I check and find that Selective damping base on 
AS-PATH <-this is same 
Community <- you can match it
Prefix <- this is same  


gjkgjkgjkgj.png

please check this note

Yes,

next-hop

tracking supports dampening and that will track the specific neighbor who is flapping

EdgarMurray8920
Level 1
Level 1

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.

good suggest but  he ask more automate solution.
but thanks for sharing this solution

Then as you and others suggested, he would have to use BGP dampening

Review Cisco Networking for a $25 gift card