1DUMPCAP(1) DUMPCAP(1)
2
3
4
6 dumpcap - Dump network traffic
7
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
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 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 filter
41 syntax follows the rules of the pcap library.
42
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_20220714120117.pcap,
75 outfile_00002_20220714120523.pcap, ...
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.
237
238 --ifdescr> <description>
239
240 Use description as the description in the capture file for the
241 interface or pipe specified before it with -i.
242
243 --ifname> <name>
244
245 Use name as the name in the capture file for the interface or pipe
246 specified before it with -i.
247
248 -I|--monitor-mode
249
250 Put the interface in "monitor mode"; this is supported only on IEEE
251 802.11 Wi-Fi interfaces, and supported only on some operating
252 systems.
253
254 Note that in monitor mode the adapter might disassociate from the
255 network with which it’s associated, so that you will not be able to
256 use any wireless networks with that adapter. This could prevent
257 accessing files on a network server, or resolving host names or
258 network addresses, if you are capturing in monitor mode and are not
259 connected to another network with another adapter.
260
261 This option can occur multiple times. If used before the first
262 occurrence of the -i option, it enables the monitor mode for all
263 interfaces. If used after an -i option, it enables the monitor mode
264 for the interface specified by the last -i option occurring before
265 this option.
266
267 -k <freq>,[<type>],[<center_freq1>],[<center_freq2>>
268
269 Set the channel on the interface; this is supported only on IEEE
270 802.11 Wi-Fi interfaces, and supported only on some operating
271 systems.
272
273 freq is the frequency of the channel. type is the type of the
274 channel, for 802.11n and 802.11ac. The values for type are
275
276 NOHT
277
278 Used for non-802.11n/non-802.1ac channels
279
280 HT20
281
282 20 MHz channel
283
284 HT40-
285
286 40 MHz primary channel and a lower secondary channel
287
288 HT40+
289
290 40 MHz primary channel and a higher secondary channel
291
292 HT80
293
294 80 MHz channel, with centerfreq1 as its center frequency
295
296 VHT80+80
297
298 two 80 MHz channels combined, with centerfreq1 and centerfreq2 as
299 the center frequencies of the two channels
300
301 VHT160
302
303 160 MHz channel, with centerfreq1 as its center frequency
304
305 -L|--list-data-link-types
306
307 List the data link types supported by the interface and exit. The
308 reported link types can be used for the -y option.
309
310 -M
311
312 When used with -D, -L, -S or --list-time-stamp-types print
313 machine-readable output. The machine-readable output is intended to
314 be read by Wireshark and TShark; its format is subject to change
315 from release to release.
316
317 -n
318
319 Save files as pcapng. This is the default.
320
321 -N <packet limit>
322
323 Limit the number of packets used for storing captured packets in
324 memory while processing it. If used in combination with the -C
325 option, both limits will apply. Setting this limit will enable the
326 usage of the separate thread per interface.
327
328 -p|--no-promiscuous-mode
329
330 Don’t put the interface into promiscuous mode. Note that the
331 interface might be in promiscuous mode for some other reason;
332 hence, -p cannot be used to ensure that the only traffic that is
333 captured is traffic sent to or from the machine on which Dumpcap is
334 running, broadcast traffic, and multicast traffic to addresses
335 received by that machine.
336
337 This option can occur multiple times. If used before the first
338 occurrence of the -i option, no interface will be put into the
339 promiscuous mode. If used after an -i option, the interface
340 specified by the last -i option occurring before this option will
341 not be put into the promiscuous mode.
342
343 -P
344
345 Save files as pcap instead of the default pcapng. In situations
346 that require pcapng, such as capturing from multiple interfaces,
347 this option will be overridden.
348
349 -q
350
351 When capturing packets, don’t display the continuous count of
352 packets captured that is normally shown when saving a capture to a
353 file; instead, just display, at the end of the capture, a count of
354 packets captured. On systems that support the SIGINFO signal, such
355 as various BSDs, you can cause the current count to be displayed by
356 typing your "status" character (typically control-T, although it
357 might be set to "disabled" by default on at least some BSDs, so
358 you’d have to explicitly set it to use it).
359
360 -s|--snapshot-length <capture snaplen>
361
362 Set the default snapshot length to use when capturing live data. No
363 more than snaplen bytes of each network packet will be read into
364 memory, or saved to disk. A value of 0 specifies a snapshot length
365 of 262144, so that the full packet is captured; this is the
366 default.
367
368 This option can occur multiple times. If used before the first
369 occurrence of the -i option, it sets the default snapshot length.
370 If used after an -i option, it sets the snapshot length for the
371 interface specified by the last -i option occurring before this
372 option. If the snapshot length is not set specifically, the default
373 snapshot length is used if provided.
374
375 -S
376
377 Print statistics for each interface once every second.
378
379 -t
380
381 Use a separate thread per interface.
382
383 --temp-dir <directory>
384
385 Specifies the directory into which temporary files (including
386 capture files) are to be written. The default behaviour is to use
387 your system’s temporary directory (typically /tmp on Linux, and
388 C:\\Temp on Windows).
389
390 -v|--version
391
392 Print the version and exit.
393
394 -w <outfile>
395
396 Write raw packet data to outfile. Use "-" for stdout.
397
398 -y|--linktype <capture link type>
399
400 Set the data link type to use while capturing packets. The values
401 reported by -L are the values that can be used.
402
403 This option can occur multiple times. If used before the first
404 occurrence of the -i option, it sets the default capture link type.
405 If used after an -i option, it sets the capture link type for the
406 interface specified by the last -i option occurring before this
407 option. If the capture link type is not set specifically, the
408 default capture link type is used if provided.
409
410 --capture-comment <comment>
411
412 Add a capture comment to the output file, if supported by the
413 output file format.
414
415 This option is only available if we output the captured packets to
416 a single file.
417
418 This option may be specified multiple times. Note that Wireshark
419 currently only displays the first comment of a capture file.
420
421 --list-time-stamp-types
422
423 List time stamp types supported for the interface. If no time stamp
424 type can be set, no time stamp types are listed.
425
426 --time-stamp-type <type>
427
428 Change the interface’s timestamp method.
429
431 --log-level <level>
432 Set the active log level. Supported levels in lowest to highest
433 order are "noisy", "debug", "info", "message", "warning",
434 "critical", and "error". Messages at each level and higher will be
435 printed, for example "warning" prints "warning", "critical", and
436 "error" messages and "noisy" prints all messages. Levels are case
437 insensitive.
438
439 --log-fatal <level>
440 Abort the program if any messages are logged at the specified level
441 or higher. For example, "warning" aborts on any "warning",
442 "critical", or "error" messages.
443
444 --log-domains <list>
445 Only print messages for the specified log domains, e.g.
446 "GUI,Epan,sshdump". List of domains must be comma-separated.
447
448 --log-debug <list>
449 Force the specified domains to log at the "debug" level. List of
450 domains must be comma-separated.
451
452 --log-noisy <list>
453 Force the specified domains to log at the "noisy" level. List of
454 domains must be comma-separated.
455
456 --log-file <path>
457 Write log messages and stderr output to the specified file.
458
460 See the manual page of pcap-filter(7) or, if that doesn’t exist,
461 tcpdump(8), or, if that doesn’t exist,
462 https://gitlab.com/wireshark/wireshark/-/wikis/CaptureFilters.
463
465 wireshark(1), tshark(1), editcap(1), mergecap(1), capinfos(1), pcap(3),
466 pcap-filter(7) or tcpdump(8)
467
469 This is the manual page for Dumpcap 4.0.2. Dumpcap is part of the
470 Wireshark distribution. The latest version of Wireshark can be found at
471 https://www.wireshark.org.
472
473 HTML versions of the Wireshark project man pages are available at
474 https://www.wireshark.org/docs/man-pages.
475
477 Dumpcap is derived from the Wireshark capturing engine code; see the
478 list of authors in the Wireshark man page for a list of authors of that
479 code.
480
481
482
483 2022-12-08 DUMPCAP(1)