How to configure Prefix-List on Cisco Router

i saw in you prefix-list filtering in EIGRP example you are advertsting loopback in EIGRP using:
R2(config-router)#network 172.16.0.0 0.0.3.255
my question why you are using Wildcard mask 0.0.3.255 for these loopbacks
loopback0 : 172.16.0.0/24

loopback1 : 172.16.1.0/24

loopback2 : 172.16.2.0/24

loopback3 : 172.16.0.3/24
i think it should be 0.0.0.255 beacuse all loopbacks are /24
waiting you

Hello Rafie

This is the topology for the lesson you are referring to:

So within the EIGRP configuration of R2, Rene issues the following command:

R2(config-router)#network 172.16.0.0 0.0.3.255

What this command does is it specifies which networks will participate in EIGRP. If he were to use the 0.0.0.255 wildcard mask, he would have to issue it four times like this, once for each subnet:

R2(config-router)#network 172.16.0.0 0.0.0.255
R2(config-router)#network 172.16.1.0 0.0.0.255
R2(config-router)#network 172.16.2.0 0.0.0.255
R2(config-router)#network 172.16.3.0 0.0.0.255

However, the 0.0.3.255 wildcard mask includes all four subnets, so he needs only one statement. How does it include all four subnets? Remember that the combination of network address and wildcard mask give us a range of addresses. Let’s determine that range now.

First let’s write out the network address and the wildcard mask in binary:

Network:       10101100.00010000.00000000.00000000
Wildcard Mask: 00000000.00000000.00000011.11111111

Now, let’s determine the range of addresses that this includes. We’ll do this by setting all host bits to 0 and then setting all host bits to 1.

Host bits to 0:

Starting address: 10101100.00010000.00000000.00000000
Wildcard Mask:    00000000.00000000.00000011.11111111

Host bits to 1:

Ending address: 10101100.00010000.00000011.11111111
Wildcard Mask:  00000000.00000000.00000011.11111111

So what are the starting and ending addresses in dotted decimal format? They are:

  • 172.16.0.0
  • 172.16.3.255

You can see that all four of our subnets are included within that range, all because Rene used a larger wildcard mask. Does that make sense?

I hope this has been helpful!

Laz

“If I have a network with 10.0.0.0 /21, it will be denied by this prefix list. It falls within the 10.0.0.0 /8 range, but it has a subnet mask of /21. I’m using the le operator, which says that the subnet mask should be /19 or smaller.”

I’m confused… a /21 is technically smaller than a /19. Is the ge/le operator referencing the cidr number (more, or fewer bits) itself and not the actual size of the subnet? That is a little confusing. So a “smaller” subnet mask than /19 is effectively a larger/less-specific subnet, i.e. /18…/17…/16?

My brain immediately thinks /17 is greater than /19 due to the subnet including more addresses, but i guess if you break it down to binary bits, 10000000 is less than 11000000

Hello Trevor

Yes, you’re correct. In the context of subnet masks, a smaller CIDR notation (like /19) actually represents a larger network because it includes more IP addresses. Conversely, a larger CIDR notation (like /21) represents a smaller network with fewer IP addresses.

Even so, the “le” and “ge” operators used by the prefix lists always refer to “less than or equal to” and “greater than or equal to” in a numerical context. In other words, /20 is considered “ge” /19.

Think about it this way:

  • “Greater than” and “Less than” are strictly mathematical terms, so these act directly upon the actual numbers being used. These are the operators used in the prefix lists.
  • The terms “Larger” and “smaller” are typically used to refer to prefix sizes, where a prefix of /19 results in a larger subnet than a /20 prefix.

Does that make sense? It can be a bit counter-intuitive, but just remember that the ‘le’ and ‘ge’ operators are referring to the CIDR notation number, not the actual size of the subnet.

I hope this has been helpful!

Laz