In this video, we get to take a look at the configuration
and verification of local policies with policy-based routing.
Because by default, when we do policy-based routing,
we apply the policy to an interface
that's supplying to traffic coming in from another device
on that interface.
However, with the local policy with PBR,
we can tell the router, hey, guess what?
Traffic that matches the policy,
even if that's traffic that you generated
or self-Mr. router, we want you to go ahead
and do policy-based routing on that locally generated traffic.
So here's what I propose we do as an example.
Let's use our router we haven't used yet for this. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Let's use our router we haven't used yet for this.
Let's use our four.
So our four will be the router
where we're going to set up a local policy
with policy-based routing.
And let's specify that on our four traffic
that our four sources, if it's sourced
from the loopback zero interface, which is four.
four. four. four. four.
So if the source address is four, four, four, four,
and if the destination address is anywhere down here
on the 1017 network, so the 10.1.7.0/24,
so we'll use some wildcard bits in our ACL to indicate that.
And for the protocol, let's go ahead and just do all IPV4 protocols. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And for the protocol, let's go ahead and just do all IPV4 protocols.
So whether it's GRE or TCP or UDP or ICMP,
we'll just include it all.
And we'll focus primarily on the source
and destination address space.
Now currently the routing table says go north.
And if you're going to forward down
to this network right down here,
that's based on the OSPF that's currently set up.
And then our two is going to set it here
and our one's going to set down here,
our three is going to set it down here,
and our five is going to set it down here.
And before we actually set this up, let's take a moment WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
and just to verify that indeed is the case here on router four.
So let's head over to router four
and just verify a couple of things.
First of all, make sure you get on the right router.
Let's do a show IP interface brief
just to make sure it's loopback really is four, four, four, four, four.
And for a test, let's go ahead and do a ping down to PC7,
which is at 10.1.7.10.
So we'll do a ping to 10.1.7.10.
And we'll source it from loopback zero.
And sorry, says, yeah, that works.
And also the trace, so we'll swap out the word ping with trace. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And also the trace, so we'll swap out the word ping with trace.
And it wants to see, I'll give it the C
for the full word of trace, short for trace route.
And there's our path through the network.
So from R4, going to R2, then going to R1,
and then down the left hand side down to R7.
And that's for traffic that R4 itself is generating.
The ping was sourced and the trace route was sourced,
both here from R4.
So let's go ahead and create an access control list
to match on the traffic.
So we'll show access list to see what we're starting with.
Fantastic, we'll go into configuration mode.
Let's create access list 104, and we'll permit. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Let's create access list 104, and we'll permit.
And we'll specify IP, meaning any layer for protocol
will match in a suite of IPv4.
And for the source address, we'll use host
to match on the loopback address of 4444.
For the destination, we want to match on the 10.1.7 network.
And so for wildcard bits, we'll go in 0.0.0.0.255.
And that looks not good.
So in my mind, I said destinations,
I guess I started typing destinations,
but the destination is the 10.1.7 network.
And that looks even better.
So next let's create a route map. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So next let's create a route map.
Let's call it PBR.
And it'll go ahead and be a permit statement.
And we'll give it a sequence number of 10, an LL match,
on the IP address that's indicated in access list 104.
And we'll set the next top.
If that matches, we'll set the next top to 10.0.34.3.
And this just confirmed that address as well.
So that would be going over to 10.0.34.3,
which is the IP address of R3.
So previously, it routed up through R2,
then R1 to R3.
And once this PBR kicks in with the local policy, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And once this PBR kicks in with the local policy,
it'll forward directly over to R3 for that policy-based routing.
Now previously, when we're applying this to traffic
that's coming into the router, we apply it to an interface.
However, to apply this policy for the local router itself,
we're not going to get an interface.
We're going to use a global command
and that is IP local policy space.
And then we'll specify a route map and our route map name,
which is PBR.
So I'll put that in right there.
And then I'll type in N. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And then I'll type in N.
I should have pressed that in our first place.
Go ahead and do a control A. Say no, IP local policy,
because that PBR end doesn't exist.
Let the upper key a couple of times,
we want the local policy to be PBR.
And then we'll type in N.
And then we'll go into a show IP policy.
And this is showing us that we have a route map called PBR.
And the interface, instead of specifying gig 0, 0,
or gig 0, 1, et cetera, is local,
meaning traffic that is sourced by the router.
So previously, if we scroll up and we take a look at the path,
we did previously for traffic that was going to 10.1.7.10, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
we did previously for traffic that was going to 10.1.7.10,
sourced from the back zero, it went from R4
on the right-hand side of our topology.
And the next top was R2, we then set it to R1.
And what we're going to do now, based on traffic
the matches that policy, R4 is going to set that traffic
directly over to R3 instead of using the routing table,
which would normally forward it up to R2.
So let's go ahead and press enter,
let the up here key a few times, and do that same trace,
to 10.1.7.10, sourcing it from our loopback zero.
So check it out this time, instead of setting it WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So check it out this time, instead of setting it
to the next top of R2, which would be end with the dot 2,
it's going to direct the over to R3,
we then routed it through R5, R5 routed it through R7,
and then R7 delivered it to the client at dot 10.
Anybody did a debug IP policy and press enter?
Any traffic that is not matching the policy
would be routed normally.
And traffic that is matching the policy
would be routed based on the policy based routing.
So if we hit the upper key and do a trace again,
we should have some matches here,
and I'll do an undyboggall.
So in notes here, we have this traffic was policy based WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So in notes here, we have this traffic was policy based
routed that was sourced from 4444,
going to 10.1.7.10.
And if we do that trace again,
but we didn't source it from a specific loopback interface,
meaning it's going to source it from the routing table,
it's interface closer to the destination,
this one would go through the normal routing.
So to 2 to 1 to 3 to 5 to 7,
where if we source it from loopback zero,
it's going to bypass two,
it's going to set directly over to R3,
who continues the routing process.
So now that we have seen several examples
of configuring and verifying policy based routing
on a Cisco router, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
on a Cisco router,
in the next video I'd like to present you a hands-on lab.
So you too, my friend, can get practice
and build your skills.
So when you're ready for a lab,
I'll see you in the next video in just a moment.