cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1073
Views
5
Helpful
3
Replies

Static IP Route Removal w/tracking

FMoLo
Level 1
Level 1

I am trying to get a static route added or removed based on the reachability to another IP on the network.  Basically if the switch cannot reach this IP then it should remove or add the route.   So below is just an example config, I would like the ip route to be removed for 2.2.2.2 going towards 1.1.1.1 if the switch is unable to reach 3.3.3.3.

 

ip route 2.2.2.2 255.255.255.255 1.1.1.1 name test track 1

ip host test 3.3.3.3 

track 1 ip sla 1 reachability

3 Replies 3

ammahend
VIP
VIP

I think you can do this using EEM script, here is a good example.

https://community.cisco.com/t5/routing/ip-sla-to-remove-route/td-p/3788342

 

-hope this helps-

I configured and the IP is unreachable but the route wasn't removed.  My config is below with the track status at the bottom.

 

ip sla 1
icmp-echo 13.35.112.69
frequency 300
timeout 6000
ip sla schedule 1 life forever start-time now

track 1 ip sla 1 reachability
default-state up
delay down 8 up 10


event manager applet REMOVE_ROUTE
event track 1 state down
action CON cli command "enable"
action EN cli command "config t"
action RTE cli command "no ip route 2.2.2.2 255.255.255.255 1.1.1.1"


Track 1
IP SLA 1 reachability
Reachability is Down
3 changes, last change 00:25:48
Delay up 10 secs, down 8 secs
Latest operation return code: Timeout
Tracked by:
EEM applet REMOVE_ROUTE

you can run PBR with availability as show below in my lab
ghghghfghghfghfhhhg.png

Review Cisco Networking for a $25 gift card