4 dumpcap - Dump network traffic
9 S<[ B<-a> E<lt>capture autostop conditionE<gt> ] ...>
10 S<[ B<-b> E<lt>capture ring buffer optionE<gt>] ...>
11 S<[ B<-B> E<lt>capture buffer size (Win32 only)E<gt> ] >
12 S<[ B<-c> E<lt>capture packet countE<gt> ]>
14 S<[ B<-f> E<lt>capture filterE<gt> ]>
16 S<[ B<-i> E<lt>capture interfaceE<gt>|- ]>
19 S<[ B<-s> E<lt>capture snaplenE<gt> ]>
21 S<[ B<-w> E<lt>outfileE<gt> ]>
22 S<[ B<-y> E<lt>capture link typeE<gt> ]>
26 B<Dumpcap> is a network traffic dump tool. It lets you capture packet
27 data from a live network and write the packets to a file. B<Dumpcap>'s
28 native capture file format is B<libpcap> format, which is also the format
29 used by B<Wireshark>, B<tcpdump> and various other tools.
31 Without any options set it will
32 use the pcap library to capture traffic from the first available network
33 interface and writes the received raw packet data, along with the packets'
34 time stamps into a libpcap file.
36 If the B<-w> option is not specified, B<Dumpcap> writes to a newly
37 created libpcap file with a randomly chosen name.
38 If the B<-w> option is specified, B<Dumpcap> writes to the file
39 specified by that option.
41 Packet capturing is performed with the pcap library. The capture filter
42 syntax follows the rules of the pcap library.
48 =item -a E<lt>capture autostop conditionE<gt>
50 Specify a criterion that specifies when B<Dumpcap> is to stop writing
51 to a capture file. The criterion is of the form I<test>B<:>I<value>,
52 where I<test> is one of:
54 B<duration>:I<value> Stop writing to a capture file after I<value> seconds have elapsed.
56 B<filesize>:I<value> Stop writing to a capture file after it reaches a size of I<value>
57 kilobytes (where a kilobyte is 1024 bytes). If this option
58 is used together with the -b option, dumpcap will stop writing to the
59 current capture file and switch to the next one if filesize is reached.
61 B<files>:I<value> Stop writing to capture files after I<value> number of files were written.
63 =item -b E<lt>capture ring buffer optionE<gt>
65 Cause B<Dumpcap> to run in "multiple files" mode. In "multiple files" mode,
66 B<Dumpcap> will write to several capture files. When the first capture file
67 fills up, B<Dumpcap> will switch writing to the next file and so on.
69 The created filenames are based on the filename given with the B<-w> option, the number of
70 the file and on the creation date and time,
71 e.g. outfile_00001_20050604120117.pcap, outfile_00001_20050604120523.pcap, ...
73 With the I<files> option it's also possible to form a "ring buffer".
74 This will fill up new files until the number of files specified,
75 at which point B<Dumpcap> will discard the data in the first file and start
76 writing to that file and so on. If the I<files> option is not set,
77 new files filled up until one of the capture stop conditions match (or
78 until the disk if full).
80 The criterion is of the form I<key>B<:>I<value>,
81 where I<key> is one of:
83 B<duration>:I<value> switch to the next file after I<value> seconds have
84 elapsed, even if the current file is not completely filled up.
86 B<filesize>:I<value> switch to the next file after it reaches a size of
87 I<value> kilobytes (where a kilobyte is 1024 bytes).
89 B<files>:I<value> begin again with the first file after I<value> number of
90 files were written (form a ring buffer).
92 =item -B E<lt>capture buffer size (Win32 only)E<gt>
94 Win32 only: set capture buffer size (in MB, default is 1MB). This is used by the
95 the capture driver to buffer packet data until that data can be written to
96 disk. If you encounter packet drops while capturing, try to increase this size.
98 =item -c E<lt>capture packet countE<gt>
100 Set the maximum number of packets to read when capturing live
105 Print a list of the interfaces on which B<Dumpcap> can capture, and
106 exit. For each network interface, a number and an
107 interface name, possibly followed by a text description of the
108 interface, is printed. The interface name or the number can be supplied
109 to the B<-i> option to specify an interface on which to capture.
111 This can be useful on systems that don't have a command to list them
112 (e.g., Windows systems, or UNIX systems lacking B<ifconfig -a>);
113 the number can be useful on Windows 2000 and later systems, where the
114 interface name is a somewhat complex string.
116 Note that "can capture" means that B<Dumpcap> was able to open
117 that device to do a live capture. Depending on your system you may need to
118 run dumpcap from an account with special privileges (for example, as root)
119 to be able to capture network traffic.
120 If "B<dumpcap -D>" is not run from such an account, it will not list
123 =item -f E<lt>capture filterE<gt>
125 Set the capture filter expression.
127 The entire filter expression must be specified as a single argument (which means
128 that if it contains spaces, it must be quoted).
132 Print the version and options and exits.
134 =item -i E<lt>capture interfaceE<gt>|-
136 Set the name of the network interface or pipe to use for live packet
139 Network interface names should match one of the names listed in
140 "B<dumpcap -D>" (described above); a number, as reported by
141 "B<dumpcap -D>", can also be used. If you're using UNIX, "B<netstat
142 -i>" or "B<ifconfig -a>" might also work to list interface names,
143 although not all versions of UNIX support the B<-a> option to B<ifconfig>.
145 If no interface is specified, B<Dumpcap> searches the list of
146 interfaces, choosing the first non-loopback interface if there are any
147 non-loopback interfaces, and choosing the first loopback interface if
148 there are no non-loopback interfaces. If there are no interfaces at all,
149 B<Dumpcap> reports an error and doesn't start the capture.
151 Pipe names should be either the name of a FIFO (named pipe) or ``-'' to
152 read data from the standard input. Data read from pipes must be in
153 standard libpcap format.
155 Note: the Win32 version of B<Dumpcap> doesn't support capturing from
160 List the data link types supported by the interface and exit. The reported
161 link types can be used for the B<-y> option.
165 I<Don't> put the interface into promiscuous mode. Note that the
166 interface might be in promiscuous mode for some other reason; hence,
167 B<-p> cannot be used to ensure that the only traffic that is captured is
168 traffic sent to or from the machine on which B<Dumpcap> is running,
169 broadcast traffic, and multicast traffic to addresses received by that
172 =item -s E<lt>capture snaplenE<gt>
174 Set the default snapshot length to use when capturing live data.
175 No more than I<snaplen> bytes of each network packet will be read into
176 memory, or saved to disk.
180 Print the version and exit.
182 =item -w E<lt>outfileE<gt>
184 Write raw packet data to I<outfile>.
186 NOTE: The usage of "-" for stdout is not allowed here!
188 =item -y E<lt>capture link typeE<gt>
190 Set the data link type to use while capturing packets. The values
191 reported by B<-L> are the values that can be used.
195 =head1 CAPTURE FILTER SYNTAX
197 See the manual page of tcpdump(8).
201 wireshark(1), tshark(1), editcap(1), mergecap(1), capinfos(1), tcpdump(8),
206 B<Dumpcap> is part of the B<Wireshark> distribution. The latest version
207 of B<Wireshark> can be found at L<http://www.wireshark.org>.
209 HTML versions of the Wireshark project man pages are available at:
210 L<http://www.wireshark.org/docs/man-pages>.
214 B<Dumpcap> is derived from the B<Wireshark> capturing engine code;
216 authors in the B<Wireshark> man page for a list of authors of that code.