[Contents] [Prev] [Next] [Index] [Report an Error]


Prefix Lists

A prefix list is a sequential collection of permit and deny conditions that apply to IP or IPv6 addresses. Like an access list, the system tests addresses one by one against the conditions in a prefix list. The first match determines whether the system accepts or rejects the address. Because the system stops testing conditions after the first match, the order of the conditions is critical. If no conditions match, the system rejects the address. An empty prefix list results in an automatic permit of the tested address.

Unlike access lists, the prefix list specifies a base IP or IPv6 address and a length (the number of bits applied to the base to determine the network prefix). The tested address is matched against the prefix.

Use the ip prefix-list command to define an IP prefix list, or the ipv6 prefix-list command to define an IPv6 prefix list. The prefix-list keyword with either the match { ip | ipv6 } address or match { ip | ipv6 } next-hop commands allow you to add a clause to a route map.

Using a Prefix List

The following example creates a prefix list that permits routes with a prefix length up to 24 in the 151.0.0.0/8 network:

host1(config)#ip prefix-list abc permit 151.0.0.0/8 le 24

    clear ip prefix-list

host1#clear ip prefix-list abc

    clear ipv6 prefix-list

host1#clear ipv6 prefix-list abc

    ip prefix-list

host1(config)#ip prefix-list abc permit 151.0.0.0/8

    match ip address

host1(config-route-map)#match ip address prefix-list abc

    match ip next-hop

host1(config-route-map)#match ip next-hop prefix-list abc

[Contents] [Prev] [Next] [Index] [Report an Error]