< Home

Configuring the IPv4 IP-Prefix List

The control action for matched IPv4 routes can be flexibly controlled through the configuration of the IPv4 IP-Prefix List.

Context

Before applying a routing policy, you should set the matching rules, that is, filters. Compared with an ACL, an IP prefix list is more flexible. When the IP prefix list is used to filter routes, it matches the destination address of a route.

A prefix list is identified by its list name. Each prefix list can include multiple entries. Each entry can independently specify the matching range of a network prefix form and identify it with an index number. For example, the following is a prefix list named abcd:

#
ip ip-prefix abcd index 10 permit 10.1.0.0 16
ip ip-prefix abcd index 20 permit 10.2.0.0 16

Procedure

  1. Access the system view.

    system-view

  2. Configure a prefix list.

    ip ip-prefix ip-prefix-name [ index index-number ] { permit | deny } ip-address mask-length [ greater-equal greater-equal-value ] [ less-equal less-equal-value ]

    The range of mask length can be specified as mask-length <= greater-equal-value <= less-equal-value <= 32. If only greater-equal is specified, the range of the prefix is from greater-equal-value to 32; if only less-equal is specified, the range of the prefix is from [ mask-length to less-equal-value ].

    During the matching, the system checks entries identified by the index number in the ascending order. Once an entry meets the condition, it means that all entries pass the IP-prefix filtering. The system does not match other entries.

    If all entries are in deny mode, no routes can pass this filtering list. You are recommended to define a permit 0.0.0.0/0 less-equal 32 entry after the multiple entries in the deny mode, thus allowing all the other routes to pass the IP-Prefix filtering.

    If more than one IP-Prefix entry is defined, at least one entry should be in permit matching mode.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >