The Cisco IOS IP prefix-list feature gives the network engineer another tool for matching routes when performing route filtering.
IP prefix lists can examine both the prefix and the prefix length, and a range of prefixes or a range fo prefix lenghts. Using IP prefix lists for route filtering has several advantages:
- IP prefix lists allow matching of the prefix length, whereas the ACL used by the distribute-list command cann‘t
- more intuitive
- uses an internal tree structure that results in faster matching of routes as compared with ACL
IP prefix lists provide mechanisms to match two components of an IP route:
- the route prefix(the subnet number)
- the prefix length(the subnet mask)
The generic commnad syntax is as follows:
ip prefix-list list-name [seq seq-value] {deny | permit prefix/prefix-length} [ge ge-value] [le le-value]
the following stateemnts summarize the logic:
step 1: the route‘s prefix must be within the range of addresses mplied by the prefix-list command‘s prefix/prefix-length parameters.
step 2: The route‘s prefix length must match the range of prefixes implied by the prefix-list command‘s prefix-length, ge and le parameters.
Prefix List Parameter | Range of Prefix Length |
Neither | Conf-length must = route-length |
Both ge and le | ge-value <=route-length<=le-value |
Only le | conf-length<=route-length<=le-value |
Oly ge | ge-value<=route-length<=32 |
0.0.0.0/0
0.0.0.0/0 means “match all prefixes.” However, because no le nor ge parameter is configured, the /0 also means that the prefix length must be 0. So, it would match all routes’ prefixes, but none of their prefix lengths. Only a default route would match this prefix list.
0.0.0.0/0 le 32
The range implied by 0.0.0.0/0 is all IPv4 addresses. The le 32 combined with prefix length 0 implies any prefix length between 0 and 32, inclusive. This is the syntax for “match all” prefix list logic.