]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - man/ipmon.8
Import IP-Filter 5.1.2 into vendor branches using the existing license that
[FreeBSD/FreeBSD.git] / man / ipmon.8
1 .TH IPMON 8
2 .SH NAME
3 ipmon \- monitors /dev/ipl for logged packets
4 .SH SYNOPSIS
5 .B ipmon
6 [
7 .B \-abBDFhnpstvxX
8 ] [
9 .B "\-N <device>"
10 ] [
11 .B "\-L <facility>"
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, \fB\fP for a short
52 packet, \fBn\fP did not match any rules or \fBL\fP for a log rule.
53 .LP
54 6. The addresses.
55 This is actually three fields: the source address and port
56 (separated by a comma), the \fB->\fP symbol, and the destination address
57 and port. E.g.: \fB209.53.17.22,80 -> 198.73.220.17,1722\fP.
58 .LP
59 7. \fBPR\fP followed by the protocol name or number, e.g., \fBPR tcp\fP.
60 .LP
61 8. \fBlen\fP followed by the header length and total length of the packet,
62 e.g., \fBlen 20 40\fP.
63 .LP
64 If the packet is a TCP packet, there will be an additional field starting
65 with a hyphen followed by letters corresponding to any flags that were set.
66 See the ipf.conf manual page for a list of letters and their flags.
67 .LP
68 If the packet is an ICMP packet, there will be two fields at the end,
69 the first always being `icmp', and the next being the ICMP message and
70 submessage type, separated by a slash, e.g., \fBicmp 3/3\fP for a port
71 unreachable message.
72 .LP
73 In order for \fBipmon\fP to properly work, the kernel option
74 \fBIPFILTER_LOG\fP must be turned on in your kernel.  Please see
75 \fBoptions(4)\fP for more details.
76 .LP
77 \fBipmon\fP reopens its log file(s) and rereads its configuration file
78 when it receives a SIGHUP signal.
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 after the headers.
88 .TP
89 .B \-B <binarylogfilename>
90 Enable logging of the raw, unformatted binary data to the specified
91 \fI<binarylogfilename>\fP file.  This can be read, later, using \fBipmon\fP
92 with the \fB-f\fP option.
93 .TP
94 .B \-D
95 Cause ipmon to turn itself into a daemon.  Using subshells or backgrounding
96 of ipmon is not required to turn it into an orphan so it can run indefinitely.
97 .TP
98 .B "\-f <device>"
99 specify an alternative device/file from which to read the log information
100 for normal IP Filter log records.
101 .TP
102 .B \-F
103 Flush the current packet log buffer.  The number of bytes flushed is displayed,
104 even should the result be zero.
105 .TP
106 .B \-L <facility>
107 Using this option allows you to change the default syslog facility that
108 ipmon uses for syslog messages.  The default is local0.
109 .TP
110 .B \-n
111 IP addresses and port numbers will be mapped, where possible, back into
112 hostnames and service names.
113 .TP
114 .B "\-N <device>"
115 Set the logfile to be opened for reading NAT log records from to <device>.
116 .TP
117 .B \-o
118 Specify which log files to actually read data from.  N - NAT logfile,
119 S - State logfile, I - normal IP Filter logfile.  The \fB-a\fP option is
120 equivalent to using \fB-o NSI\fP.
121 .TP
122 .B \-O
123 Specify which log files you do not wish to read from.  This is most sensibly
124 used with the \fB-a\fP.  Letters available as parameters to this are the same
125 as for \fB-o\fP.
126 .TP
127 .B \-p
128 Cause the port number in log messages to always be printed as a number and
129 never attempt to look it up as from \fI/etc/services\fP, etc.
130 .TP
131 .B \-P <pidfile>
132 Write the pid of the ipmon process to a file.  By default this is
133 \fI//etc/opt/ipf/ipmon.pid\fP (Solaris), \fI/var/run/ipmon.pid\fP (44BSD
134 or later) or \fI/etc/ipmon.pid\fP for all others.
135 .TP
136 .B \-s
137 Packet information read in will be sent through syslogd rather than
138 saved to a file.  The default facility when compiled and installed is
139 \fBlocal0\fP.  The following levels are used:
140 .IP
141 .B LOG_INFO
142 \- packets logged using the "log" keyword as the action rather
143 than pass or block.
144 .IP
145 .B LOG_NOTICE
146 \- packets logged which are also passed
147 .IP
148 .B LOG_WARNING
149 \- packets logged which are also blocked
150 .IP
151 .B LOG_ERR
152 \- packets which have been logged and which can be considered
153 "short".
154 .TP
155 .B "\-S <device>"
156 Set the logfile to be opened for reading state log records from to <device>.
157 .TP
158 .B \-t
159 read the input file/device in a manner akin to tail(1).
160 .TP
161 .B \-v
162 show tcp window, ack and sequence fields.
163 .TP
164 .B \-x
165 show the packet data in hex.
166 .TP
167 .B \-X
168 show the log header record data in hex.
169 .SH DIAGNOSTICS
170 \fBipmon\fP expects data that it reads to be consistent with how it should be
171 saved and will abort if it fails an assertion which detects an anomaly in the
172 recorded data.
173 .SH FILES
174 /dev/ipl
175 .br
176 /dev/ipnat
177 .br
178 /dev/ipstate
179 .br
180 /etc/services
181 .SH SEE ALSO
182 ipl(4), ipf(8), ipfstat(8), ipnat(8)
183 .SH BUGS
184 .PP
185 If you find any, please send email to me at darrenr@pobox.com