In this lesson, we're going to configure route
Maps. Well, that's a pretty simple objective. But there are some
interesting subtleties in this lesson, and certainly you're going
to see or at least infer how
powerful route Maps can be. Here's the topology.
We're going to be using for this lesson and it looks just like the topology
or almost just like the topology from our previous lesson,
but there are some
a small differences. First of all, you'll notice that at
a s-64 73 or you'll notice if you went through the
previous lesson that I've added a prefix, one. Ninety two dot
one, sixty eight dot twenty-three dot 0/24.
That's because our part of our objectives is going to
be to filter on a specific prefix. The
other change is this and this is maybe a bit more subtle,
the way I
Set up all of these prefixes in these autonomous systems for the
previous lesson. And mostly for this lesson is to
configure a static route to
each of these prefixes. For example, 10.16 dot 0. Dot
0 /. 16 and point that static route at nulled
0. And then use the network statement in bgp
to get that that prefix into bgp-based.
From a much earlier lesson that if bgp and
look into the unicast routing table and find the
prefix that it's supposed to advertise. It will set the origin of that
prefix to igps.
Were 10. 75, got 0.0. I instead of
using the network statement used a redistribute static statement.
So this prefix in the bgp tables
will be marked as incomplete and that becomes important for one of the
objectives we're going to do for the lesson. So here's what we're going to
configure for our incoming policy and you can see that there are a couple of things
here. That that we need to do. We want to match prefixes
coming from
S 64 775 and passing through
a s64665. That means
that prefixes that pass through. Or this
prefix that originates here and passes through 64
616. We're going to set a weight of
500 and origin of igps. You notice because of
that second piece there. If for some reason we received here at our
to this prefix 1075 through,
Kind of southern route here or lower route. This particular
policy would not take effect. The other thing we're going to do
is we're going to match on prefix one. Ninety two dot one, sixty eight dot
twenty-three and we're going to set a weight of 200. You
will recall the default weight is zero. So we're going to play around with the weight.
We're going to play around with the origin and that's that's
our policy instructions. So I'm going to
Move this instruction set over a little bit to the right so that we
can see our terminal. Well.
Okay, we have a terminal session open for R2 and like with
most policy exercises that we do in this course, before
we start creating policies. We want to be sure to
understand what bgp already has in
its table. So we'll do a show IP, bgp-based.
This also that for 10. 75. Dot 0. Dot 0, or
origin. Shows incomplete. And that's what we
what we wanted, because we're going to do a policy that's going to change that
origin here at our, to notice also,
right now, all of the weights are at the default, which is 0.
So having verified all that we can start
configuring things. So, we'll go into configuration mode and
the first thing we want to
To do and this is important for Route. Maps has is we need to set up all
of the tools that we're going to use for actually
identifying the routes that we want to match. So
in this particular case, our first instruction says we want to match
prefixes from a s-64 775 that
also pass through a
s64681 will obviously that sounds like we
could use an as path actually.
This list and that's exactly what we're going to do going to do. So, we'll say
IP a s path access
list.
And just call it 10 and permit.
You saw this from the previous lesson on a s path access lists
to to match something
that originates at a particular. A
s. We start with with something an
underscore that identifies that we
don't really care what came before that and 64
775. The important part is this dollar sign
at the end that says,
That's what we, this is always the last a s number
in the as path. So that make sure that we match just on things that have
originated in 64 775
and the new and a control P here. It
might seem like the next piece of what we want to
do, four things that pass through a
s64681, might be an underscore
64.
6:16 and another underscore I'm not going to hit return on that because this is
not actually what we need. If you think about this for a second and this
is a subtle bit a bit. It's saying we don't care what
becomes what comes before 6416, and we don't care
what comes after 64 616. So, while it
will continue to match on prefixes that
originated in 64 775 and then passed through
64, 616
In. If we have just this statement, this would also match on prefixes
that originated in a
s64681 and we don't want that.
So before we put this statement in
We're going to put in deny and
underscore 64 616 and a
dollar sign. Do you see what we did there? We're saying, first of all,
before we actually permit anything, we want to be sure to deny anything. We
don't really want which in this case would be prefixes
that originated in 64. 616.
So having done that we can then do our
That underscore 64
616 underscore again,
and that part is going to be correct. And then the last piece just like we
saw in the previous lesson, good idea, good practice to just put
a deny all at the end, which is the dot and
asterisks which basically matches on everything.
So that's our a s path access list that we're going to
use for matching with with these
prefixes than that. First part of the instruction on our
incoming policy. Another thing that's important to note here
is in our previous lesson, where we
used a s path access lists as actual filters.
This kind of statement would actually at the end would deny everything
that isn't matched here and would keep it. If it was an incoming
policy at our to would keep our to from learning. Anything else. We're
using this, a s path access list. In this case,
in a different way. This is just a tool for being able to match what we want
to apply policies to in our our route map. So
it's important to understand how this access list is going to
be used. So it's not going.
Actually deny any
prefixes that come in to our to. It's just going to do
a deny for saying, you know, anything that wasn't
explicitly matched up here. We're not going to
apply a policy to, in our route map. Maybe that'll make a little bit more
sense as we actually put the route map together. But before we do that, we
have one more thing we want to do. We have another piece of our incoming
policy that says match.
Prefix one. Ninety two dot one, sixty eight dot, twenty-three /
24. Well, that sounds like a good place to use, either an
access list or a prefix list. Well, we've done prefix lists
before, so let's just do another one here. If we say, IP prefix
list and this is going to be pretty simple and straightforward. Let's just give it a name of a
s 64.
723, since that's where this particular prefix is going to
originate and we're going to say permit.
One ninety two dot one, sixty eight dot twenty-three, Dot
0/24, and it's going to be that exact
prefix. So that's pretty much all we need. Now that we've got these
preliminary pieces out of the way we can configure our route map. So
we're going to say, route that
and let's just give it a name of
lesson 10. And as I've mentioned before, I
personally like to capitalize names. So that they're
To identify and we don't get mixed up about what that
is. And we're going to say permit. We're going to give it a permit
here and we're going to make this sequence 10. This route map is going to have multiple
sequences in it. So we need a sequence 10 here
and notice what happens when I hit return on the
prompt. We go from config mode to route map, config mode.
So basically, under this sequence we can now
add our match.
Each and set statements. So I'm going to say match.
He is path because we are matching to the aaas
path list that we created up here in this is a SPF
list 10. So I'm just going to put 10 in there. And
anything that matches we're going to set the weight
to be 500 and we're going to
set the origin.
To be igps.
Now we're going to go to the next
stanza. So route map or next sequence I guess is a better
word lesson, 10 permit.
This is sequence 20.
And here we're going to match on the IP address
that was specified in prefix
list.
I named that a s-64.
7:23. So there's our prefix list.
And for anything that matches, their we're going to set a weight
of 200.
And that's it. Now we can exit out of our route map
and there is
Unintentional mistake there and we'll come back to that. But for a because we kind of want to see what
what the results of this route map will be. So next we go
to router. We've got to apply this to the router. Bgp.
65 501. And this is neighbor
10.1.1.1 and to apply this route
map as a policy. We just say route map and we had named it
lesson 10 and this is going to be an incoming
policy. We so we set it.
As in. And there we have it at this point we're going to
exit. And
as before we need to
Request. A clear. So clear IP
bgp.
10.1.1.1 soft in.
And now, let's see what the results are in our bgp table.
Notice, we don't quite get what we wanted. There. We
have some of our effects. Here's one ninety two dot, one sixty eight dot twenty-three
and you'll notice. The weight is set to 200. Like we
expected. Here's 10. 75. Dot
0. Dot 0. Its weight is set to 500 and
its origin has changed to igps Rum
incomplete. You'll recall, we saw that it was incomplete earlier
and the problem obviously.
Lee is that we shouldn't have touched any of the other
prefixes. But for some reason, all those prefixes are gone
and you probably have a pretty good idea of what happened there,
but I do want to show you a very useful command. When
you're debugging route maps, you can do a show route
map.
And this was some 10, we just had
one route map so I could just do a show route map. But on
a live router you may have multiple route map. So you can select the one you want
to look at and want to do that show. Here
is what it shows. It's sort of summarizes. What we configured
your we have less than 10 sequence. 10 is a permit and we're using
an as path filter tin to match on a s path.
And we set the weight to 500 the origin to igps. Let
worked. We saw it work. Here's a permit for
sequence, 20. We matched on an IP address and
the prefix list was named a s64720 NT3.
We set a weight of 200 for anything that matched here, and we saw that, that work
also.
The problem that we have in here, is that a
route map just like an access list as the default deny
any, at the end of it. So, you know, anything that wasn't matched in here
gets denied and that's the reason to our other prefixes didn't show up correctly. So let's
fix that. Let's go back into configuration mode.
And route map.
Lesson 10 permit and we'll make this sequence 30
and we actually don't need to specify any kind of match or set in here.
If we don't do anything, this just hits everything. So this is basically a
permit all at the end of our route map.
So, if we do a show.
Route map again, you can see now we've got sequence, 30,
that permits everything.
And we have to clear, IP bgp,
10.1.1.1 soft in
clearing or requesting a recent
of prefixes.
and now, if we do a show IP, bgp-based
Here's a, Here's a thought exercise for you.
When I configured this, the policy
said our requirement. This first policy said that we
should match prefixes from a s-64
775 and passing through a
s64681. Well,
the policy that I set up, does it really do that? You saw the
results and it worked in our display, and I'm leaving
this as a thought exercise.
The reality is that won't quite fit.
What in the policy, we configured
would prevent routes coming through this, this
lower path from 64 775
to 723 to 862.
520, from also matching
here, and having the weight set to 500 and the origin
set to igps.
P, can you figure out how to change that policy?
So that it does accurately match only routes the
coming this way from 64 775 through 64
16, but does not have
the weight and in origin changed, if it goes through this lower
path and here's a little hint. There's actually three ways you could do
that. You could do a more complex.
Regular expression in your a s path
filter. You could just do some extra statements in your as pass
filter, or you could do it through modifying
the route map a bit. So little
exercise for you there rather than show you that I'm just going to leave it for you to work
out.
Before we leave this lesson. I do want to jump over to
router are three. You can see the session brought up here.
And I want to do a show. IP bgp is here to see what's in the
table. And really, this is just to illustrate the way the
weight attribute works. And you can see that we've got
our prefixes here. Notice that
for 1075 where we changed the
It carries on because the origin is associated with
with the route. And so it's carried from one router to another but notice that
the weights of 10. 75 and
192 are back to their default of 0. This
re-emphasizes, the fact that that weight attribute
is local to a single router and is not passed
among routers. So so our change at our to
did not affect anything.
A thing at our three, so that's a very simple in
one way configuration of a route map. And you'll certainly see route Maps
used in subsequent lessons, but you could also see how
by bringing together a lot of different tools within a route map.
You can create some very powerful policies.