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>/<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> ]
17

DESCRIPTION

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

OPTIONS

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

CAPTURE FILTER SYNTAX

288       See the manual page of pcap-filter(7) or, if that doesn't exist,
289       tcpdump(8), or, if that doesn't exist,
290       <http://wiki.wireshark.org/CaptureFilters>.
291

SEE ALSO

293       wireshark(1), tshark(1), editcap(1), mergecap(1), capinfos(1), pcap(3),
294       pcap-filter(7) or tcpdump(8)
295

NOTES

297       Dumpcap is part of the Wireshark distribution.  The latest version of
298       Wireshark can be found at <http://www.wireshark.org>.
299
300       HTML versions of the Wireshark project man pages are available at:
301       <http://www.wireshark.org/docs/man-pages>.
302

AUTHORS

304       Dumpcap is derived from the Wireshark capturing engine code; see the
305       list of authors in the Wireshark man page for a list of authors of that
306       code.
307
308
309
3101.10.14                           2018-10-30                        DUMPCAP(1)
Impressum