05-31-2024 04:13 AM
I need to run EMM script in router that it will generate sys log whenever router stop receiving prefix from BGP peer.
please cross check below script once.
Wool(config )# event manager trap prefix_down
event community SNMP
event manager applet prefix_down_applet
!
event manager applet prefix_down_applet
event prefix down 1
action syslog msg "BGP prefix down detected!"
event syslog pattern "BGP prefix down detected!"
05-31-2024 04:20 AM
event routing network x.x.x.x type remove <<- check this event it use to detect ADD/Remove prefix in RIB
MHM
05-31-2024 04:25 AM
Sorry didn't get you , do i need to give below command
event routing network x.x.x.x type
05-31-2024 08:09 PM
event routing network x.x.x.x type remove
command not working ( as our BGP neighbor is not directly connected )
06-01-2024 02:56 AM
I run EEM for add prefix via BGP and action is show specific message
in your case use same except replace the show message with the send to syslog
MHM
06-01-2024 08:04 AM
Thanks for output shared by LAB screenshot
but in my case R1 >> R2 >>R3
and i need script on R1 when prefix stop coming from R2 ( due to R2 & R3 BGP peer issue )
Note R2 --R3 is real ISP BGP in my case .
06-02-2024 01:41 AM
In R1 if you receive prefix via bgp from R3 via R2 then you can use same coded I share but change the type from add to remove.
MHM
06-02-2024 06:02 AM
Hello MHM,
I created LAB with 3 router R1, R2 and R3 (eBGP between them)
applied same EMM as shared by you on R1, but when BGP fails between R2 &R3, loopback on R3 stopped advertising on R1 but, no sys log generated on R1 for this .
login
!
event manager applet BGP
event routing network 3.3.3.3/32 type remove protocol BGP >>>LOOPBACK on R3 router
action 1.0 puts "prefix are reduced due to ISP issue"
!
end
06-02-2024 06:13 AM
Are the prefix still appear in both R2 and R1
MHM
06-02-2024 06:24 AM
R1 has 5 prefixes received
R2 has 2 prefixes for R1 and 1 prefix for R3
R3 has 6 prefixes received
when BGP between R2 and R3 is down
R1 4 prefix and on R2 2 prefix for R1
06-02-2024 06:41 AM
Sorry I talk about your lab, are the R1 and R2 still have 3.3.3.3/32 in routing table
MHM
06-02-2024 08:24 AM
I created another loopback on R3 (100.100.100.100) and yes after BGP is down between R2&R3, I got alert on R1.
so, in my production environment I have to ask for the IP on ISP PE (R3 in my case) which is making BGP Peer with their CPE .
Or can I add my Dc router IP in the script?
thanks for the help
06-02-2024 08:46 AM
I check your pervious post and you need to add DC IP in script not PE ISP IP.
When DC IP remove you know that there is no more path to DC via ISP
MHM
06-02-2024 09:07 AM
Agree with you but problem from DC IP is, we will not sure which site has problem
as all my 15 sites are connected to ISP MPLS and then connected to DC.
hope i am thinking correctly or you have other way out.
06-02-2024 09:10 AM
I see in your previous post
branch - ISP - DC
what you meaning of 15 sites ?
MHM
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