ip prefix-list

Syntax

ip prefix-list <PREFIX-LIST-NAME> [seq <SEQ>] {ip | ipv6} <IP-PREFIX/MASK> [ge <0-128>] [le <0-128>]


no ip prefix-list <PREFIX-LIST-NAME> [seq <SEQ>] {ip | ipv6} <IP-PREFIX/MASK> [ge <0-128>] [le <0-128>]

Description

Configures a prefix list to match a set of prefixes. Prefix lists are named lists of route prefixes. They are used to match routes for inclusion in or exclusion from route policies. The sequence number determines the order of matching. The matches are performed starting from the lowest sequence number to the highest sequence number until there is a match. The sequence number is however optional and is autogenerated whenever it is not explicitly mentioned. All prefixes with the same prefix list name are grouped.

The autogenerated sequence number is derived by adding 10 to the highest sequence number available. This technique makes it possible to insert new prefix list sequence number in between.

The ge and le parameters are used to combine prefixes with a range of network mask. For example, 172.131.0.0/16 ge 16 le 24 will match all prefixes within the 172.131.0.0/16 network that have a mask greater than or equal to 16 bits and less than or equal to 24 bits in length. For instance, 172.131.1.0/18 would match, because its length is between 16 and 24 but 172.0.0.0/8 or 172.131.1.128/25 would not match.

The no form of this command removes the prefix list configuration.

Command context

config

Parameters

<PREFIX-LIST-NAME>

Specifies the name of the prefix list.

seq <SEQ>

Specifies the order of reference of the prefix rules.

{permit | deny}

Specifies whether the route is available for further processing when there is a match.

<IP-PREFIX/MASK>

Specifies the IP prefix or mask.

ge <0-32>

Specifies the minimum prefix length to be matched.

le <0-32>

Specifies the maximum prefix length to be matched.

Authority

Administrators

Examples

Configuring a prefix list with sequence numbering:

switch(config)# ip prefix-list PFXLST seq 5 permit 4.0.0.0/8 ge 9 le 12

Configuring a prefix list without sequence numbering:

switch(config)# ip prefix-list PSXLST permit 5.0.0.0/8