I am not able to understand the usage & function of ip prefix-list. Inspite of reading various document, i am confused how it works. Can you please explain with example mentioned below:
Hope you will help me in understanding the concepts better
Hi R.B. Kumar,
The easiest implementation of your permits and denies is to take each one individually and put them in a prefix-list like this:
ip prefix-list TEST seq 5 permit 192.168.1.0/24
ip prefix-list TEST seq 10 permit 192.168.2.0/24
These simple statements define exact prefix matches.
However, if you want to match several prefixes with a single prefix-list statement, things get more complicated.
Let's say you want to match the following prefixes with a single statement:
One possible solution follows:
ip prefix-list TEST seq 5 permit 192.168.0.0/22 ge 24 le 25
This statement means the following:
1. Match all prefixes that begin with the 192.168.0.0 on their first 22 bits.
2. From the result select those prefixes, that have a prefix-length greater than or equal to 24 (ge 24) AND their prefix length is less than or equal to 25 (le 25).
So the result will be those prefixes that:
- begin with the 192.168.0.0 on their first 22 bits
- have a prefix length 24 to 25.
You should test this on a router so you can see the result with your own eyes.
Please let me know if you need further explanation.