- [Instructor] There are times
when we're doing route redistribution,
where we don't necessarily want
to redistribute every single route
from one autonomous system to another.
Maybe within EIGRP,
we've got one route that we want to approve,
or let it through into OSPF,
but there's another route that we want to reject.
We don't want it to be redistributed.
So let's see exactly how we can filter a route
using the topology that we've been building on
in this module.
Let's say, for example, for some reason,
we don't want the 192.168.2.0/24 network,
which lives between R3, and SW4,
let's say for some reason we don't want that network
to be redistributed into OSPF.
One way that we can block that route
from being redistributed, is to use a route map.
So let's go back out to our live topology,
and we'll go to R2, we'll create an access-control list
that's going to match that network,
and then we'll apply that ACL to a route map,
and then we'll apply the route map
to our redistribute statement,
and we'll confirm that we have successfully blocked,
or we have prevented the redistribution
of 192.168.2.0/24, from EIGRP into OSPF.
Let's get started with our route filtering demonstration
on router R2.
Let's go on to global configuration mode,
and the first thing I want to do,
is to create an access-control list,
an ACL that's going to match the network
that we don't want to redistribute.
Remember an ACL does not just permit or deny traffic
from one place to another,
an ACL can be used to match traffic.
That's what we're going to use it for here.
I'm going to say, and I'll just use a standard access list,
I'll say, access-list, and I'll give it a number of one.
And I want to permit,
not meaning allow, but meaning match in this context,
I want to permit 192.168.2.0,
and we use a wildcard mask of 0.0.0.255.
We've got an ACL created now,
that's going to match the network that we want to filter.
By the way,
let's just confirm that it's not currently being filtered.
Let's go over to R1, and do a show IP route.
Is it currently appearing in our routing table?
Yeah, sure is.
It's right here.
This is the one that we want to filter out.
So we've created an ACL.
Now, we want to create a route map,
and apply that ACL to the route map.
So let's create a route map, and let's name it Lab.
And here I am going to use the deny keyword
because I want to deny what I'm about to match.
I'm about the match this ACL.
I want to deny that from being redistributed,
but I want to permit everything else.
And since I am going to have a permit statement
following this up,
remember that a route map is processed top-down,
so I will assign a sequence number here.
I'll give a sequence number of 10,
and then in a moment, I'll give a sequence number of 20
that permits everything else,
but I want this to be evaluated first.
And I'll say that I want to match the IP address of ACL one.
Now, let's create another sequence number
as part of that same route map.
This time, I'll say, permit,
and I'll give a higher sequence number of 20,
and I don't need to do anything else.
If I just stop right here,
that implies that I'm going to permit everything else.
So we can exit out of route map configuration mode.
And now let's go into router OSPF process ID one,
and I'm just going to overwrite
my existing redistribute statement.
I'll say, redistribute EIGRP autonomous system one,
and I'll stick with using a metric-type of one.
And just as a good practice,
even though this particular version
of Cisco IOS does it automatically,
I'll give the subnets keyword,
and I'll say route-map,
and I'll give the route map name of Lab.
Alright, think we're done.
Let's go back over to router R1,
and see if we still know about this network,
192.168.2.0.
Let's do a show IP route,
(keyboard clicks)
Oh, look at this.
Before, we had these three routes learned via OSPF
that were injected from outside OSPF.
Now, we only have two.
Conspicuously absent, is the one that we filtered.
Absent, is 192.168.2.0.
That's how we can use a route map
to selectively filter routes being redistributed
from one autonomous system to another.