ip prefix-list configuration command directory
Clear statistic information ofdesignated prefix-list.
clear
ip prefix-list [<name> [<prefix>]]
<name> name
of Prefix-list
<prefix> network prefix with format: A.B.C.D/n,n is the length of the mask
none
Supervisor
mode
If no prefix is designated, all statistic information
in prefix-listwill be cleared.
none
ip prefix-list sequence-number
Create a prefix-list
or add a prefix-list rule. Use “no” command to delete the configuration.
ip
prefix-list <name> [<seq> <seq_number>]
<deny | permit> <prefix | any> [<ge> <value>] [<le> <value>]
no
ip prefix-list <name> [<seq> <seq_number>]
[<deny | permit> <prefix | any> [<ge> <value>] [<le> <value>] ]
<name> Name of prefix-list
<seq> Designate
sequence-number
<seq_number> Value of
sequence-number
<deny | permit> Property of prefix-list rule.
<prefix | any> Designated
prefix or any prefix..
<ge> Smallest
length of prefix, i.e. lower limit, with designated matching.
<value> Length
of prefix, 0-32.
<le> Biggest length of prefix
(higher limit) with designated matching.
<value> Length
of prefix: 0-32.
none
global configuration mode
Prefix-list is a collection of rules used to
filter network prefix. Each rule contains 5 elements: sequence number, property (deny/permit), prefix and length (a.b.c.d/n), lower limit (gex) and higher limit (ley). All rules are ranged from
small to large with sequence number. When prefix list is applied, begin to check it from the
rule of the smallest number. If the matching is done successfully, stop
matching other rules and return property (deny/permit) of the rule.
To check whether the given network prefix
is matched, it is necessary not only to check the length of the network prefix
but also to check whether the network prefixes within a specific length are
completely the same. For a given network a.b.c.d/n, to
check the matching by using a rule of prefix list “ip prefix-list test seq 5 A.B.C.D/M ge X le Y”, the following process
must be executed:
The first thing to check is whether the mask length (n) of the
network meets the expression: X <= n
<= Y (If ge X is not designated, the expression should be:M <=
n<= Y; if le Y is not designated, the expression should be: X <=n <=
32; if both ge X and le
Y are not designated, the expression should be: n == M). If
the expression is met, continue to the next process. If the rule is not met,
execute the comparison of the next rule.
Check whether the network (a.b.c.d/n) is the same to the first M bitsof A.B.C.D. If it’s the
same, it meets the rule. Return to the property (deny/permit) of this rule.
Otherwise it doesn’t matchthe rule, execute the comparison of the next rule.
If all rules are not matched, return deny.
For the seqencenumber of prefix-list,
there is another command: ip prefix-list sequence-number. Use this command to
control whether the prefix uses the seqencenumber. For details, please refer to the description of this
command.
Designate only the command “no” of the name to delete
whole prefix list.
If there is the following matching object and prefix list definition, the result of matching will be as
follows.
Target route 1: 120.120.0.0/14
Target route 2: 120.120.0.0/16
Target route 3: 120.120.0.0/25
Target route 4: 130.130.0.0/16
Target route 5: 130.130.0.0/8
Target route 6: 130.130.0.0/24
Target route 7: 12.0.0.0/8
ip prefix-list
sample permit 120.120.0.0/8 ge 16 le 24
ip prefix-list
sample deny 130.130.0.0/16
Target route 1: Matching fails. Deny.
Target route 2: Matching succeeds.
Permit.
Target route 3: Matching fails. Deny.
Target route 4: Matching succeeds.
Deny.
Target route 5: Matching succeeds.
Deny.
Target route 6: Matching succeeds.
Deny.
Target route 7: Matching succeeds.
Deny.
Relevant command:
ip prefix-list sequence-number
Configure description of prefix
list. Use “no” command to delete the configuration.
ip
prefix-list <name>
<description> <strings>
no
ip prefix-list <name>
<description>
<name> Name of prefix-list.
<description> Designate description
information of prefix list.
<strings> Description information.
none
global configuration mode
none
The following example adds description information to prefix-list hard to make configuration easy to read:
ip prefix-list hard deny
any
ip prefix-list hard description
This prefix-list is used to filter routes from neighbor hard
ip prefix-list sequence-number
ip prefix-list sequence-number
Set prefix-list using
/not usingseqence number. Use “no” command to delete the setting.
ip
prefix-list sequence-number
no
ip prefix-list sequence-number
none
Default seqencenumber for use.
global configuration mode
This
command is used to control whether to use seqencenumber for each ruleof prefix-list.
After using serial number, only one rule will exist for one serial number. Thus
newly configured rule for one serial number will indicate to delete the old
one. If no serial number is used, command should be used to delete the rule
clearly. If configured without designating serial number, the system conceals
serial numbers allocated to all rules, beginning from 5 and increases 5 by
degrees.
Example:
none
ip prefix-list sequence-number
display relevant information of designated prefix-lists or all prefix-lists including configuration and
statistics of the prefix-lists.
show
ip prefix-list [<summary |
detail> <name>]
<summary> Summarized
information
<detail> Detailed information
name Name
of prefix-list
none
Supervisor
mode
If no name of prefix-list is
designated, information of all prefix-list will be diplayed.
In the following example, a prefix-list
is configured:
ip prefix-list yell permit
130.12.19.0/24
ip prefix-list yell permit
140.20.0.0/16 ge 16 le 24
ip prefix-list yell: 2 entries
count: 2, range entries: 1, sequences: 5 - 10
seq 5 permit 130.12.19.0/24 (hit count: 0, refcount: 10)
seq 10 permit 140.20.0.0/16 ge 16 le 24 (hit count: 0,
refcount: 10)
List all prefix-list
information from the second line. Only one prefix-list is configured here. Its
name is yell. It contains 2 parts.
Count: 2,
meaning that this prefix-list has 2 parts;
range entries:
1, meaning that network range number defined in this prefix-list is 1 one part
corresponding to seq 10);
sequences: 5 – 10, meaning the range of serial
number of each part in this refix-list.
There are definition and statistics of each part.
Hit count: 0,
meaning the times to match this part is 0;
Ref count: 10,
meaning that the time to try to match this part is 10.