File: flow-filter.sgml

package info (click to toggle)
flow-tools 1%3A0.68-12
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 5,132 kB
  • ctags: 5,259
  • sloc: ansic: 43,197; sh: 1,674; perl: 661; python: 629; yacc: 303; makefile: 207; lex: 49
file content (341 lines) | stat: -rw-r--r-- 7,796 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN">
<refentry>

<refmeta>
<refentrytitle>
<application>flow-filter</application>
</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>

<refnamediv>
<refname>
<application>flow-filter</application>
</refname>
<refpurpose>
Filter flows.
</refpurpose>
</refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>flow-filter</command>
<arg>-hko</arg>
<arg>-a<replaceable> src_as_filter</replaceable></arg>
<arg>-A<replaceable> dst_as_filter</replaceable></arg>
<arg>-b<replaceable> big</replaceable>|<replaceable>little</replaceable></arg>
<arg>-C<replaceable> comment</replaceable></arg>
<arg>-D<replaceable> dstaddr_filter_name</replaceable></arg>
<arg>-d<replaceable> debug_level</replaceable></arg>
<arg>-e<replaceable> exaddr_filter</replaceable></arg>
<arg>-f<replaceable> acl_fname</replaceable></arg>
<arg>-i<replaceable> input_filter</replaceable></arg>
<arg>-I<replaceable> output_filter</replaceable></arg>
<arg>-p<replaceable> srcport_filter</replaceable></arg>
<arg>-P<replaceable> dstport_filter</replaceable></arg>
<arg>-r<replaceable> ipprot_filter</replaceable></arg>
<arg>-S<replaceable> srcaddr_filter_name</replaceable></arg>
<arg>-t<replaceable> tos_filter</replaceable></arg>
<arg>-T<replaceable> tcp_flags_filter</replaceable></arg>
<arg>-x<replaceable> nexthop_filter_name</replaceable></arg>
<arg>-z<replaceable> z_level</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>


<refsect1>
<title>DESCRIPTION</title>
<para>
The <command>flow-filter</command> utility will filter flows based on
user selectable criteria.  The IP address filters are defined in 
<filename>flow.acl</filename> or by the filename specified by -f.
</para>
<para>
Other filters such as input interface and ports are defined on the
command line.  These filters accept range and negation operators, ie
-i1-15 for input interfaces 1 through 15 or -i1,15 for input interfaces
1 and 15, or !1,15 for not input interfaces 1 and 15.
</para>
<para>
The syntax is kludgy and needs reworked but works for most applications.

</para>
</refsect1>

<refsect1>
<title>OPTIONS</title>
<variablelist>

<varlistentry>
<term>-a<replaceable> src_as_filter</replaceable></term>
<listitem>
<para>
Source AS filter, ie -a159 to permit Autonomous System 159.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-A<replaceable> dst_as_filter</replaceable></term>
<listitem>
<para>
Destination AS filter, ie -A159,3112 to permit Autonomous Systems 159 and 3112.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-b<replaceable> big</replaceable>|<replaceable>little</replaceable</term>
<listitem>
<para>
Byte order of output.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-C<replaceable> Comment</replaceable></term>
<listitem>
<para>
Add a comment. 
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-d<replaceable> debug_level</replaceable></term>
<listitem>
<para>
Enable debugging.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-D<replaceable> dstaddr_filter_name</replaceable></term>
<listitem>
<para>
Destination IP address filter.  This is the name or number of a standard
access list defined in <filename>flow.acl</filename> or the file specified
by -f.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-e<replaceable> exaddr_filter</replaceable></term>
<listitem>
<para>
Exporter IP address filter.  One exporter address can be filtered.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-f<replaceable> acl_fname</replaceable></term>
<listitem>
<para>
Access list filename.  Defaults to <filename>flow.acl</filename>.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-h</term>
<listitem>
<para>
Display help.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-i<replaceable> input_filter</replaceable></term>
<listitem>
<para>
Input interface filter, ie -i0 to permit traffic from interface 0.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-k</term>
<listitem>
<para>
Keep time from input.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-I<replaceable> output_filter</replaceable></term>
<listitem>
<para>
Output interface filter, ie -I0 to permit traffic to interface 0.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-o</term>
<listitem>
<para>
Logical OR instead of AND filters.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-p<replaceable> srcport_filter</replaceable></term>
<listitem>
<para>
Source port filter, ie -p80 to only permit source port 80.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-P<replaceable> dstport_filter</replaceable></term>
<listitem>
<para>
Destination port filter, ie -P80,8080 to permit destination ports 80 and 8080.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-r<replaceable> ipprot_filter</replaceable></term>
<listitem>
<para>
IP Protocol filter, ie -r6 to only permit TCP traffic.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-S<replaceable> srcaddr_filter_name</replaceable></term>
<listitem>
<para>
Source IP address filter.  This is the name or number of a standard
access list defined in <filename>flow.acl</filename> or the file
specified by -f.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-t<replaceable> tos_filter</replaceable></term>
<listitem>
<para>
ToS bits filter.  An optional mask is available which is applied to
the tos field before comparing to the filter list.  For example to
match a tos bit pattern of 101xxxxx use 0xA0/0xE0.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-T<replaceable> tcp_flags_filter</replaceable></term>
<listitem>
<para>
TCP bits filter.  An optional mask is available which is applied to
the TCP flags field before comparing to the filter list.  For example to
match a flows with the SYN bit set use 0x2/0x2.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-x<replaceable> nexthop_filter_name</replaceable></term>
<listitem>
<para>
NextHop IP address filter.  This is the name or number of a standard
access list defined in <filename>flow.acl</filename> or the file
specified by -f.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-z<replaceable> z_level</replaceable></term>
<listitem>
<para>
Configure compression level to <replaceable> z_level</replaceable>.  0 is
disabled (no compression), 9 is highest compression.
</para>
</listitem>
</varlistentry>

</variablelist>
</refsect1>

<refsect1>
<title>EXAMPLES</title>

<informalexample>
<para>
Print all traffic with a destination port of 80.
</para>
<para>
  <command>flow-cat /flows/krc4 | flow-filter -P80 | flow-print</command>
</para>
</informalexample>

<informalexample>
<para>
Print all traffic with with source IP 10.0.0.1.  Populate
<filename>flow.acl</filename> with
  ip access-list standard badguy permit host 10.0.0.1
</para>
<para>
  <command>flow-cat /flows/krc4 | flow-filter -Sbadguy | flow-print</command>
</para>
</informalexample>

<informalexample>
<para>
Report all destinations that IP 10.0.0.1 has sent traffic to.  Sort by
octets.  Populate <filename>flow.acl</filename> with
  ip access-list standard badguy permit host 10.0.0.1
</para>
<para>
  <command>flow-cat /flows/krc4 | flow-filter -Sbadguy | flow-stat -f8 -S2</command>
</para>
</informalexample>

</refsect1>

<refsect1>
<title>BUGS</title>
<para>
Extended access lists are not fully implemented.
The command line filter syntax is a kludge.
</para>
</refsect1>

<refsect1>
<title>NOTES</title>
<para>
Use flow-nfilter.
</para>
</refsect1>

<refsect1>
<title>AUTHOR</title>
<para>
<author>
<firstname>Mark</firstname>
<surname>Fullmer</surname>
</author>
<email>maf@splintered.net</email>
</para>
</refsect1>

<refsect1>
<title>SEE ALSO</title>
<para>
<application>flow-tools</application>(1)
</para>
</refsect1>

</refentry>