- [Instructor] Now let's take a look at tracking objects
with IP SLA.
When we track objects,
we have the ability to control what happens
if the object we are tracking is up or down.
What we're going to look at here is in regard to static routes,
you can see in our topology,
we have a router connected out to two different ISPs.
So we have redundant internet connections
on two separate networks.
ISP one is in the 192.168.1.0/24 network.
And the ISP to router is in the 192.168.2.0/24 network.
Here on router one, if we say show IP route, static,
notice that we'll only see
a single static route entry listed here.
And that's the static route for ISP one.
Let's say show, run pipe to, begin IP route.
And take a look at that section of our running configuration
just to see exactly what's going on.
So you notice that I do have a static route entry
for both ISP routers.
But I have ISP two configured as a floating static route.
And a floating static route is simply a static route
with an administrative distance
that's set higher than default.
You might remember that the administrative distance
of a static route is one.
So I've configured the route to ISP two
with an administrative distance of two.
And that's what we see indicated here,
at the end of this command in our output.
So at the moment, we are ensured that all of the traffic
from router one is going to be routed through
the ISP one connection.
So let's go under the interface on this router
that's connected to ISP one, and that is interface, gig 0/1.
And let's actually shut down this interface.
And if we do that, and again, say do show IP route, static.
And this time, you'll notice our static route entry
has changed, it's changed to that of ISP two.
So now all of our traffic is going through
the ISP two router when connected instead,
if we go ahead and bring that interface back up
with a no shut command.
And then if we again, run the same show command,
do show IP route static,
you'll see that things are back to their original state.
So all of our traffic is again,
being routed through ISP one.
So that's a great redundancy measure.
But in itself, it's not foolproof,
the static route for ISP one is going to remain
in the routing table unless the interface goes down.
So what happens if the link to ISP one is still up?
What happens if that interface is up,
but maybe there's a problem with the ISP one router
or maybe the route becomes unreachable on the other side?
Well, in that case, our traffic would still cease.
And that's no good, however, we can build on this
by using object tracking with IP SLA
to automate this kind of failover feature.
So let's look at how we can do that.
We're still on router one, and if we say show run,
pipe to begin IP SLA, we shouldn't get an output here.
And we don't, so that verifies that we don't currently
have IP SLA configured on this router.
So let's just create a very simple IP SLA.
We'll want to do a simple ping probe to the ISP one router.
So under global configuration mode,
let's say IP SLA, we need to give that an entry number,
I'll choose entry number one.
And if we look, I hit Enter and look at contextual help,
and the option that I am going to use, is ICMP hyphen echo.
And that's going to give us just a very simple ping test
over to the ISP one router.
We want to follow that with the IP address
for the ISP one router, which is 192.168.1.2.
We can hit Enter there.
If we look at our contextual help options again,
I'm going to choose the timeout option.
So the timeout keyword is going to set
a timeout value in milliseconds.
So I'm going to set that to 5000,
and for the frequency, I'll just say every 10 seconds,
and we can exit there.
So now what we have is this is going to ping the ISP router
every 10 seconds.
And if a response isn't received
within the 5000 millisecond window,
the router is going to be assumed to be unreachable.
So let's now go ahead and start our probe.
So we'll say IP SLA schedule, I'll say entry number one,
for the start time, I want to start that now.
And for the lifetime, I'll go ahead and say forever.
So we've put that in place,
and now our probe has been started.
Let's exit here and just do a quick show IP SLA
configuration one just to verify everything.
So we see our target is the ISP one router,
we're doing an ICMP echo.
And the start time has already passed.
So this probe is up and going.
If we say, show IP SLA statistics for one,
you can see that we already have some successes,
we have three successes, zero failures,
so that is already populating.
Now let's configure a tracking object for this.
Back under global configuration mode, we can say track.
And you'll see that we need to give that an object number.
So I'll say one, IP SLA, one.
So this is tracking object number one,
for IP SLA configuration one.
And by the way, I typically use the same tracking
and entry numbers between these things,
just so they correspond easy for identification later on.
So if we have that we look at contextual help,
you'll see that we have a couple of options here,
we have state and reachability.
If we simply hit Enter state is the default option.
And so that's going to just check for the basic up state,
we actually want to choose reachability,
which will also examine the timeout settings
that we've configured.
So we'll hit Enter, and that's it.
We'll exit there, and we'll say show track.
And you can see the state of our tracking object,
it tells us the reachability is up,
tells us the latest round trip time, two milliseconds,
that's well under the 5000 millisecond threshold
that we set.
And we can also see that the last time
that a change was made on that,
which was approximately five seconds ago,
because obviously I just configure this.
So now that we have that, let's say show IP route.
And this is just going to again verify
that we're still using the static route going to ISP one.
Now the next thing we want to do is we want to remove
this original static route for ISP one,
and we want to replace that with a static route entry
that's using IP SLA.
So back under global configuration mode,
we can say no IP route.
And we're just going to remove that entry for ISP one
from our static routing table.
So it's IP route, we have the all zeros
and the IP address of ISP one, so we're going to remove that.
And we want to actually place that back now
with a little bit of a variation.
And the same IP address.
But this time, we want to say track one,
so we're going to attach tracking object number one to that.
And what this is telling our router is,
as long as this tracking object is in the upstate,
we want this static route to be installed
in the routing table.
If the object is down, then we want to remove this route,
and we want to fail over to ISP two.
So let's exit here, and let's just verify
by saying show IP route.
And we do still have ISP one in there, as we would expect.
So let's jump over to our ISP one router.
And let's go under interface gig zero slash one,
which is the interface that's pointing over to router one.
And let's say shut up just to shut down that interface.
If we go back to router one, in just a moment,
we're going to receive a console message telling us that
our tracking object has actually gone into the down state,
so we'll give that just a bit of time to populate in there.
And there we see that now,
tracking state IP SLA one reachability has gone from up
to down, that's exactly what we would expect to see.
If we again run our show command for that
and say show track,
this time it tells us the reachability is down.
It tells us we have a history of two changes
when I enabled it and when we just lost connectivity.
The last change was around 20 seconds ago,
the return code was a timeout value.
So if we say now show IP route,
notice that our static route has now changed
to that of ISP two.
So now all of our traffic is being routed through
the ISP two router just as we would want.
If we say show IP route static,
this verifies again, that ISP two is in use for our network.
Let's go back to ISP one.
And let's say no shut to bring that interface back up.
And if we go back to router one,
we'll give that just a few moments.
And we'll see a message again, letting us know
that our tracking object is back into the upstate.
And there you see that pop into our console,
we have a message telling us that the reachability
has gone from down to up for the track one IP SLA one.
So we'll do one more quick show IP route static.
And now you see that our original ISP one route
is back in place.
So when you're dealing with tracking objects,
that show track command is going to be very, very helpful
to see the current status of your tracking object.
If you're not getting the desired effect
or if you're not seeing a static route being removed
from the table in the way that we've examined here,
it's likely that you've misconfigured object tracking
or that you need to replace your static route entry
with one that uses IP SLA.