cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1121
Views
0
Helpful
5
Replies

Delayed Route Redistribution

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 5 minutes?                  

5 Replies 5

John Blakley
VIP Alumni
VIP Alumni

You might be able to do this with an EEM script, but generally redistribution is immediate as soon as the routes appear in the routing table.

HTH,

John

*** Please rate useful posts ***

HTH, John *** Please rate all useful posts ***

Not much experience with EEM scripts, but I'll look into it.  I was thinking along the lines of using IP SLA to test reachability of the Peer.

I'm not aware of being able to do this with SLA, but you can use EEM. Here's a script (I haven't tested) that should work:

event manager applet RemoveRedist

event syslog pattern "%BGP.*neighbor 192.168.1.1.*Down"

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "router bgp 1"

action 4.0 cli command "no redistribute ospf 1"

action 5.0 cli command "router ospf 1"

action 6.0 cli command "no redistribute bgp 1"

action 7.0 cli command "Redistribution has been removed"

event manager applet AddRedist

event tag bgp syslog pattern "%BGP.*neighbor 192.168.1.1.*Up"

event tag addRoute timer countdown 300

correlate event bgp and event addRoute

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "router bgp 1"

action 4.0 cli command "redistribute ospf 1 match internal external"

action 5.0 cli command "router ospf 1"

action 6.0 cli command "redistribute bgp 1 subnets"

action 7.0 cli command "Redistribution has been readded"

The part that I haven't been able to test is the correlation of events. I believe this should work in the sense that once the bgp neighbor comes back up and 5 minutes has passed, then the script will run and readd your redistribution lines to your routing processes. You'd want to substitute your BGP neighbor's IP for the addresses that I used above.

HTH,

John

**** Please rate useful posts ****

HTH, John *** Please rate all useful posts ***

John,

You put me on the right track with the script.  I've tested it in the lab, but was wondering if there was a way to put in a conditional loop that would restart the counter should the BGP peer relationship go down prior to the 5 minute counter elapsing.

--Anthony

Unfortunately, you may need to write a tcl script for this. I'm not 100% sure of a way to do it, so I'd like to refer you to the eem scripting forum:

https://supportforums.cisco.com/community/netpro/network-infrastructure/eem

Joseph Clarke is awesome in scripting for both tcl and eem. If you post the script that I gave you, he'd probably be able to reduce it down to 2 lines

HTH,

John

*** Please rate useful posts ***

HTH, John *** Please rate all useful posts ***
Review Cisco Networking for a $25 gift card