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

CAPTURE FILTER SYNTAX

309       See the manual page of pcap-filter(7) or, if that doesn't exist,
310       tcpdump(8), or, if that doesn't exist,
311       <https://wiki.wireshark.org/CaptureFilters>.
312

SEE ALSO

314       wireshark(1), tshark(1), editcap(1), mergecap(1), capinfos(1), pcap(3),
315       pcap-filter(7) or tcpdump(8)
316

NOTES

318       Dumpcap is part of the Wireshark distribution.  The latest version of
319       Wireshark can be found at <https://www.wireshark.org>.
320
321       HTML versions of the Wireshark project man pages are available at:
322       <https://www.wireshark.org/docs/man-pages>.
323

AUTHORS

325       Dumpcap is derived from the Wireshark capturing engine code; see the
326       list of authors in the Wireshark man page for a list of authors of that
327       code.
328
329
330
3312.6.2                             2018-07-18                        DUMPCAP(1)
Impressum