1DUMPCAP(1)                                                          DUMPCAP(1)
2
3
4

NAME

6       dumpcap - Dump network traffic
7

SYNOPSIS

9       dumpcap [ -a|--autostop <capture autostop condition> ] ...
10       [ -b|--ring-buffer <capture ring buffer option> ] ...
11       [ -B|--buffer-size <capture buffer size> ]
12       [ -c <capture packet count> ] [ -C <byte limit> ] [ -d ]
13       [ -D|--list-interfaces ] [ -f <capture filter> ] [ -g ] [ -h|--help ]
14       [ -i|--interface <capture interface>|rpcap://<host>:<port>/<capture interface>|TCP@<host>:<port>|- ]
15       [ -I|--monitor-mode ]
16       [ -k <freq>,[<type>],[<center_freq1>],[<center_freq2>] ]
17       [ -L|--list-data-link-types ] [ -M ] [ -n ] [ -N <packet limit> ]
18       [ -p|--no-promiscuous-mode ] [ --ifdescr <description> ]
19       [ --ifname <name> ] [ -P ] [ -q ]
20       [ -s|--snapshot-length <capture snaplen> ] [ -S ] [ -t ]
21       [ --temp-dir <directory> ] [ -v|--version ] [ -w <outfile> ]
22       [ -y|--linktype <capture link type> ] [ --capture-comment <comment> ]
23       [ --list-time-stamp-types ] [ --time-stamp-type <type> ]
24

DESCRIPTION

26       Dumpcap is a network traffic dump tool. It lets you capture packet data
27       from a live network and write the packets to a file. Dumpcap's default
28       capture file format is pcapng format. When the -P option is specified,
29       the output file is written in the pcap format.
30
31       Without any options set it will use the libpcap, Npcap, or WinPcap
32       library to capture traffic from the first available network interface
33       and writes the received raw packet data, along with the packets' time
34       stamps into a capture file.
35
36       If the -w option is not specified, Dumpcap writes to a newly created
37       capture file with a randomly chosen name. If the -w option is
38       specified, Dumpcap writes to the file specified by that option.
39
40       Packet capturing is performed with the pcap library. The capture filter
41       syntax follows the rules of the pcap library.
42

OPTIONS

44       -a|--autostop  <capture autostop condition>
45
46           Specify a criterion that specifies when Dumpcap is to stop writing
47           to a capture file. The criterion is of the form test:value, where
48           test is one of:
49
50           duration:value Stop writing to a capture file after value seconds
51           have elapsed. Floating point values (e.g. 0.5) are allowed.
52
53           files:value Stop writing to capture files after value number of
54           files were written.
55
56           filesize:value Stop writing to a capture file after it reaches a
57           size of value kB. If this option is used together with the -b
58           option, dumpcap will stop writing to the current capture file and
59           switch to the next one if filesize is reached. Note that the
60           filesize is limited to a maximum value of 2 GiB.
61
62           packets:value Stop writing to a capture file after value packets
63           have been written. Acts the same as -c <capture packet count>.
64
65       -b|--ring-buffer  <capture ring buffer option>
66
67           Cause Dumpcap to run in "multiple files" mode. In "multiple files"
68           mode, Dumpcap will write to several capture files. When the first
69           capture file fills up, Dumpcap will switch writing to the next file
70           and so on.
71
72           The created filenames are based on the filename given with the -w
73           option, the number of the file and on the creation date and time,
74           e.g. outfile_00001_20230714120117.pcapng,
75           outfile_00002_20230714120523.pcapng, ...
76
77           With the files option it’s also possible to form a "ring buffer".
78           This will fill up new files until the number of files specified, at
79           which point Dumpcap will discard the data in the first file and
80           start writing to that file and so on. If the files option is not
81           set, new files filled up until one of the capture stop conditions
82           match (or until the disk is full).
83
84           The criterion is of the form key:value, where key is one of:
85
86           duration:value switch to the next file after value seconds have
87           elapsed, even if the current file is not completely filled up.
88           Floating point values (e.g. 0.5) are allowed.
89
90           files:value begin again with the first file after value number of
91           files were written (form a ring buffer). This value must be less
92           than 100000. Caution should be used when using large numbers of
93           files: some filesystems do not handle many files in a single
94           directory well. The files criterion requires either duration,
95           interval or filesize to be specified to control when to go to the
96           next file. It should be noted that each -b parameter takes exactly
97           one criterion; to specify two criterion, each must be preceded by
98           the -b option.
99
100           filesize:value switch to the next file after it reaches a size of
101           value kB. Note that the filesize is limited to a maximum value of 2
102           GiB.
103
104           interval:value switch to the next file when the time is an exact
105           multiple of value seconds. For example, use 3600 to switch to a new
106           file every hour on the hour.
107
108           packets:value switch to the next file after it contains value
109           packets.
110
111           printname:filename print the name of the most recently written file
112           to filename after the file is closed. filename can be stdout or -
113           for standard output, or stderr for standard error.
114
115           Example: -b filesize:1000 -b files:5 results in a ring buffer of
116           five files of size one megabyte each.
117
118       -B|--buffer-size  <capture buffer size>
119
120           Set capture buffer size (in MiB, default is 2 MiB). This is used by
121           the capture driver to buffer packet data until that data can be
122           written to disk. If you encounter packet drops while capturing, try
123           to increase this size. Note that, while Dumpcap attempts to set the
124           buffer size to 2 MiB by default, and can be told to set it to a
125           larger value, the system or interface on which you’re capturing
126           might silently limit the capture buffer size to a lower value or
127           raise it to a higher value.
128
129           This is available on UNIX systems with libpcap 1.0.0 or later and
130           on Windows. It is not available on UNIX systems with earlier
131           versions of libpcap.
132
133           This option can occur multiple times. If used before the first
134           occurrence of the -i option, it sets the default capture buffer
135           size. If used after an -i option, it sets the capture buffer size
136           for the interface specified by the last -i option occurring before
137           this option. If the capture buffer size is not set specifically,
138           the default capture buffer size is used instead.
139
140       -c  <capture packet count>
141
142           Set the maximum number of packets to read when capturing live data.
143           Acts the same as -a packets:<capture packet count>.
144
145       -C  <byte limit>
146
147           Limit the amount of memory in bytes used for storing captured
148           packets in memory while processing it. If used in combination with
149           the -N option, both limits will apply. Setting this limit will
150           enable the usage of the separate thread per interface.
151
152       -d
153
154           Dump the code generated for the capture filter in a human-readable
155           form, and exit.
156
157       -D|--list-interfaces
158
159           Print a list of the interfaces on which Dumpcap can capture, and
160           exit. For each network interface, a number and an interface name,
161           possibly followed by a text description of the interface, is
162           printed. The interface name or the number can be supplied to the -i
163           option to specify an interface on which to capture.
164
165           This can be useful on systems that don’t have a command to list
166           them (UNIX systems lacking ifconfig -a or Linux systems lacking ip
167           link show). The number can be useful on Windows systems, where the
168           interface name might be a long name or a GUID.
169
170           Note that "can capture" means that Dumpcap was able to open that
171           device to do a live capture. Depending on your system you may need
172           to run dumpcap from an account with special privileges (for
173           example, as root) to be able to capture network traffic. If
174           "dumpcap -D" is not run from such an account, it will not list any
175           interfaces.
176
177       -f  <capture filter>
178
179           Set the capture filter expression.
180
181           The entire filter expression must be specified as a single argument
182           (which means that if it contains spaces, it must be quoted).
183
184           This option can occur multiple times. If used before the first
185           occurrence of the -i option, it sets the default capture filter
186           expression. If used after an -i option, it sets the capture filter
187           expression for the interface specified by the last -i option
188           occurring before this option. If the capture filter expression is
189           not set specifically, the default capture filter expression is used
190           if provided.
191
192           Pre-defined capture filter names, as shown in the GUI menu item
193           Capture→Capture Filters, can be used by prefixing the argument with
194           "predef:". Example: -f "predef:MyPredefinedHostOnlyFilter"
195
196       -g
197
198           This option causes the output file(s) to be created with group-read
199           permission (meaning that the output file(s) can be read by other
200           members of the calling user’s group).
201
202       -h|--help
203
204           Print the version and options and exits.
205
206       -i|--interface  <capture interface>|rpcap://<host>:<port>/<capture
207       interface>|TCP@<host>:<port>|-
208
209           Set the name of the network interface or pipe to use for live
210           packet capture.
211
212           Network interface names should match one of the names listed in
213           "dumpcap -D" (described above); a number, as reported by "dumpcap
214           -D", can also be used. If you’re using UNIX, "netstat -i",
215           "ifconfig -a" or "ip link" might also work to list interface names,
216           although not all versions of UNIX support the -a option to
217           ifconfig.
218
219           If no interface is specified, Dumpcap searches the list of
220           interfaces, choosing the first non-loopback interface if there are
221           any non-loopback interfaces, and choosing the first loopback
222           interface if there are no non-loopback interfaces. If there are no
223           interfaces at all, Dumpcap reports an error and doesn’t start the
224           capture.
225
226           Pipe names should be either the name of a FIFO (named pipe) or "-"
227           to read data from the standard input. On Windows systems, pipe
228           names must be of the form "\\.\pipe\pipename". Data read from pipes
229           must be in standard pcapng or pcap format. Pcapng data must have
230           the same endianness as the capturing host.
231
232           "TCP@<host>:<port>" causes Dumpcap to attempt to connect to the
233           specified port on the specified host and read pcapng or pcap data.
234
235           This option can occur multiple times. When capturing from multiple
236           interfaces, the capture file will be saved in pcapng format, even
237           if -P is specified.
238
239       --ifdescr> <description>
240
241           Use description as the description in the capture file for the
242           interface or pipe specified before it with -i.
243
244       --ifname> <name>
245
246           Use name as the name in the capture file for the interface or pipe
247           specified before it with -i.
248
249       -I|--monitor-mode
250
251           Put the interface in "monitor mode"; this is supported only on IEEE
252           802.11 Wi-Fi interfaces, and supported only on some operating
253           systems.
254
255           Note that in monitor mode the adapter might disassociate from the
256           network with which it’s associated, so that you will not be able to
257           use any wireless networks with that adapter. This could prevent
258           accessing files on a network server, or resolving host names or
259           network addresses, if you are capturing in monitor mode and are not
260           connected to another network with another adapter.
261
262           This option can occur multiple times. If used before the first
263           occurrence of the -i option, it enables the monitor mode for all
264           interfaces. If used after an -i option, it enables the monitor mode
265           for the interface specified by the last -i option occurring before
266           this option.
267
268       -k  <freq>,[<type>],[<center_freq1>],[<center_freq2>>
269
270           Set the channel on the interface; this is supported only on IEEE
271           802.11 Wi-Fi interfaces, and supported only on some operating
272           systems.
273
274           freq is the frequency of the channel. type is the type of the
275           channel, for 802.11n and 802.11ac. The values for type are
276
277       NOHT
278
279           Used for non-802.11n/non-802.1ac channels
280
281       HT20
282
283           20 MHz channel
284
285       HT40-
286
287           40 MHz primary channel and a lower secondary channel
288
289       HT40+
290
291           40 MHz primary channel and a higher secondary channel
292
293       HT80
294
295           80 MHz channel, with centerfreq1 as its center frequency
296
297       VHT80+80
298
299           two 80 MHz channels combined, with centerfreq1 and centerfreq2 as
300           the center frequencies of the two channels
301
302       VHT160
303
304           160 MHz channel, with centerfreq1 as its center frequency
305
306       -L|--list-data-link-types
307
308           List the data link types supported by the interface and exit. The
309           reported link types can be used for the -y option.
310
311       -M
312
313           When used with -D, -L, -S or --list-time-stamp-types print
314           machine-readable output. The machine-readable output is intended to
315           be read by Wireshark and TShark; its format is subject to change
316           from release to release.
317
318       -n
319
320           Save files as pcapng. This is the default.
321
322       -N  <packet limit>
323
324           Limit the number of packets used for storing captured packets in
325           memory while processing it. If used in combination with the -C
326           option, both limits will apply. Setting this limit will enable the
327           usage of the separate thread per interface.
328
329       -p|--no-promiscuous-mode
330
331           Don’t put the interface into promiscuous mode. Note that the
332           interface might be in promiscuous mode for some other reason;
333           hence, -p cannot be used to ensure that the only traffic that is
334           captured is traffic sent to or from the machine on which Dumpcap is
335           running, broadcast traffic, and multicast traffic to addresses
336           received by that machine.
337
338           This option can occur multiple times. If used before the first
339           occurrence of the -i option, no interface will be put into the
340           promiscuous mode. If used after an -i option, the interface
341           specified by the last -i option occurring before this option will
342           not be put into the promiscuous mode.
343
344       -P
345
346           Save files as pcap instead of the default pcapng. In situations
347           that require pcapng, such as capturing from multiple interfaces,
348           this option will be overridden.
349
350       -q
351
352           When capturing packets, don’t display the continuous count of
353           packets captured that is normally shown when saving a capture to a
354           file; instead, just display, at the end of the capture, a count of
355           packets captured. On systems that support the SIGINFO signal, such
356           as various BSDs, you can cause the current count to be displayed by
357           typing your "status" character (typically control-T, although it
358           might be set to "disabled" by default on at least some BSDs, so
359           you’d have to explicitly set it to use it).
360
361       -s|--snapshot-length  <capture snaplen>
362
363           Set the default snapshot length to use when capturing live data. No
364           more than snaplen bytes of each network packet will be read into
365           memory, or saved to disk. A value of 0 specifies a snapshot length
366           of 262144, so that the full packet is captured; this is the
367           default.
368
369           This option can occur multiple times. If used before the first
370           occurrence of the -i option, it sets the default snapshot length.
371           If used after an -i option, it sets the snapshot length for the
372           interface specified by the last -i option occurring before this
373           option. If the snapshot length is not set specifically, the default
374           snapshot length is used if provided.
375
376       -S
377
378           Print statistics for each interface once every second.
379
380       -t
381
382           Use a separate thread per interface.
383
384       --temp-dir <directory>
385
386           Specifies the directory into which temporary files (including
387           capture files) are to be written. The default behaviour is to use
388           your system’s temporary directory (typically /tmp on Linux, and
389           C:\\Temp on Windows).
390
391       -v|--version
392
393           Print the version and exit.
394
395       -w  <outfile>
396
397           Write raw packet data to outfile. Use "-" for stdout.
398
399       -y|--linktype  <capture link type>
400
401           Set the data link type to use while capturing packets. The values
402           reported by -L are the values that can be used.
403
404           This option can occur multiple times. If used before the first
405           occurrence of the -i option, it sets the default capture link type.
406           If used after an -i option, it sets the capture link type for the
407           interface specified by the last -i option occurring before this
408           option. If the capture link type is not set specifically, the
409           default capture link type is used if provided.
410
411       --capture-comment  <comment>
412
413           Add a capture comment to the output file, if supported by the
414           output file format.
415
416           This option is only available if we output the captured packets to
417           a single file.
418
419           This option may be specified multiple times. Note that Wireshark
420           currently only displays the first comment of a capture file.
421
422       --list-time-stamp-types
423
424           List time stamp types supported for the interface. If no time stamp
425           type can be set, no time stamp types are listed.
426
427       --time-stamp-type  <type>
428
429           Change the interface’s timestamp method.
430

DIAGNOSTIC OPTIONS

432       --log-level <level>
433           Set the active log level. Supported levels in lowest to highest
434           order are "noisy", "debug", "info", "message", "warning",
435           "critical", and "error". Messages at each level and higher will be
436           printed, for example "warning" prints "warning", "critical", and
437           "error" messages and "noisy" prints all messages. Levels are case
438           insensitive.
439
440       --log-fatal <level>
441           Abort the program if any messages are logged at the specified level
442           or higher. For example, "warning" aborts on any "warning",
443           "critical", or "error" messages.
444
445       --log-domains <list>
446           Only print messages for the specified log domains, e.g.
447           "GUI,Epan,sshdump". List of domains must be comma-separated.
448
449       --log-debug <list>
450           Force the specified domains to log at the "debug" level. List of
451           domains must be comma-separated.
452
453       --log-noisy <list>
454           Force the specified domains to log at the "noisy" level. List of
455           domains must be comma-separated.
456
457       --log-file <path>
458           Write log messages and stderr output to the specified file.
459

CAPTURE FILTER SYNTAX

461       See the manual page of pcap-filter(7) or, if that doesn’t exist,
462       tcpdump(8), or, if that doesn’t exist,
463       https://gitlab.com/wireshark/wireshark/-/wikis/CaptureFilters.
464

SEE ALSO

466       wireshark(1), tshark(1), editcap(1), mergecap(1), capinfos(1), pcap(3),
467       pcap-filter(7) or tcpdump(8)
468

NOTES

470       This is the manual page for Dumpcap 4.0.8. Dumpcap is part of the
471       Wireshark distribution. The latest version of Wireshark can be found at
472       https://www.wireshark.org.
473
474       HTML versions of the Wireshark project man pages are available at
475       https://www.wireshark.org/docs/man-pages.
476

AUTHORS

478       Dumpcap is derived from the Wireshark capturing engine code; see the
479       list of authors in the Wireshark man page for a list of authors of that
480       code.
481
482
483
484                                  2023-08-31                        DUMPCAP(1)
Impressum