ip prefix-list

I had to look at prefix-lists again a bit more in detail and how matching is done.

There are several key words that need to be understood for mathing the right addresses.

At first the most simple match is the:

ip prefix-list PRE_20 permit 20.0.0.0/24

which does just match for the first 24 bit in the address and nothing else.

If in case you have to match more addresses, maybe a range from subnets with a specific prefix, you can match it with “ge” or “le”.

“ge” means greater or equal

“le” means less or equal

So if you want to match the following subnets:

20.0.0.0/16

20.1.0.0/16

You could create an prefix list with the following match:

ip prefix-list PRE_20 permit 20.0.0.0/15 ge 16 le 16

This means, that first the matching is done one the subnet that is the same for all subnets: 20.0.0.0/15, that can include 20.0.0.0 and 20.1.0.0.

Here we already summarized the best match for both addresses. So this part is the same for all addresses. Then, since we don’t want to match the 20.0.0.0/15 or the 20.1.0.0/15, we have to tell the prefix list, how to extend the variable match for addresse, that should be included in the match.

Se we want specially matches greater or equal /16 and maximal /16.

That means:

ip prefix-list PRE_20 permit 20.0.0.0/15 ge 16 le 16

If we want to include for example only:

20.0.0.0/24

20.0.1.0/24

20.0.2.0/24

20.0.3.0/24

ip prefix-list PRE_22 permit 20.0.0.0/22 ge 24 le 24

Another example would be to match a range of subnets with “le”

ip prefix-list 20.0.0.0/16 le 18

Would match:

20.0.0.0/16

20.0.0.0/17

20.0.0.0/18

Where the 20.0. prefix must be in all network ranges at a minimum and every address with a maximum of /18 would match if 20.0. is in the prefix.

Download PDF Download as PDF

4 Kommentare zu „ip prefix-list“

  1. Olatunji sagt:

    my router C running EIGRP is recieving an update from other routers A and B, the prefixes from A are
    10.10.10.1/24
    10.20.20.1/24
    10.30.30.1/24

    and prefixes from B are
    172.20.20.1/24
    172.30.30.1/24
    172.40.40.1/24

    these routers A,B and C are on the same subnet 172.16.0.0/29
    I want to see just 10.0.0.0 in my router C’s routing table and when i check router B routing table, i should see all the 10.x.x.x addresses

    how do i achieve this? i used distrbute-list with prefix-list but i am not getting this result. what i’m i doing wrong ?

  2. Joachim Jerberg Jensen sagt:

    Olatunji,
    What you wan’t to achieve has nothing to do with prefix-list.
    You just need to do standard route summarisation. One of the powers of EIGRP, is that you can summarize anywhere in the network, not just on borders.
    Make sure the summary-route is in the routing-table:

    ip route 10.0.0.0 255.0.0.0 null0

    On the inteface whare you wan’t to announce the summary-route:

    ip summary-address eigrp AS-NUMBER 10.0.0.0 255.0.0.0

  3. Asiri sagt:

    Great tutorial.I understood it well.Cheers!!!!

  4. CCNA Trainer sagt:

    Good explanation… I am preparing for my CCNP…

    Please explain how to apply this prefix list to filter routes…

    Thanks…

Kommentieren