1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
|
'\" te
.\" To view license terms, attribution, and copyright for IP Filter, the default path is /usr/lib/ipf/IPFILTER.LICENCE. If the Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the installed
.\" location.
.\" Portions Copyright (c) 2008, Sun Microsystems Inc. All Rights Reserved.
.\" Portions Copyright (c) 2013, Joyent, Inc. All Rights Reserved.
.TH IPMON 8 "Oct 30, 2013"
.SH NAME
ipmon \- monitors /dev/ipl for logged packets
.SH SYNOPSIS
.LP
.nf
\fBipmon\fR [\fB-abDFhnpstvxX\fR] [\fB-N\fR \fIdevice\fR] [ [o] [NSI]] [\fB-O\fR [NSI]]
[\fB-P\fR \fIpidfile\fR] [\fB-S\fR \fIdevice\fR] [\fB-f\fR \fIdevice\fR] [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fIfilename\fR]
.fi
.SH DESCRIPTION
.LP
The \fBipmon\fR command is part of a suite of commands associated with the
Solaris IP Filter feature. See \fBipfilter\fR(7).
.sp
.LP
The \fBipmon\fR command opens \fB/dev/ipl\fR for reading and awaits data to be
saved from the packet filter. The binary data read from the device is reprinted
in human readable form. However, IP addresses are not mapped back to hostnames,
nor are ports mapped back to service names. The output goes to standard output,
by default, or a filename, if specified on the command line. Should the
\fB-s\fR option be used, output is sent instead to \fBsyslogd\fR(8). Messages
sent by means of \fBsyslog\fR have the day, month, and year removed from the
message, but the time (including microseconds), as recorded in the log, is
still included.
.sp
.LP
Messages generated by \fBipmon\fR consist of whitespace-separated fields.
Fields common to all messages are:
.RS +4
.TP
.ie t \(bu
.el o
The date of packet receipt. This is suppressed when the message is sent to
\fBsyslog\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
The time of packet receipt. This is in the form
\fIHH\fR:\fIMM\fR:\fISS\fR.\fIF\fR, for hours, minutes, seconds, and fractions
of a second (which can be several digits long).
.RE
.RS +4
.TP
.ie t \(bu
.el o
The name of the interface on which the packet was processed, for example,
\fBib1\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
The group and rule number of the rule, for example, \fB@0:17\fR. These can be
viewed with \fBipfstat\fR \fB-in\fR for input rules or \fBipfstat\fR \fB-in\fR
for output rules. See \fBipfstat\fR(8).
.RE
.RS +4
.TP
.ie t \(bu
.el o
The action: \fBp\fR for passed, \fBb\fR for blocked, \fBs\fR for a short
packet, \fBn\fR did not match any rules, or \fBL\fR for a log rule.
.RE
.RS +4
.TP
.ie t \(bu
.el o
The addresses. This is actually three fields: the source address and port
(separated by a comma), the symbol \(->, and the destination address and port.
For example: \fB209.53.17.22,80 \(-> 198.73.220.17,1722\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fBPR\fR followed by the protocol name or number, for example, \fBPR tcp\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fBlen\fR followed by the header length and total length of the packet, for
example, \fBlen 20 40\fR.
.RE
.sp
.LP
If the packet is a TCP packet, there will be an additional field starting with
a hyphen followed by letters corresponding to any flags that were set. See
\fBipf.conf\fR(5) for a list of letters and their flags.
.sp
.LP
If the packet is an ICMP packet, there will be two fields at the end, the first
always being \fBicmp\fR, the next being the ICMP message and submessage type,
separated by a slash. For example, \fBicmp 3/3\fR for a port unreachable
message.
.SH OPTIONS
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.sp .6
.RS 4n
Open all of the device logfiles for reading log entries. All entries are
displayed to the same output device (stderr or syslog).
.RE
.sp
.ne 2
.na
\fB\fB-b\fR\fR
.ad
.sp .6
.RS 4n
For rules which log the body of a packet, generate hex output representing the
packet contents after the headers.
.RE
.sp
.ne 2
.na
\fB\fB-D\fR\fR
.ad
.sp .6
.RS 4n
Cause \fBipmon\fR to turn itself into a daemon. Using subshells or
backgrounding of \fBipmon\fR is not required to turn it into an orphan so it
can run indefinitely.
.RE
.sp
.ne 2
.na
\fB\fB-f\fR \fIdevice\fR\fR
.ad
.sp .6
.RS 4n
Specify an alternative device/file from which to read the log information for
normal IP Filter log records.
.RE
.sp
.ne 2
.na
\fB\fB-F\fR\fR
.ad
.sp .6
.RS 4n
Flush the current packet log buffer. The number of bytes flushed is displayed,
even if the result is zero.
.RE
.sp
.ne 2
.na
\fB\fB-h\fR\fR
.ad
.sp .6
.RS 4n
Displays usage information.
.RE
.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.sp .6
.RS 4n
IP addresses and port numbers will be mapped, where possible, back into
hostnames and service names.
.RE
.sp
.ne 2
.na
\fB\fB-N\fR \fIdevice\fR\fR
.ad
.sp .6
.RS 4n
Set the logfile to be opened for reading NAT log records from or to
\fIdevice\fR.
.RE
.sp
.ne 2
.na
\fB\fB-o\fR \fIletter\fR\fR
.ad
.sp .6
.RS 4n
Specify which log files from which to actually read data. \fBN\fR, NAT logfile;
\fBS\fR, state logfile; \fBI\fR, normal IP Filter logfile. The \fB-a\fR option
is equivalent to using \fB-o\fR \fBNSI\fR.
.RE
.sp
.ne 2
.na
\fB\fB-O\fR \fIletter\fR\fR
.ad
.sp .6
.RS 4n
Specify which log files you do not wish to read from. This is most commonly
used in conjunction with the \fB-a\fR. Letters available as parameters are the
same as for \fB-o\fR.
.RE
.sp
.ne 2
.na
\fB\fB-p\fR\fR
.ad
.sp .6
.RS 4n
Cause the port number in log messages always to be printed as a number and
never attempt to look it up.
.RE
.sp
.ne 2
.na
\fB\fB-P\fR \fIpidfile\fR\fR
.ad
.sp .6
.RS 4n
Write the PD of the \fBipmon\fR process to a file. By default this is
\fB/var/run/ipmon.pid\fR.
.RE
.sp
.ne 2
.na
\fB\fB-s\fR\fR
.ad
.sp .6
.RS 4n
Packet information read in will be sent through \fBsyslogd\fR rather than saved
to a file. The default facility when compiled and installed is \fBlocal0\fR.
The following levels are used:
.sp
.ne 2
.na
\fB\fBLOG_INFO\fR\fR
.ad
.sp .6
.RS 4n
Packets logged using the \fBlog\fR keyword as the action rather than \fBpass\fR
or \fBblock\fR.
.RE
.sp
.ne 2
.na
\fB\fBLOG_NOTICE\fR\fR
.ad
.sp .6
.RS 4n
Packets logged that are also passed.
.RE
.sp
.ne 2
.na
\fB\fBLOG_WARNING\fR\fR
.ad
.sp .6
.RS 4n
Packets logged that are also blocked.
.RE
.sp
.ne 2
.na
\fB\fBLOG_ERR\fR\fR
.ad
.sp .6
.RS 4n
Packets that have been logged and that can be considered "short".
.RE
.RE
.sp
.ne 2
.na
\fB\fB-S\fR \fIdevice\fR\fR
.ad
.sp .6
.RS 4n
Set the logfile to be opened for reading state log records from or to
\fIdevice\fR.
.RE
.sp
.ne 2
.na
\fB\fB-t\fR\fR
.ad
.sp .6
.RS 4n
Read the input file/device in the way performed by \fBtail\fR(1).
.RE
.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.sp .6
.RS 4n
Show TCP \fBwindow\fR, \fBack\fR, and \fBsequence\fR fields
.RE
.sp
.ne 2
.na
\fB\fB-x\fR\fR
.ad
.sp .6
.RS 4n
Show the packet data in hex.
.RE
.sp
.ne 2
.na
\fB\fB-X\fR\fR
.ad
.sp .6
.RS 4n
Show the log header record data in hex.
.RE
.sp
.ne 2
.na
\fB\fB-z\fR \fIzonename\fR\fR
.ad
.sp .6
.RS 4n
Monitor packets the specified zone's in-zone filter. If neither this option
nor \fB-G\fR is specified, the current zone is used. This command is only
available in the Global Zone. See \fBZONES\fR in \fBipf\fR(8) for more
information.
.RE
.sp
.ne 2
.na
\fB\fB-G\fR \fIzonename\fR\fR
.ad
.sp .6
.RS 4n
Monitor packets for the specified zone's global zone controlled filter. If
neither this option nor \fB-z\fR is specified, the current zone is used. This
command is only available in the Global Zone. See \fBZONES\fR in \fBipf\fR(8)
for more information.
.RE
.SH FILES
.RS +4
.TP
.ie t \(bu
.el o
\fB/dev/ipl\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fB/dev/ipnat\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fB/dev/ipstate\fR
.RE
.SH ATTRIBUTES
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability Committed
.TE
.SH SEE ALSO
.LP
.BR attributes (7),
.BR ipfilter (7),
.BR zones (7),
.BR ipf (8),
.BR ipfstat (8),
.BR ipnat (8)
.sp
.LP
\fI\fR
.SH DIAGNOSTICS
.LP
\fBipmon\fR expects data that it reads to be consistent with how it should be
saved and aborts if it fails an assertion which detects an anomaly in the
recorded data.
|