Prefix List Examples

An example of a simple prefix list follows:

ip prefix-list tryout permit ip prefix-list tryout permit

The prefix list tryout will allow the networks and the supernet to pass.

Sometimes it is necessary to create a criteria range as opposed to an absolute. For example, you could change "all 2-year-old children are allowed into the playground," to "children between the ages of 2 and 4 allowed into the playground." This grants greater flexibility and thus accuracy to the searches. The way to do this in a prefix list is to use the ge and le parameters.

These optional keywords allow a range of the prefix length to be specified, as opposed to the network/len, which is the absolute. Therefore, is an example of the network/len, which states the prefix to be matched and the length of the prefix. The equations are confusing until you sit and work them out. The following are some key points:

• ge is used if the prefix is greater than the value stated in the list.

• le is used if the prefix is less than the value stated in the list.

Simply put, the ge-value is the barrier for the lower limit, in that the number must be greater than the value stated in for the ge-value. Likewise, the le-value is the barrier for the upper limit, in that the number must be less than that stated in the le-value. So, children entering the playground must be older than 2 (ge-value of 2) and younger than 4 (le-value of 4). Therefore, the formula requires the following condition:

For example, to permit all prefixes between /8 and /24, you would use the following:

ip prefix-list tryone permit ge 8 le 24

NOTE An exact match is assumed when neither ge nor le is specified. The range is assumed to be from ge-value to 32 if only the ge attribute is specified, and from len to le-value if only the le attribute is specified.

Was this article helpful?

0 0

Post a comment