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> ] [ -d ] [ -D ] [ -f <capture filter> ]
12       [ -h ] [ -i <capture interface>|- ] [ -I ] [ -L ] [ -M ] [ -n ] [ -p ]
13       [ -P ] [ -q ] [ -s <capture snaplen> ] [ -S ] [ -v ] [ -w <outfile> ]
14       [ -y <capture link type> ]
15

DESCRIPTION

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

OPTIONS

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

CAPTURE FILTER SYNTAX

264       See the manual page of pcap-filter(7) or, if that doesn't exist,
265       tcpdump(8), or, if that doesn't exist,
266       <http://wiki.wireshark.org/CaptureFilters>.
267

SEE ALSO

269       wireshark(1), tshark(1), editcap(1), mergecap(1), capinfos(1), pcap(3),
270       pcap-filter(7) or tcpdump(8) if it doesn't exist.
271

NOTES

273       Dumpcap is part of the Wireshark distribution.  The latest version of
274       Wireshark can be found at <http://www.wireshark.org>.
275
276       HTML versions of the Wireshark project man pages are available at:
277       <http://www.wireshark.org/docs/man-pages>.
278

AUTHORS

280       Dumpcap is derived from the Wireshark capturing engine code; see the
281       list of authors in the Wireshark man page for a list of authors of that
282       code.
283
284
285
2861.8.10                            2012-06-05                        DUMPCAP(1)
Impressum