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