1DUMPCAP(1)              The Wireshark Network Analyzer              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|--interface <capture interface>|rpcap://<host>:<port>/<capture interface>|TCP@<host>:<port>|- ]
16       [ -I|--monitor-mode ]
17       [ -k <freq>,[<type>],[<center_freq1>],[<center_freq2>]
18       [ -L|--list-data-link-types ] [ -M ] [ -n ] [ -N <packet limit> ]
19       [ -p|--no-promiscuous-mode ] [ -P ] [ -q ]
20       [ -s|--snapshot-length <capture snaplen> ] [ -S ] [ -t ]
21       [ -v|--version ] [ -w <outfile> ] [ -y|--linktype <capture link type> ]
22       [ --capture-comment <comment> ] [ --list-time-stamp-types ]
23       [ --time-stamp-type <type> ]
24

DESCRIPTION

26       Dumpcap is a network traffic dump tool.  It lets you capture packet
27       data from a live network and write the packets to a file.  Dumpcap's
28       default capture file format is pcapng format.  When the -P option is
29       specified, 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 pcap file.
35
36       If the -w option is not specified, Dumpcap writes to a newly created
37       pcap file with a randomly chosen name.  If the -w option is specified,
38       Dumpcap writes to the file specified by that option.
39
40       Packet capturing is performed with the pcap library.  The capture
41       filter syntax follows the rules of the pcap library.
42

OPTIONS

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

CAPTURE FILTER SYNTAX

354       See the manual page of pcap-filter(7) or, if that doesn't exist,
355       tcpdump(8), or, if that doesn't exist,
356       <https://wiki.wireshark.org/CaptureFilters>.
357

SEE ALSO

359       wireshark(1), tshark(1), editcap(1), mergecap(1), capinfos(1), pcap(3),
360       pcap-filter(7) or tcpdump(8)
361

NOTES

363       Dumpcap is part of the Wireshark distribution.  The latest version of
364       Wireshark can be found at <https://www.wireshark.org>.
365
366       HTML versions of the Wireshark project man pages are available at:
367       <https://www.wireshark.org/docs/man-pages>.
368

AUTHORS

370       Dumpcap is derived from the Wireshark capturing engine code; see the
371       list of authors in the Wireshark man page for a list of authors of that
372       code.
373
374
375
3763.2.3                             2020-04-13                        DUMPCAP(1)
Impressum