1DUMPCAP(1)              The Wireshark Network Analyzer              DUMPCAP(1)
2
3
4

NAME

6       dumpcap - Dump network traffic
7

SYNOPSIS

9       dumpcap [ -a <capture autostop condition> ] ...
10       [ -b <capture ring buffer option>] ...  [ -B <capture buffer size> ]
11       [ -c <capture packet count> ] [ -C <byte limit> ] [ -d ] [ -D ]
12       [ -f <capture filter> ] [ -g ] [ -h ]
13       [ -i <capture interface>|rpcap://<host>:<port>/<capture interface>|TCP@<host>:<port>|- ]
14       [ -I ] [ -L ] [ -M ] [ -n ] [ -N <packet limit> ] [ -p ] [ -P ] [ -q ]
15       [ -s <capture snaplen> ] [ -S ] [ -t ] [ -v ] [ -w <outfile> ]
16       [ -y <capture link type> ] [ --capture-comment <comment> ]
17       [ --list-time-stamp-types ] [ --time-stamp-type <type> ]
18

DESCRIPTION

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

OPTIONS

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

CAPTURE FILTER SYNTAX

317       See the manual page of pcap-filter(7) or, if that doesn't exist,
318       tcpdump(8), or, if that doesn't exist,
319       <https://wiki.wireshark.org/CaptureFilters>.
320

SEE ALSO

322       wireshark(1), tshark(1), editcap(1), mergecap(1), capinfos(1), pcap(3),
323       pcap-filter(7) or tcpdump(8)
324

NOTES

326       Dumpcap is part of the Wireshark distribution.  The latest version of
327       Wireshark can be found at <https://www.wireshark.org>.
328
329       HTML versions of the Wireshark project man pages are available at:
330       <https://www.wireshark.org/docs/man-pages>.
331

AUTHORS

333       Dumpcap is derived from the Wireshark capturing engine code; see the
334       list of authors in the Wireshark man page for a list of authors of that
335       code.
336
337
338
3393.0.5                             2019-10-30                        DUMPCAP(1)
Impressum