cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
295
Views
5
Helpful
3
Replies

Help:Trying to understand how to build this prefix-list

Hello, I know how prefix-lists work and syntax but I see the following below and I would like to build a prefix-list for it. I have seen the answer for this and I can't understand how that was determined:

"Task:In address range 128.0.0.0-191.255.255.255, do not accept prefixes with subnet masks longer than /18."

I attempted to build this by writing 128 and 191 as decimals. I don't see a pattern which would help me writing this prefix-list though.

If you can clarify how you would build such prefix-list I would appreciate it.

1 Accepted Solution

Accepted Solutions

Istvan_Rabai
Level 7
Level 7

Hi Ronaldo,

The prefix-list would look like this:

ip prefix-list TEST permit 128.0.0.0/2 le 18

Explanation:

This prefix-list will allow all prefixes that begin with 10 (binary) on the first 2 bits (/2). This defines the range 128.0.0.0-191.255.255.255.

You should draw the ip addresses for yourself in binary.

128 is 10000000

191 is 10111111

But from this range it will allow only those that have prefix length (subnet mask length) Less than or Equal to 18 (le 18).

Cheers:

Istvan

View solution in original post

3 Replies 3

Istvan_Rabai
Level 7
Level 7

Hi Ronaldo,

The prefix-list would look like this:

ip prefix-list TEST permit 128.0.0.0/2 le 18

Explanation:

This prefix-list will allow all prefixes that begin with 10 (binary) on the first 2 bits (/2). This defines the range 128.0.0.0-191.255.255.255.

You should draw the ip addresses for yourself in binary.

128 is 10000000

191 is 10111111

But from this range it will allow only those that have prefix length (subnet mask length) Less than or Equal to 18 (le 18).

Cheers:

Istvan

Hi Istvan,

A good explanation, But I am not clear why it is not restricted to le /18.

I understood that this prefix list is for CLASS B network. But where this /18 comes.

Thanks

SAIRAM

Hi Sathya,

Prefix lists do not consider A, B or C network classes.

Prefix lists are fully classless.

/18 comes from the original requirement that prefixes having subnet masks longer than /18 should not be permitted.

This is what this prefix-list exactly does.

Does this answer your question?

Cheers:

Istvan

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card