Suppose if you have two internet links if one gets down, how you will set up redundancy?

To check the connectivity we can use the IP SLA feature in Cisco IOS which will be constantly pinging the internet address as soon as the icmp check will fail it will change the priority of the route so the traffic will get out through the other link.

First we create our IP SLA cinfig. In this example we want to ping the default gateway so we can check if the internet connectivity is working

Next we create a local routing policy to use our newly created route map.

ip local policy route-map DEFAULT-ROUTE-POLICY

Finally we put in our default routes. The first default route points to our preferred provide and we append the tracking to it. We then add the second default route with a higher weight (floating static route). What this does for us is the router will track the preffered default route. If for some reason we lose connectivity (from the IPS SLA) the route will be removed and any secondary default route will be added. In this example the new default route will point to 150.150.150.10