So let's begin with a discussion of normal routing based on the routing tables
on our routers.
Let's presume that we have OSPF that's currently configured as shown in this
topology.
And as a result, if we send a packet from PC7, which is a 10-1-7-10, and we're
trying to reach,
for example, how about PC8 over here, that traffic based on the routing tables
in the current
topology would go this way to a Steve Olgateway, and then here, and then here,
and then here,
and then here, and here, and here, and finally to here, and the return path WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
and then here, and here, and here, and finally to here, and the return path
would take the reverse path.
And that's based on normal routing. With each router using its own routing
table to make that
routing decision. In fact, let's just for a moment verify that's the path that
PC7 packet would
take as it goes through this existing topology. So here in the lab environment,
we went to PC7,
and we did a ping. Let's just verify we can ping 192. Let's bring up the top
ology as well by
looking at here once again. So the default gateway on PC7 is 10.1.7.7, and that
's R7, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
's R7,
and I believe all the routes are in place. So if we do a ping over to PC8 at 19
2.1.10,
we can verify first of all connectivity. So we'll press Enter there, and that
connectivity works.
Let's also verify the path with a trace. We'll do a trace from this little
virtual PC,
and it's going to trace to the same address. So I'll copy paste it. And by
default, this little
PC is using UDP. If we want to change the protocol, we can go ahead instead of
just using the default
of UDP. We can go ahead and hit the upper key and do a dash capital P, and then WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
of UDP. We can go ahead and hit the upper key and do a dash capital P, and then
do protocol number
one, which is ICMP. So this is using a trace and layer four, it's using ICMP
protocol number one.
And that verifies the path. So R7 is the first top, then R5, then R3, R1, R2, R
4, and R8.
So currently routing is in place. However, if we want to make exceptions for,
for example, a
specific host or a specific subnet, or based on the type of protocol it's being
used, we want to override
what's currently in the routing table. We can do that with policy-based routing
. And the way WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
. And the way
policy-based routing works is we can apply a policy to an interface. For
example, gig 00,
and then any ingress or inbound traffic coming in on the interface, it's going
to be analyzed by
that policy. And then if there's a match based on our criteria for that policy,
the router can
override what's currently in the routing table. So we can make a policy here on
R7. It says,
you know, it based on a certain set of criteria. For example, this source
address and a certain
layer for protocol and based on a destination address. Instead of using the
routing table, let's go
ahead and simply forward that specific traffic based on the policy being WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
ahead and simply forward that specific traffic based on the policy being
matched directly over here
to R8 over this link 107800. And the next top over here is .8. So a couple of
rules of the role
regarding policy-based routing. Once we set it up and configure it, in fact,
let's talk about how we
would configure it. We're going to use an access control list to identify the
traffic that could be a
standard access control list, just looking at the source IP information, or we
're using extended
ACL, including the source and or destination, as well as layer for protocols
and ports if we wanted
to. And then we're going to use that access list to identify the traffic inside WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
to. And then we're going to use that access list to identify the traffic inside
of a route map.
And in that route map, we're going to call upon that access control list for
identifying the
traffic. And if it matches, we can then say, please set the next top two and we
can refer to the
next top address of the router we want to forward that packet to. Or if it's
serialing, we could also
point to the actual interface as the egress interface. And then the last step
to make this work is we'd
apply the policy to an interface. In this example, here we'd apply it to
interface gig 00. So any
traffic coming in on gig 00 would be amized by the policy. And if it matched
the policy, it would go WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
the policy, it would go
ahead and use the next top in this example going over to R8. Or if it didn't
match the policy,
it would simply be routed based on the normal routing table on R7. So based on
the access control
list, we set up to match certain types of traffic. We could base it on source
IP address and or destination
address and or layer four protocol involved or any combination of those. And
one thing to remember
is that when we set up policy based routing, it's only applicable for incoming
or inbound traffic
as it comes into the interface. And so at that point, the policy is analyzed. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
as it comes into the interface. And so at that point, the policy is analyzed.
And if it matches,
it takes the action that's specified in the policy. For example, sitting the
next top over here
to R8 instead of forwarding it normally up here to R5. One other thing to be
aware of,
regarding policy based routing is that it applies to transit traffic, meaning
traffic that the
router is routing on behalf of other devices. For example, from PC7, is that
traffic comes in or from
other devices on this network as it comes in on gig 00 if that's where the
policy is applied.
However, it does not apply by default to traffic generated by the router itself
. So if we're in R7 WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
. So if we're in R7
and we did a ping for example of the IP address over here at PC 10, that
traffic even if we
sourced it from gig 00 where we have the policy applied, it doesn't apply to
traffic sourced by the
router itself. But we can, if we want to enable a local policy option. And with
the option of setting
up a local policy for policy based routing, that does indeed apply to traffic
generated by the
router itself. So by default, if we apply it to an interface, it's for traffic
coming in on that
interface. And if we want to go ahead and set up policy based routing for WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
interface. And if we want to go ahead and set up policy based routing for
locally generated
traffic by the router itself, there's a command we can do that can implement
that policy as local
policy. And then we don't have to tie it specifically to an interface because
any traffic matching the
access control list and we apply it as a local policy and the router generates
traffic, it'll be applied
to that router generated traffic. Because if we set up a local policy and there
's a match regarding
the access control list for guarantee traffic that the router is generating,
then regardless of which
interface we're using the source of traffic, it'll go ahead and if there's a
policy match, it'll
set the next top appropriately and apply the policy based routing. And if there WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
set the next top appropriately and apply the policy based routing. And if there
's traffic that when
that traffic comes into the router and it doesn't match the policy based
routing rules, it doesn't mean
the traffic is being dropped, it just means the traffic is going to be routed
as normal. And we also have
some debugging we can do to see exactly when it's doing policy based routing
and when it's forwarding
based on its normal IP routing table. So that's a high level overview regarding
the idea behind
policy based routing. And in the next video, I'll walk through an example of
putting it to work.
So I'll see you there in just a moment. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So I'll see you there in just a moment.