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

Answered Question
Jul 27th, 2009

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.

Correct Answer by Istvan_Rabai about 7 years 7 months ago

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

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Correct Answer
Istvan_Rabai Mon, 07/27/2009 - 08:25

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

snarayanaraju Mon, 07/27/2009 - 09:05

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

Istvan_Rabai Mon, 07/27/2009 - 10:04

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

Actions

This Discussion