Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / contrib / ipfilter / man / ipmon.8
1 .\" $FreeBSD: src/contrib/ipfilter/man/ipmon.8,v 1.6.2.5 2003/03/01 03:55:53 darrenr Exp $
2 .\" $DragonFly: src/contrib/ipfilter/man/ipmon.8,v 1.2 2003/06/17 04:24:02 dillon Exp $
3 .TH ipmon 8
4 .SH NAME
5 ipmon \- monitors /dev/ipl for logged packets
6 .SH SYNOPSIS
7 .B ipmon
8 [
9 .B \-abDFhnpstvxX
10 ] [
11 .B "\-N <device>"
12 ] [
13 .B "\-o [NSI]"
14 ] [
15 .B "\-O [NSI]"
16 ] [
17 .B "\-P <pidfile>"
18 ] [
19 .B "\-S <device>"
20 ] [
21 .B "\-f <device>"
22 ] [
23 .B <filename>
24 ]
25 .SH DESCRIPTION
26 .LP
27 \fBipmon\fP opens \fB/dev/ipl\fP for reading and awaits data to be saved from
28 the packet filter.  The binary data read from the device is reprinted in
29 human readable for, however, IP#'s are not mapped back to hostnames, nor are
30 ports mapped back to service names.  The output goes to standard output by
31 default or a filename, if given on the command line.  Should the \fB\-s\fP
32 option be used, output is instead sent to \fBsyslogd(8)\fP.  Messages sent
33 via syslog have the day, month and year removed from the message, but the
34 time (including microseconds), as recorded in the log, is still included.
35 .LP
36 Messages generated by ipmon consist of whitespace separated fields.
37 Fields common to all messages are:
38 .LP
39 1. The date of packet receipt. This is suppressed when the message is
40 sent to syslog.
41 .LP
42 2. The time of packet receipt. This is in the form HH:MM:SS.F, for hours,
43 minutes seconds, and fractions of a second (which can be several digits
44 long).
45 .LP
46 3. The name of the interface the packet was processed on, e.g., \fBwe1\fP.
47 .LP
48 4. The group and rule number of the rule, e.g., \fB@0:17\fP. These can be
49 viewed with \fBipfstat -n\fP.
50 .LP
51 5. The action: \fBp\fP for passed, \fBb\fP for blocked, \fBS\fP for a short
52 packet, \fBn\fP did not match any rules, \fBL\fP for a log rule.  The order
53 of precedence in showing flags is: S, p, b, n, L.  A capital \fBP\fP or
54 \fBB\fP means that the packet has been logged due to a global logging
55 setting, not a particular rule.
56 .LP
57 6. The addresses.
58 This is actually three fields: the source address and port
59 (separated by a comma), the \fB->\fP symbol, and the destination address
60 and port. E.g.: \fB209.53.17.22,80 -> 198.73.220.17,1722\fP.
61 .LP
62 7. \fBPR\fP followed by the protocol name or number, e.g., \fBPR tcp\fP.
63 .LP
64 8. \fBlen\fP followed by the header length and total length of the packet,
65 e.g., \fBlen 20 40\fP.
66 .LP
67 If the packet is a TCP packet, there will be an additional field starting
68 with a hyphen followed by letters corresponding to any flags that were set.
69 See the ipf.conf manual page for a list of letters and their flags.
70 .LP
71 If the packet is an ICMP packet, there will be two fields at the end,
72 the first always being `icmp', and the next being the ICMP message and
73 submessage type, separated by a slash, e.g., \fBicmp 3/3\fP for a port
74 unreachable message.
75 .LP
76 In order for \fBipmon\fP to properly work, the kernel option
77 \fBIPFILTER_LOG\fP must be turned on in your kernel.  Please see
78 \fBoptions(4)\fP for more details.
79 .SH OPTIONS
80 .TP
81 .B \-a
82 Open all of the device logfiles for reading log entries from.  All entries
83 are displayed to the same output 'device' (stderr or syslog).
84 .TP
85 .B \-b
86 For rules which log the body of a packet, generate hex output representing
87 the packet contents afte the headers.
88 .TP
89 .B \-D
90 Cause ipmon to turn itself into a daemon.  Using subshells or backgrounding
91 of ipmon is not required to turn it into an orphan so it can run indefinately.
92 .TP
93 .B "\-f <device>"
94 specify an alternative device/file from which to read the log information
95 for normal IP Filter log records.
96 .TP
97 .B \-F
98 Flush the current packet log buffer.  The number of bytes flushed is displayed,
99 even should the result be zero.
100 .TP
101 .B \-n
102 IP addresses and port numbers will be mapped, where possible, back into
103 hostnames and service names.
104 .TP
105 .B "\-N <device>"
106 Set the logfile to be opened for reading NAT log records from to <device>.
107 .TP
108 .B \-o
109 Specify which log files to actually read data from.  N - NAT logfile,
110 S - State logfile, I - normal IP Filter logfile.  The \fB-a\fP option is
111 equivalent to using \fB-o NSI\fP.
112 .TP
113 .B \-O
114 Specify which log files you do not wish to read from.  This is most sensibly
115 used with the \fB-a\fP.  Letters available as parameters to this are the same
116 as for \fB-o\fP.
117 .TP
118 .B \-p
119 Cause the port number in log messages to always be printed as a number and
120 never attempt to look it up as from \fI/etc/services\fP, etc.
121 .TP
122 .B \-P <pidfile>
123 Write the pid of the ipmon process to a file.  By default this is
124 \fI//etc/opt/ipf/ipmon.pid\fP (Solaris), \fI/var/run/ipmon.pid\fP (44BSD
125 or later) or \fI/etc/ipmon.pid\fP for all others.
126 .TP
127 .B \-s
128 Packet information read in will be sent through syslogd rather than
129 saved to a file.  The default facility when compiled and installed is
130 \fBlocal0\fP.  The following levels are used:
131 .IP
132 .B LOG_INFO
133 \- packets logged using the "log" keyword as the action rather
134 than pass or block.
135 .IP
136 .B LOG_NOTICE
137 \- packets logged which are also passed
138 .IP
139 .B LOG_WARNING
140 \- packets logged which are also blocked
141 .IP
142 .B LOG_ERR
143 \- packets which have been logged and which can be considered
144 "short".
145 .TP
146 .B "\-S <device>"
147 Set the logfile to be opened for reading state log records from to <device>.
148 .TP
149 .B \-t
150 read the input file/device in a manner akin to tail(1).
151 .TP
152 .B \-v
153 show tcp window, ack and sequence fields.
154 .TP
155 .B \-x
156 show the packet data in hex.
157 .TP
158 .B \-X
159 show the log header record data in hex.
160 .SH DIAGNOSTICS
161 \fBipmon\fP expects data that it reads to be consistent with how it should be
162 saved and will abort if it fails an assertion which detects an anomaly in the
163 recorded data.
164 .SH FILES
165 /dev/ipl
166 .br
167 /dev/ipnat
168 .br
169 /dev/ipstate
170 .br
171 /etc/services
172 .SH SEE ALSO
173 ipl(4), ipf(8), ipfstat(8), ipnat(8)
174 .\".SH BUGS