cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3124
Views
0
Helpful
6
Replies

Delay redistribution Based on BGP Peer Status change

amvita
Level 1
Level 1

Is there a mechanism that will allow me to delay the redistribution of routese from BGP>OSPF and OSPF>BGP until the BGP Peer has been established for a set period of time, say 15 minutes?  this would also need to account for a "flapping" peer and reset the timer

1 Accepted Solution

Accepted Solutions

I don't know why you're using multiple events here.  I was thinking:

event manager environment q "

!

event manager applet bgp-up

event system pattern "BGP.*neighbor 10.0.0.114 Up"

action 001 cli command "enable"

action 002 cli command "config t"

action 003 cli command "event manager applet bgp-up-timer"

action 004 cli command "event timer countdown time 900"

action 005 cli command "action 1.0 cli command enable"

action 006 cli command "action 2.0 cli command $q config t$q"

action 007 cli command "action 3.0 cli command $q router bgp 1$q"

action 008 cli command "action 4.0 cli command $q redistribute ospf 1$q"

action 009 cli command "action 5.0 cli command end"

action 010 cli command "end"

!

event manager applet bgp-down

event syslog pattern "BGP.*neighbor 10.0.0.114 Down"

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "no event manager applet bgp-up-timer"

action 4.0 cli command "router bgp 1"

action 5.0 cli command "no redistribute ospf 1"

action 6.0 cli command "end"

View solution in original post

6 Replies 6

Joe Clarke
Cisco Employee
Cisco Employee

There is no magic to EEM.  Whatever you can do with CLI or SNMP you can automate with EEM.  In this case, the only way to prevent redistribution, you will have to add distribute lists (then remove them) or add the redistribute command only when you confirm the BGP peer session has been up long enough.

amvita
Level 1
Level 1

Thank you for the reply. I'm new to EEM and quickly learning the power of this tool.

Ive written an applet to remove the redistribute commands Triggering on a syslog event of %BGP.*neighbor 10.0.0.114 Down

The problem Im having is getting the redistribute commands back in but pnly after the peer has been up for the defined period of 15minutes or more following the Down event mentioned above.

I've written an applet but can't seem to get the trigger to work as expected.

Is there a way to start a 15 minute timer upon a syslog event of "%BGP.neighbor 10.0.0.114 Up" after which the actions for the cli commands to redistribute routes can be run. Also, can the timer be reset if during the 15 minute period the syslog event "%BGP.neighbor Down" occurs?

Sent from Cisco Technical Support iPhone App

Have your "Up" applet configure another EEM countdown applet with a time of 900 seconds.  That applet will reconfigure the redistribute commands.

Not sure what you mean.  Here's my script:


event manager applet BGP-UP-STABLE
event tag BGP-DOWN syslog pattern "%BGP.*neighbor 10.0.0.114 Down"
event tag BGP-STABLE snmp oid 1.3.6.1.2.1.15.3.1.16 get-type next entry-op gt entry-val "120" poll-interval 1
event tag BGP-UP syslog pattern "%BGP.*neighbor 10.0.0.114 Up"

trigger occurs 1 period 130
  correlate event BGP-STABLE and event BGP-UP andnot event BGP-DOWN
  attribute tag BGP-STABLE occurs 2
action 10.0 syslog msg "BGP-PEER Stable!!!"

I don't know why you're using multiple events here.  I was thinking:

event manager environment q "

!

event manager applet bgp-up

event system pattern "BGP.*neighbor 10.0.0.114 Up"

action 001 cli command "enable"

action 002 cli command "config t"

action 003 cli command "event manager applet bgp-up-timer"

action 004 cli command "event timer countdown time 900"

action 005 cli command "action 1.0 cli command enable"

action 006 cli command "action 2.0 cli command $q config t$q"

action 007 cli command "action 3.0 cli command $q router bgp 1$q"

action 008 cli command "action 4.0 cli command $q redistribute ospf 1$q"

action 009 cli command "action 5.0 cli command end"

action 010 cli command "end"

!

event manager applet bgp-down

event syslog pattern "BGP.*neighbor 10.0.0.114 Down"

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "no event manager applet bgp-up-timer"

action 4.0 cli command "router bgp 1"

action 5.0 cli command "no redistribute ospf 1"

action 6.0 cli command "end"

Joeseph,

Thank you immensely for your assistance on this.  I was making it out to be more complicated that it needed to be.  Thanks for clueing me into the environmental varialbe for the "

--Anthony