07-27-2009 08:10 AM - edited 03-04-2019 05:33 AM
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.
Solved! Go to Solution.
07-27-2009 08:25 AM
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
07-27-2009 08:25 AM
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
07-27-2009 09:05 AM
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
07-27-2009 10:04 AM
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
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: