For general information about route policy, see Route policy overview.
Prefix lists are named lists of route prefixes. They are used to match routes for inclusion in or exclusion from route policies.
A prefix list can include one or more rules, each defined by a sequence number, permit
or deny
instruction, prefix, and range of allowed prefix lengths.
Syntax:
[no] [ ip | ipv6 prefix-list
name
] [seqseq-num
] [ permit | deny prefix /prefix-length
] [gemin-length
] [lemax-length
]Enters a route prefix into a prefix list.
Deletes the entire prefix list identified by
.
name
Deletes the entry with the specified sequence number from the prefix list identified by
.
name
Individual prefix list entries are made using separate commands in the general configuration context. All entries that have the same prefix list name are part of the same prefix list. Thus, the following commands, taken from a
show running-config
listing, constitute two prefix lists.ip prefix-list "Odd"
seq 5 permit 10.1.1.1 255.255.255.0 ge 24 le 24 ip prefix-list "Odd"
seq 10 deny 10.1.2.1 255.255.255.0 ge 24 le 24 ip prefix-list "Odd"
seq 15 permit 10.1.3.1 255.255.255.0 ge 24 le 24 ip prefix-list "Odd"
seq 20 deny 10.1.4.1 255.255.255.0 ge 24 le 24 ip prefix-list "Even"
seq 5 deny 10.1.1.1 255.255.255.0 ge 24 le 24 ip prefix-list "Even"
seq 10 permit 10.1.2.1 255.255.255.0 ge 24 le 24 ip prefix-list "Even"
seq 15 deny 10.1.3.1 255.255.255.0 ge 24 le 24 ip prefix-list "Even"
seq 20 permit 10.1.4.1 255.255.255.0 ge 24 le 24 . . .Sequence numbers, which are optional, determine the order in which prefix list entries are evaluated during match operations. If you do not specify a sequence number for an entry, the switch uses a number that is 5 more than the highest sequence number already used in the list. (For the first entry in a prefix list, the default value of the sequence number is 5.) You can insert a new entry in a prefix list between two entries already in the list by specifying a sequence number for the new entry that is between the sequence numbers of the two existing entries.
Use the following command to enter a description string into an existing prefix list:
Syntax:
[
ip
| ipv6 prefix-listname
] [seqseq-num
descriptiondescription-string
]Enters a description into a prefix list.
If you delete the entry to which the description is attached, the description is deleted also.
The show ip prefix-list
command displays the content of prefix lists.
Syntax:
Displays the content of prefix lists.
Example
In a switch that contains two prefix lists, a standard display looks like this:
HP Switch# show ip prefix-list ip prefix-list Odd: 4 entries seq 5 permit 10.1.1.1/24 ge 24 le 24 seq 10 deny 10.1.2.1/24 ge 24 le 24 seq 15 permit 10.1.3.1/24 ge 24 le 24 seq 20 deny 10.1.4.1/24 ge 24 le 24 ip prefix-list Even: 4 entries seq 5 deny 10.1.1.1/24 ge 24 le 24 seq 10 permit 10.1.2.1/24 ge 24 le 24 seq 15 deny 10.1.3.1/24 ge 24 le 24 seq 20 permit 10.1.4.1/24 ge 24 le 24
A summary of the prefix lists looks like this:
HP Switch# show ip prefix-list summary ip prefix-list Odd: Count:4, Range-entries: 4, Sequences: 5 - 20 ip prefix-list Even: Count:4, Range-entries: 4, Sequences: 5 - 20
A detailed display of one of the prefix lists looks like this:
HP Switch# show ip prefix-list name Even detail ip prefix-list Even: Count:4, Range-entries: 4, Sequences: 5 - 20 seq 5 deny 10.1.1.1/24 ge 24 le 24 Description: Permit even-numbered subnets seq 10 permit 10.1.2.1/24 ge 24 le 24 seq 15 deny 10.1.3.1/24 ge 24 le 24 seq 20 permit 10.1.4.1/24 ge 24 le 24