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