4-5
IP-Prefix Configuration
IP-prefix plays a role similar to ACL and but is more flexible and easier to understand. When IP-prefix is
applied to filtering routing information, its matching object is the destination address information field of
routing information.
Configuration Prerequisites
Before configuring a filter list, prepare the following data:
z
IP-prefix name
z
Range of addresses to be matched
Configuring an ip-prefix list
An IP-prefix list is identified by its IP-prefix list name. Each IP-prefix list can comprise multiple entries.
Each entry can independently specify a match range in the form of network prefix and is identified by an
index-number. For example, the following is an IP-prefix list named
abcd
:
z
ip ip-prefix abcd index 10 permit 1.0.0.0 8
z
ip ip-prefix abcd index 20 permit 2.0.0.0 8
During the matching of a route, the router checks the entries in ascending order of index-number. Once
the route matches an entry, the route passes the filtering of the IP-prefix list and no other entry will be
matched.
Follow these steps to configure an IPv4 IP-prefix list:
To do...
Use the command...
Remarks
Enter system view
system-view
—
Configure an IPv4 IP-prefix
list
ip ip-prefix
ip-prefix-name
[
index
index-number
] {
permit
|
deny
}
network len
[
greater-equal
greater-equal
|
less-equal
less-equal
]
Required
Not configured by
default
If all the entries of the IP prefix list are in the
deny
mode, all routing information will be denied by the
filter. In this case, you are recommended to define an entry in the
permit
mode with the
ip ip-prefix
ip-prefix-name
index
index-number
permit
0.0.0.0 0
less-equal
32 command following multiple entries
in the
deny
mode to permit all the other IP routes.
Displaying IP Route Policy
To do...
Use the command...
Remarks
Display route policy
information
display route-policy
[
route-policy-name
]
Display IP-prefix
information
display ip ip-prefix
[
ip-prefix-name
]
Available in any view