D.4. dumpcap: Capturing with dumpcap for viewing with Wireshark
Prev | Appendix D. Related command line tools | Next

## D.4. dumpcap: Capturing with dumpcap for viewing with Wireshark

Dumpcap is a network traffic dump tool. It captures packet data from a live network and writes the packets to a file. Dumpcap's native capture file format is libpcap format, which is also the format used by Wireshark, tcpdump and various other tools.

Without any options set it will use the pcap library to capture traffic from the first available network interface and write the received raw packet data, along with the packets' time stamps into a libpcap file.

Packet capturing is performed with the pcap library. The capture filter syntax follows the rules of the pcap library.

Example D.2. Help information available from dumpcap

    Dumpcap 1.7.0 (SVN Rev 39165 from /trunk)
    Capture network packets and dump them into a libpcap file.
    See http://www.wireshark.org for more information.

    Usage: dumpcap [options] ...

    Capture interface:
      -i <interface>           name or idx of interface (def: first non-loopback)
      -f <capture filter>      packet filter in libpcap filter syntax
      -s <snaplen>             packet snapshot length (def: 65535)
      -p                       don't capture in promiscuous mode
      -B <buffer size>         size of kernel buffer (def: 1MB)
      -y <link type>           link layer type (def: first appropriate)
      -D                       print list of interfaces and exit
      -L                       print list of link-layer types of iface and exit
      -d                       print generated BPF code for capture filter
      -S                       print statistics for each interface once per second
      -M                       for -D, -L, and -S, produce machine-readable output

    RPCAP options:
      -r                       don't ignore own RPCAP traffic in capture
      -u                       use UDP for RPCAP data transfer
      -A <user>:<password>     use RPCAP password authentication
      -m <sampling type>       use packet sampling
                               count:NUM - capture one packet of every NUM
                               timer:NUM - capture no more than 1 packet in NUM ms
    Stop conditions:
      -c <packet count>        stop after n packets (def: infinite)
      -a <autostop cond.> ...  duration:NUM - stop after NUM seconds
                               filesize:NUM - stop this file after NUM KB
                                  files:NUM - stop after NUM files
    Output (files):
      -w <filename>            name of file to save (def: tempfile)
      -g                       enable group read access on the output file(s)
      -b <ringbuffer opt.> ... duration:NUM - switch to next file after NUM secs
                               filesize:NUM - switch to next file after NUM KB
                                  files:NUM - ringbuffer: replace after NUM files
      -n                       use pcapng format instead of pcap

    Miscellaneous:
      -t                       use a separate thread per interface
      -q                       don't report packet capture counts
      -v                       print version information and exit
      -h                       display this help and exit

    Example: dumpcap -i eth0 -a duration:60 -w output.pcap
    "Capture network packets from interface eth0 until 60s passed into output.pcap"

    Use Ctrl-C to stop capturing at any time.

Prev | Up | Next
D.3. tcpdump: Capturing with tcpdump for viewing with Wireshark | Home | D.5. capinfos: Print information about capture files