Olivier Guillemain has asked an interesting question: “how could I originate a default route into OSPF based on IP SLA (for example, based on pinging a remote IP address)?”
This is very easy to do when the router originating the default route into OSPF needs an SLA-based default route itself:
- Configure IP SLA and a corresponding track object;
- Configure a default route using reliable static routing
- Advertise the default route into OSPF with the default-information originate router configuration command
The solution is a bit more complex when the router originating the default route into OSPF should not have a default route. In this case, you could use a routing trick:
- Configure IP SLA and a corresponding track object as before;
- Use reliable static routing to configure a static host route for a bogus IP address (for example, 10.0.0.1/32) pointing to null0 (for example, ip route 10.0.0.1 255.255.255.255 null 0 track 100). Obviously this host route should not be redistributed into any routing protocol.
- Conditionally advertise default route into OSPF based on presence of the static host route.
Note: This article is part of You've asked for it series.
Posted to Cisco IOS Hints and Tricks by IvanPepelnjak
©Copyright Ivan Pepelnjak