Up to this point, we've implemented and verified PBR.
But it's really just for routed traffic-- traffic
coming into the router, where it takes a look,
looks for a match, and then sets the next hop,
and does policy based routing based on that match.
However, the router needs to take-- if we want the router,
I should say, to take its own advice--
to do policy based routing based on traffic it generates--
maybe the router is sending a ping out, or sending an update,
or it's sending a response back to it
for an SSH session or an API call.
We can go ahead and based on route maps and conditions-- WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
We can go ahead and based on route maps and conditions--
we can train the router, for locally generated traffic,
to follow those instructions by applying that policy
to the router itself.
So in this video and hands on lab,
I'd like to walk you through setting up a scenario where
we can both implement and verify policy based routing
for locally generated traffic.
And to do that let's use this topology.
So let's use this topology.
And I've got R7 over here on the left.
It's got a loopback of 7, 7, 7, 7.
Awesome.
And R8 has a loopback of 8, 8, 8, 8. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And R8 has a loopback of 8, 8, 8, 8.
Those are both reachable.
And there's a period there.
Let me go ahead and get rid of that--
after the 8.
There we go.
There is a reach ability in OSPF.
And the path-- we'll verify this,
too-- the path from 7, 7, 7, 7 to 8, 8, 8, 8--
if we did trace, it would go this direction here.
And the response would go that direction, as well.
But what we could do, if we wanted to,
we could go ahead and specify that we want to do PBR on R7,
and apply that policy locally until R7-- WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
and apply that policy locally until R7--
for traffic you generate-- if you did a ping to 8, 8, 8,
8 from 7, 7, 7, 7--
then, instead of using the routing table, just--
boom-- send it right here.
And that would be a great example
and easy to verify with PBR or locally router
generated traffic.
So let's do this.
In the lab, if you're logged on to the CBC Nuggets website,
click on the link for the virtual lab.
Let's do this together.
What we'll do it we'll first verify the path
that it would normally take for a ping
from 7, 7, 7, 7 to 8, 8, 8, 8 or our trace route.
And then we'll go ahead and do PBR. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And then we'll go ahead and do PBR.
And then we'll verify that R7's behavior is changed,
or locally generated traffic, as it follows the PBR
instructions.
And here we go.
Let's start off on our 7's.
Let's verify what we're starting with.
That's important.
Let's do a trace.
Do 8, 8, 8, 8--
sourcing it from loop x0, which is our 7, 7, 7, 7 address.
And sure enough, it goes to R5, to R3,
to R1 based on the last octet-- the 2 to 4 to 6 to 8.
Great.
Fantastic.
So let's do a show IP policy. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So let's do a show IP policy.
Make sure we don't have any policies to begin with.
Great.
And now let's do this.
Let's create an access control list.
Access-- I'm just going to do an extended number
to access control list.
And we'll do a permit of all IP traffic from hosts 7, 7, 7 to--
or octet to that--
and going to 8, 8, 8, 8.
And it says, Keith, permit IP host.
Oh yeah.
We probably want to put a host in front of the last one, too. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
We probably want to put a host in front of the last one, too.
There we go.
I'll do it.
So there's our access control list or the PBR
that we're going to set up.
So next let's create a route map with route dash map.
And let's call this--
I'm going to call it direct.
And then I'm going to press enter.
Now that automatically assumes a permit.
It also assumes a sequence number of 10.
So I'm saving a few steps by taking some of those defaults.
Let's do a match IP address.
And we'll specify access list 100. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And we'll specify access list 100.
Right there.
And if there is a match, what do we want to do?
Set-- oh, let's take a look at the interfaces.
Let's do show IP interface brief.
And the link between R7 and R8 is this network right here--
the 10.78.0 network.
So I'm going to just copy that part right there.
And let's do a set IP next hop.
And we'll put in--
I'm just going to right click, and put in dot 8.
And that's the IP address on that serial link.
I'll show you right here. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
I'll show you right here.
Over on serial 3 slash 2 on R8.
That way, we can just do a straight shot from R7 to R8
for the initial flow of traffic.
Now, the reply, from R8's perspective,
is going to go back the long direction,
because R8, based on its routing table and no PBR,
is going to forward as it normally did.
So that's OK.
We're taking care of R7 at the moment--
PBR on R7.
So we'll go ahead and specify that next hop.
And then we'll do an exit.
And then, how do we apply this?
And the key is, from global configurations--
IP local policy, and then the keyword route map, and then WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
IP local policy, and then the keyword route map, and then
the name of that policy, which is direct.
I'm going to go ahead and copy that.
Paste it in.
Boom.
And it's done.
And if we do a show IP policy and press enter--
so here it says, that the interface--
instead of seeing a physical interface--
it's referring to the keyword local, mean--
myself says to the router any traffic I generate,
I'm going to compare against this route map
and treat it differently if it matches.
So if we do a show route map, and we do a show access list-- WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So if we do a show route map, and we do a show access list--
which is what we're matching on--
and then the show IP policy where it's applied--
now if we did a--
let me just hit the up arrow key a few times.
If we did a trace route to 8, 8, 8, 8,
sourcing it from loop x0--
instead of going all the way around the horn,
it's going to go ahead and just go directly over to R8--
or at least that's our intent.
Yep.
There it is.
Now the request-- or the actual ping request
went that direction.
But the responses from R8, based on its routing table, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
But the responses from R8, based on its routing table,
would have gone back the traditional method.
And then we could also do a debug of IP policy right here,
and do that trace route again.
And we're going to see that we have the matches.
Where if we did the trace route but
we didn't source it from loop x0--
meaning we'd source it from the interface,
from a routing perspective, that was close to the destination--
it would match.
So it's going to go the long way because it's not matching
our PBR on the local router.
So I'd like to thank you for joining me
in this set of videos on PBR--
policy based routing.
And I look forward to seeing you in the next set of videos WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And I look forward to seeing you in the next set of videos
here at CBT Nuggets.
Meanwhile, I hope this has been informative for you,
and I'd like to thank you for viewing.