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 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554
|
<HTML
><HEAD
><TITLE
>flow-filter</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.73
"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><H1
><A
NAME="AEN1"
><SPAN
CLASS="APPLICATION"
>flow-filter</SPAN
></A
></H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN6"
></A
><H2
>Name</H2
><SPAN
CLASS="APPLICATION"
>flow-filter</SPAN
> -- Filter flows.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN10"
></A
><H2
>Synopsis</H2
><P
><B
CLASS="COMMAND"
>flow-filter</B
> [-hko] [-a<TT
CLASS="REPLACEABLE"
><I
> src_as_filter</I
></TT
>] [-A<TT
CLASS="REPLACEABLE"
><I
> dst_as_filter</I
></TT
>] [-b<TT
CLASS="REPLACEABLE"
><I
> big</I
></TT
>|<TT
CLASS="REPLACEABLE"
><I
>little</I
></TT
>] [-C<TT
CLASS="REPLACEABLE"
><I
> comment</I
></TT
>] [-D<TT
CLASS="REPLACEABLE"
><I
> dstaddr_filter_name</I
></TT
>] [-d<TT
CLASS="REPLACEABLE"
><I
> debug_level</I
></TT
>] [-e<TT
CLASS="REPLACEABLE"
><I
> exaddr_filter</I
></TT
>] [-f<TT
CLASS="REPLACEABLE"
><I
> acl_fname</I
></TT
>] [-i<TT
CLASS="REPLACEABLE"
><I
> input_filter</I
></TT
>] [-I<TT
CLASS="REPLACEABLE"
><I
> output_filter</I
></TT
>] [-p<TT
CLASS="REPLACEABLE"
><I
> srcport_filter</I
></TT
>] [-P<TT
CLASS="REPLACEABLE"
><I
> dstport_filter</I
></TT
>] [-r<TT
CLASS="REPLACEABLE"
><I
> ipprot_filter</I
></TT
>] [-S<TT
CLASS="REPLACEABLE"
><I
> srcaddr_filter_name</I
></TT
>] [-t<TT
CLASS="REPLACEABLE"
><I
> tos_filter</I
></TT
>] [-T<TT
CLASS="REPLACEABLE"
><I
> tcp_flags_filter</I
></TT
>] [-x<TT
CLASS="REPLACEABLE"
><I
> nexthop_filter_name</I
></TT
>] [-z<TT
CLASS="REPLACEABLE"
><I
> z_level</I
></TT
>]</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN51"
></A
><H2
>DESCRIPTION</H2
><P
>The <B
CLASS="COMMAND"
>flow-filter</B
> utility will filter flows based on
user selectable criteria. The IP address filters are defined in
<TT
CLASS="FILENAME"
>flow.acl</TT
> or by the filename specified by -f.</P
><P
>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.</P
><P
>The syntax is kludgy and needs reworked but works for most applications. </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN58"
></A
><H2
>OPTIONS</H2
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>-a<TT
CLASS="REPLACEABLE"
><I
> src_as_filter</I
></TT
></DT
><DD
><P
>Source AS filter, ie -a159 to permit Autonomous System 159.</P
></DD
><DT
>-A<TT
CLASS="REPLACEABLE"
><I
> dst_as_filter</I
></TT
></DT
><DD
><P
>Destination AS filter, ie -A159,3112 to permit Autonomous Systems 159 and 3112.</P
></DD
><DT
>-b<TT
CLASS="REPLACEABLE"
><I
> big</I
></TT
>|<TT
CLASS="REPLACEABLE"
><I
>little</I
></TT
></DT
><DD
><P
>Byte order of output.</P
></DD
><DT
>-C<TT
CLASS="REPLACEABLE"
><I
> Comment</I
></TT
></DT
><DD
><P
>Add a comment. </P
></DD
><DT
>-d<TT
CLASS="REPLACEABLE"
><I
> debug_level</I
></TT
></DT
><DD
><P
>Enable debugging.</P
></DD
><DT
>-D<TT
CLASS="REPLACEABLE"
><I
> dstaddr_filter_name</I
></TT
></DT
><DD
><P
>Destination IP address filter. This is the name or number of a standard
access list defined in <TT
CLASS="FILENAME"
>flow.acl</TT
> or the file specified
by -f.</P
></DD
><DT
>-e<TT
CLASS="REPLACEABLE"
><I
> exaddr_filter</I
></TT
></DT
><DD
><P
>Exporter IP address filter. One exporter address can be filtered.</P
></DD
><DT
>-f<TT
CLASS="REPLACEABLE"
><I
> acl_fname</I
></TT
></DT
><DD
><P
>Access list filename. Defaults to <TT
CLASS="FILENAME"
>flow.acl</TT
>.</P
></DD
><DT
>-h</DT
><DD
><P
>Display help.</P
></DD
><DT
>-i<TT
CLASS="REPLACEABLE"
><I
> input_filter</I
></TT
></DT
><DD
><P
>Input interface filter, ie -i0 to permit traffic from interface 0.</P
></DD
><DT
>-k</DT
><DD
><P
>Keep time from input.</P
></DD
><DT
>-I<TT
CLASS="REPLACEABLE"
><I
> output_filter</I
></TT
></DT
><DD
><P
>Output interface filter, ie -I0 to permit traffic to interface 0.</P
></DD
><DT
>-o</DT
><DD
><P
>Logical OR instead of AND filters.</P
></DD
><DT
>-p<TT
CLASS="REPLACEABLE"
><I
> srcport_filter</I
></TT
></DT
><DD
><P
>Source port filter, ie -p80 to only permit source port 80.</P
></DD
><DT
>-P<TT
CLASS="REPLACEABLE"
><I
> dstport_filter</I
></TT
></DT
><DD
><P
>Destination port filter, ie -P80,8080 to permit destination ports 80 and 8080.</P
></DD
><DT
>-r<TT
CLASS="REPLACEABLE"
><I
> ipprot_filter</I
></TT
></DT
><DD
><P
>IP Protocol filter, ie -r6 to only permit TCP traffic.</P
></DD
><DT
>-S<TT
CLASS="REPLACEABLE"
><I
> srcaddr_filter_name</I
></TT
></DT
><DD
><P
>Source IP address filter. This is the name or number of a standard
access list defined in <TT
CLASS="FILENAME"
>flow.acl</TT
> or the file
specified by -f.</P
></DD
><DT
>-t<TT
CLASS="REPLACEABLE"
><I
> tos_filter</I
></TT
></DT
><DD
><P
>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.</P
></DD
><DT
>-T<TT
CLASS="REPLACEABLE"
><I
> tcp_flags_filter</I
></TT
></DT
><DD
><P
>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.</P
></DD
><DT
>-x<TT
CLASS="REPLACEABLE"
><I
> nexthop_filter_name</I
></TT
></DT
><DD
><P
>NextHop IP address filter. This is the name or number of a standard
access list defined in <TT
CLASS="FILENAME"
>flow.acl</TT
> or the file
specified by -f.</P
></DD
><DT
>-z<TT
CLASS="REPLACEABLE"
><I
> z_level</I
></TT
></DT
><DD
><P
>Configure compression level to <TT
CLASS="REPLACEABLE"
><I
> z_level</I
></TT
>. 0 is
disabled (no compression), 9 is highest compression.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN169"
></A
><H2
>EXAMPLES</H2
><DIV
CLASS="INFORMALEXAMPLE"
><A
NAME="AEN171"
></A
><P
></P
><P
>Print all traffic with a destination port of 80.</P
><P
> <B
CLASS="COMMAND"
>flow-cat /flows/krc4 | flow-filter -P80 | flow-print</B
></P
><P
></P
></DIV
><DIV
CLASS="INFORMALEXAMPLE"
><A
NAME="AEN175"
></A
><P
></P
><P
>Print all traffic with with source IP 10.0.0.1. Populate
<TT
CLASS="FILENAME"
>flow.acl</TT
> with
ip access-list standard badguy permit host 10.0.0.1</P
><P
> <B
CLASS="COMMAND"
>flow-cat /flows/krc4 | flow-filter -Sbadguy | flow-print</B
></P
><P
></P
></DIV
><DIV
CLASS="INFORMALEXAMPLE"
><A
NAME="AEN180"
></A
><P
></P
><P
>Report all destinations that IP 10.0.0.1 has sent traffic to. Sort by
octets. Populate <TT
CLASS="FILENAME"
>flow.acl</TT
> with
ip access-list standard badguy permit host 10.0.0.1</P
><P
> <B
CLASS="COMMAND"
>flow-cat /flows/krc4 | flow-filter -Sbadguy | flow-stat -f8 -S2</B
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN185"
></A
><H2
>BUGS</H2
><P
>Extended access lists are not fully implemented.
The command line filter syntax is a kludge.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN188"
></A
><H2
>NOTES</H2
><P
>Use flow-nfilter.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN191"
></A
><H2
>AUTHOR</H2
><P
>Mark Fullmer
<TT
CLASS="EMAIL"
><<A
HREF="mailto:maf@splintered.net"
>maf@splintered.net</A
>></TT
></P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN198"
></A
><H2
>SEE ALSO</H2
><P
><SPAN
CLASS="APPLICATION"
>flow-tools</SPAN
>(1)</P
></DIV
></BODY
></HTML
>
|