1 .\" $FreeBSD: src/contrib/ipfilter/man/ipmon.8,v 1.6.2.5 2003/03/01 03:55:53 darrenr Exp $
2 .\" $FreeBSD: src/contrib/ipfilter/man/ipmon.8,v 1.6.2.6 2004/07/04 09:24:40 darrenr Exp $
5 ipmon \- monitors /dev/ipl for logged packets
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.
36 Messages generated by ipmon consist of whitespace separated fields.
37 Fields common to all messages are:
39 1. The date of packet receipt. This is suppressed when the message is
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
46 3. The name of the interface the packet was processed on, e.g., \fBwe1\fP.
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.
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.
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.
62 7. \fBPR\fP followed by the protocol name or number, e.g., \fBPR tcp\fP.
64 8. \fBlen\fP followed by the header length and total length of the packet,
65 e.g., \fBlen 20 40\fP.
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.
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
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.
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).
86 For rules which log the body of a packet, generate hex output representing
87 the packet contents after the headers.
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 indefinitely.
94 specify an alternative device/file from which to read the log information
95 for normal IP Filter log records.
98 Flush the current packet log buffer. The number of bytes flushed is displayed,
99 even should the result be zero.
102 IP addresses and port numbers will be mapped, where possible, back into
103 hostnames and service names.
106 Set the logfile to be opened for reading NAT log records from to <device>.
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.
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
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.
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.
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:
133 \- packets logged using the "log" keyword as the action rather
137 \- packets logged which are also passed
140 \- packets logged which are also blocked
143 \- packets which have been logged and which can be considered
147 Set the logfile to be opened for reading state log records from to <device>.
150 read the input file/device in a manner akin to tail(1).
153 show tcp window, ack and sequence fields.
156 show the packet data in hex.
159 show the log header record data in hex.
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
173 ipl(4), ipf(8), ipfstat(8), ipnat(8)
176 If you find any, please send email to me at darrenr@pobox.com