![]() ![]() |
9.8 | ![]() |
BGP Route Filtering and Policy Routing | |
9.8.5 | ![]() |
Example ip prefix-list configuration |
Figure ![]() The real power of the ip prefix-list command is in its optional parameters. The keywords ge and le can be used to specify the range of the prefix length to be matched for prefixes that are more specific than the network/len value. The prefix length range is assumed to be from ge-value to 32 if only the ge attribute is specified. The prefix length range is assumed to be from len to le-value if only the le attribute is specified.![]() Notice that a specified ge-value and le-value must satisfy the following condition:
For example, to accept a mask length of up to 24 bits in routes with the prefix 192.0.0.0/8, and to deny more specific routes, use the following commands:
These commands test to see if a given prefix begins with 192 in the first octet. After that, they are concerned with only how specific the route is by checking the length of the mask. Therefore, both 192.168.32.0/19 and 192.168.1.0/24 match the permit statement, but 192.168.1.32/27 does not because its mask length is greater than the ge value, 25. Any routes with a mask equal to the ge value will also be denied. The le and ge keywords can be used together in the same statement, as the following shows:
This command permits all prefixes in the 10.0.0.0/8 address space that have a mask length from 16 to 24 bits. Each prefix list entry is assigned a sequence number, either by default or manually by an administrator. By numbering the prefix list statements, new entries can be inserted at any point in the list. This is important because routers test for prefix list matches from lowest sequence number to highest. When a match occurs, the router does not continue through the rest of the prefix list. For efficiency, put the most common matches near the top of the list. The show ip prefix-list command always includes the sequence numbers in its output, as shown in Figure![]() Sequence numbers are automatically generated in increments of five. The first sequence value generated in a prefix list would be five (5), then ten (10), then 15, and so on. If manually specifying a value for an entry and then not specifying values for subsequent entries, the assigned sequence values are incremented in units of five. For example, the first entry in the prefix list has a sequence value specified of three. Then no more sequence values are specified for the other entries, the automatically generated numbers will be 8, 13, 18, and so on. Manually specify prefix list sequence numbers as shown in the following:
Sequence values for prefix list entries can be manually specified in any increments that are wanted. However, if unwisely specifying the sequence values in increments of one (1), additional entries cannot be inserted into the prefix list. To display information about prefix tables, prefix table entries, the policy associated with a node, or specific information about an entry, use the show ip prefix-list command.![]() Finally, when using prefix lists, keep the following rules in mind:
|