1 .\" $NetBSD: ipmon.8,v 1.17 2006/04/04 16:17:18 martti Exp $
5 ipmon \- monitors /dev/ipl for logged packets
29 \fBipmon\fP opens \fB/dev/ipl\fP for reading and awaits data to be saved from
30 the packet filter. The binary data read from the device is reprinted in
31 human readable for, however, IP#'s are not mapped back to hostnames, nor are
32 ports mapped back to service names. The output goes to standard output by
33 default or a filename, if given on the command line. Should the \fB\-s\fP
34 option be used, output is instead sent to \fBsyslogd(8)\fP. Messages sent
35 via syslog have the day, month and year removed from the message, but the
36 time (including microseconds), as recorded in the log, is still included.
38 Messages generated by ipmon consist of whitespace separated fields.
39 Fields common to all messages are:
41 1. The date of packet receipt. This is suppressed when the message is
44 2. The time of packet receipt. This is in the form HH:MM:SS.F, for hours,
45 minutes seconds, and fractions of a second (which can be several digits
48 3. The name of the interface the packet was processed on, e.g., \fBwe1\fP.
50 4. The group and rule number of the rule, e.g., \fB@0:17\fP. These can be
51 viewed with \fBipfstat -n\fP.
53 5. The action: \fBp\fP for passed, \fBb\fP for blocked, \fB\fP for a short
54 packet, \fBn\fP did not match any rules or \fBL\fP for a log rule.
57 This is actually three fields: the source address and port
58 (separated by a comma), the \fB->\fP symbol, and the destination address
59 and port. E.g.: \fB209.53.17.22,80 -> 198.73.220.17,1722\fP.
61 7. \fBPR\fP followed by the protocol name or number, e.g., \fBPR tcp\fP.
63 8. \fBlen\fP followed by the header length and total length of the packet,
64 e.g., \fBlen 20 40\fP.
66 If the packet is a TCP packet, there will be an additional field starting
67 with a hyphen followed by letters corresponding to any flags that were set.
68 See the ipf.conf manual page for a list of letters and their flags.
70 If the packet is an ICMP packet, there will be two fields at the end,
71 the first always being `icmp', and the next being the ICMP message and
72 submessage type, separated by a slash, e.g., \fBicmp 3/3\fP for a port
75 In order for \fBipmon\fP to properly work, the kernel option
76 \fBIPFILTER_LOG\fP must be turned on in your kernel. Please see
77 \fBoptions(4)\fP for more details.
79 \fBipmon\fP reopens its log file(s) and rereads its configuration file
80 when it receives a SIGHUP signal.
84 Open all of the device logfiles for reading log entries from. All entries
85 are displayed to the same output 'device' (stderr or syslog).
88 For rules which log the body of a packet, generate hex output representing
89 the packet contents after the headers.
91 .B \-B <binarylogfilename>
92 Enable logging of the raw, unformatted binary data to the specified
93 \fI<binarylogfilename>\fP file. This can be read, later, using \fBipmon\fP
94 with the \fB-f\fP option.
97 Cause ipmon to turn itself into a daemon. Using subshells or backgrounding
98 of ipmon is not required to turn it into an orphan so it can run indefinitely.
101 specify an alternative device/file from which to read the log information
102 for normal IP Filter log records.
105 Flush the current packet log buffer. The number of bytes flushed is displayed,
106 even should the result be zero.
109 Using this option allows you to change the default syslog facility that
110 ipmon uses for syslog messages. The default is local0.
113 IP addresses and port numbers will be mapped, where possible, back into
114 hostnames and service names.
117 Set the logfile to be opened for reading NAT log records from to <device>.
120 Specify which log files to actually read data from. N - NAT logfile,
121 S - State logfile, I - normal IP Filter logfile. The \fB-a\fP option is
122 equivalent to using \fB-o NSI\fP.
125 Specify which log files you do not wish to read from. This is most sensibly
126 used with the \fB-a\fP. Letters available as parameters to this are the same
130 Cause the port number in log messages to always be printed as a number and
131 never attempt to look it up as from \fI/etc/services\fP, etc.
134 Write the pid of the ipmon process to a file. By default this is
135 \fI//etc/opt/ipf/ipmon.pid\fP (Solaris), \fI/var/run/ipmon.pid\fP (44BSD
136 or later) or \fI/etc/ipmon.pid\fP for all others.
139 Packet information read in will be sent through syslogd rather than
140 saved to a file. The default facility when compiled and installed is
141 \fBlocal0\fP. The following levels are used:
144 \- packets logged using the "log" keyword as the action rather
148 \- packets logged which are also passed
151 \- packets logged which are also blocked
154 \- packets which have been logged and which can be considered
158 Set the logfile to be opened for reading state log records from to <device>.
161 read the input file/device in a manner akin to tail(1).
164 show tcp window, ack and sequence fields.
167 show the packet data in hex.
170 show the log header record data in hex.
172 \fBipmon\fP expects data that it reads to be consistent with how it should be
173 saved and will abort if it fails an assertion which detects an anomaly in the
184 ipl(4), ipf(8), ipfstat(8), ipnat(8)
187 If you find any, please send email to me at darrenr@pobox.com