08-05-2007 12:34 PM - edited 03-05-2019 05:43 PM
hi can someone tell me how to install a static route based on certain condition ? and remove it if that condition is no more met ? i know that there is a way of doing it but i m not able to remember how so some one help me out on this
thanks
08-05-2007 12:38 PM
Ovais,
What you are looking for is reliable static route feature. Please refer to the following URL for more information:
http://www.cisco.com/en/US/products/sw/iosswrel/ps5413/products_feature_guide09186a00801d862d.html
Hope this helps,
08-05-2007 12:40 PM
ip route [destination ip] [destination subnet] [gateway] [track]
You need to create a track that if valid the ip route will be installed in the RIB.
http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hirp_r/rte_pih.htm#wp1134595
08-05-2007 01:20 PM
ok i got it but i m not able to understand how the track object works can u explain me with a simple example ?
thanks
08-05-2007 01:30 PM
It uses the cisco IP SLA feature
We generally configure a IP SLA monitor that uses the ICMPecho functionality and tracks the reachability of destination specified.
We then bind this to the static route as Edison quoted above. When the destination specified is not reachable then that route is flushed from the table. This technique helps as you can have the IP SLA destination multiple hops away and still flush out the static route entry for a failure not with the immediate nexthop.
HTH
Narayan
08-05-2007 01:30 PM
Let's say if you wanted to install a default route based on the S0/0 being up.
track 1 interface s0/0 line-protocol
ip route 0.0.0.0 0.0.0.0 [gateway] track 1
http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hiap_r/apl_t1h.htm#wp1129487
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