06-08-2016 12:17 PM - edited 03-08-2019 06:07 AM
hi out there
I have a setup vhere I need to open og close a vasi interface based on the occurence of a route in a vrf - can I track a route and then use a script to shut or no shut a particular interface if this route shows up?
Solved! Go to Solution.
06-08-2016 03:57 PM
Hey,
Can you please try something like this?
This will track the route 2.2.2.0/24 and shutdown the lo interface if the route available and unshut the interface if the route is not available.
track 1 ip route 2.2.2.0 255.255.255.0 reachability
event manager applet Run-If-Route-Available
event track 1 state up
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "int lo0"
action 1.4 cli command "sh"
action 1.4 cli command "end"
action 1.6 syslog msg "Interface lo0 is admin DOWN now"
event manager applet Run-If-Route-Not-Available
event track 1 state down
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "int lo0"
action 1.4 cli command "no sh"
action 1.4 cli command "end"
action 1.6 syslog msg "Interface lo0 is UP now"
CF
06-08-2016 03:57 PM
Hey,
Can you please try something like this?
This will track the route 2.2.2.0/24 and shutdown the lo interface if the route available and unshut the interface if the route is not available.
track 1 ip route 2.2.2.0 255.255.255.0 reachability
event manager applet Run-If-Route-Available
event track 1 state up
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "int lo0"
action 1.4 cli command "sh"
action 1.4 cli command "end"
action 1.6 syslog msg "Interface lo0 is admin DOWN now"
event manager applet Run-If-Route-Not-Available
event track 1 state down
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "int lo0"
action 1.4 cli command "no sh"
action 1.4 cli command "end"
action 1.6 syslog msg "Interface lo0 is UP now"
CF
06-08-2016 11:55 PM
hi Again
yep - this looks like something which i was thinking of - the only little problem is - can it be made depending on a route in a given vrf? my problem is that it is a ivrf from a cryptomap ipsec where I have to activate a vrf for nat'ing the Networks in case of a failover
So I have the ivrf - if the route suddenly show up because of a failover - injected trough RRI - i need to open a vasi interface which will be a simple nat inside
The only little tweak needed is that if this track can track a route in a given vrf...
And - if I look here this should be possibly:
http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipapp/configuration/12-4/iap-12-4-book/iap-eot.html#GUID-FDCACD5E-0F4C-43C8-8770-93CC8883D0A6
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: