]> git.proxmox.com Git - mirror_frr.git/blob - doc/user/filter.rst
Merge pull request #8304 from mjstapp/fix_zmq_xref
[mirror_frr.git] / doc / user / filter.rst
1 *********
2 Filtering
3 *********
4
5 FRR provides many very flexible filtering features. Filtering is used
6 for both input and output of the routing information. Once filtering is
7 defined, it can be applied in any direction.
8
9 IP Access List
10 ==============
11
12 .. clicmd:: access-list NAME [seq (1-4294967295)] permit IPV4-NETWORK
13
14 .. clicmd:: access-list NAME [seq (1-4294967295)] deny IPV4-NETWORK
15
16 seq
17 seq `number` can be set either automatically or manually. In the
18 case that sequential numbers are set manually, the user may pick any
19 number less than 4294967295. In the case that sequential number are set
20 automatically, the sequential number will increase by a unit of five (5)
21 per list. If a list with no specified sequential number is created
22 after a list with a specified sequential number, the list will
23 automatically pick the next multiple of five (5) as the list number.
24 For example, if a list with number 2 already exists and a new list with
25 no specified number is created, the next list will be numbered 5. If
26 lists 2 and 7 already exist and a new list with no specified number is
27 created, the new list will be numbered 10.
28
29 Basic filtering is done by `access-list` as shown in the
30 following example.
31
32 .. code-block:: frr
33
34 access-list filter deny 10.0.0.0/9
35 access-list filter permit 10.0.0.0/8
36 access-list filter seq 13 permit 10.0.0.0/7
37
38
39 IP Prefix List
40 ==============
41
42 *ip prefix-list* provides the most powerful prefix based
43 filtering mechanism. In addition to *access-list* functionality,
44 *ip prefix-list* has prefix length range specification and
45 sequential number specification. You can add or delete prefix based
46 filters to arbitrary points of prefix-list using sequential number specification.
47
48 If no ip prefix-list is specified, it acts as permit. If *ip prefix-list*
49 is defined, and no match is found, default deny is applied.
50
51 .. clicmd:: ip prefix-list NAME (permit|deny) PREFIX [le LEN] [ge LEN]
52
53 .. clicmd:: ip prefix-list NAME seq NUMBER (permit|deny) PREFIX [le LEN] [ge LEN]
54
55 You can create *ip prefix-list* using above commands.
56
57 seq
58 seq `number` can be set either automatically or manually. In the
59 case that sequential numbers are set manually, the user may pick any
60 number less than 4294967295. In the case that sequential number are set
61 automatically, the sequential number will increase by a unit of five (5)
62 per list. If a list with no specified sequential number is created
63 after a list with a specified sequential number, the list will
64 automatically pick the next multiple of five (5) as the list number.
65 For example, if a list with number 2 already exists and a new list with
66 no specified number is created, the next list will be numbered 5. If
67 lists 2 and 7 already exist and a new list with no specified number is
68 created, the new list will be numbered 10.
69
70 le
71 Specifies prefix length. The prefix list will be applied if the prefix
72 length is less than or equal to the le prefix length.
73
74 ge
75 Specifies prefix length. The prefix list will be applied if the prefix
76 length is greater than or equal to the ge prefix length.
77
78
79 Less than or equal to prefix numbers and greater than or equal to
80 prefix numbers can be used together. The order of the le and ge
81 commands does not matter.
82
83 If a prefix list with a different sequential number but with the exact
84 same rules as a previous list is created, an error will result.
85 However, in the case that the sequential number and the rules are
86 exactly similar, no error will result.
87
88 If a list with the same sequential number as a previous list is created,
89 the new list will overwrite the old list.
90
91 Matching of IP Prefix is performed from the smaller sequential number to the
92 larger. The matching will stop once any rule has been applied.
93
94 In the case of no le or ge command, the prefix length must match exactly the
95 length specified in the prefix list.
96
97
98 .. _ip-prefix-list-description:
99
100 ip prefix-list description
101 --------------------------
102
103 .. clicmd:: ip prefix-list NAME description DESC
104
105 Descriptions may be added to prefix lists. This command adds a
106 description to the prefix list.
107
108
109 .. _showing-ip-prefix-list:
110
111 Showing ip prefix-list
112 ----------------------
113
114 .. clicmd:: show ip prefix-list
115
116 Display all IP prefix lists.
117
118 .. clicmd:: show ip prefix-list NAME
119
120 Show IP prefix list can be used with a prefix list name.
121
122 .. clicmd:: show ip prefix-list NAME seq NUM
123
124 Show IP prefix list can be used with a prefix list name and sequential
125 number.
126
127 .. clicmd:: show ip prefix-list NAME A.B.C.D/M
128
129 If the command longer is used, all prefix lists with prefix lengths equal to
130 or longer than the specified length will be displayed. If the command first
131 match is used, the first prefix length match will be displayed.
132
133 .. clicmd:: show ip prefix-list NAME A.B.C.D/M longer
134 .. clicmd:: show ip prefix-list NAME A.B.C.D/M first-match
135 .. clicmd:: show ip prefix-list summary
136 .. clicmd:: show ip prefix-list summary NAME
137 .. clicmd:: show ip prefix-list detail
138 .. clicmd:: show ip prefix-list detail NAME
139
140 Clear counter of ip prefix-list
141 -------------------------------
142
143 .. clicmd:: clear ip prefix-list [NAME [A.B.C.D/M]]
144
145 Clears the counters of all IP prefix lists. Clear IP Prefix List can be used
146 with a specified NAME or NAME and prefix.