ip prefix-list
Use ip prefix-list to configure an IPv4 prefix list or an item for the list.
Use undo ip prefix-list to remove an IPv4 prefix list or an item of it.
Syntax
ip prefix-list prefix-list-name [ index index-number ] { deny | permit } ip-address mask-length [ greater-equal min-mask-length ] [ less-equal max-mask-length ]
undo ip prefix-list prefix-list-name [ index index-number ]
Default
No IPv4 prefix lists exist.
Views
System view
Predefined user roles
network-admin
Parameters
prefix-list-name: Specifies an IPv4 prefix list name, a case-sensitive string of 1 to 63 characters.
index index-number: Specifies an index number for an IPv4 prefix list item, in the range of 1 to 65535. An item with a smaller index number is matched first. If you do not specify this option, the index number starts from 10 and increments by 10 for each of the consecutive prefix list items.
deny: Specifies the deny mode. If a route matches the item, the route is denied without being compared with the next item. If a route does not match the item, the route is compared with the next item.
permit: Specifies the permit mode. If a route matches the item, it passes the IPv4 prefix list. If a route does not match the item, the route is compared with the next item.
ip-address mask-length: Specifies an IPv4 prefix and mask length. The value range for the mask-length argument is 0 to 32.
greater-equal min-mask-length, less-equal max-mask-length: Specifies a prefix length range. The greater-equal keyword means "greater than or equal to" and the less-equal keyword means "less than or equal to." The prefix length range relation is mask-length <= min-mask-length <= max-mask-length <= 32.
If only the min-mask-length argument is specified, the prefix length range is [ min-mask-length, 32 ].
If only the max-mask-length argument is specified, the prefix length range is [ mask-length, max-mask-length ].
If both the min-mask-length and max-mask-length arguments are specified, the prefix length range is [ min-mask-length, max-mask-length ].
Usage guidelines
An IPv4 prefix list is used to filter IPv4 addresses. It can contain multiple items, each of which specifies a range of IPv4 prefixes. The relation between the items is logical OR. If an item is passed, the IPv4 prefix list is passed. If no item is passed, the IP prefix list cannot be passed.
If both the ip-address and mask-length arguments are specified as 0.0.0.0 0, only the default route will be matched.
To match all routes, use 0.0.0.0 0 less-equal 32.
Examples
# Configure IP prefix list p1 to permit routes destined for network 10.0.0.0/8 and with mask length 17 or 18.
<Sysname> system-view [Sysname] ip prefix-list p1 permit 10.0.0.0 8 greater-equal 17 less-equal 18
Related commands
display ip prefix-list
reset ip prefix-list