Skip to content

Packet captures

Packet captures record network traffic flowing through Cloudflare's network so you can analyze individual packets for troubleshooting or security investigations. The output is contained within one or more files in PCAP format, which you can open in tools like Wireshark.

There are two capture types:

  • Sample captures query historical traffic data that has already passed through Cloudflare's network. They complete immediately and can be downloaded directly from the API, or from the Cloudflare dashboard.
  • Full captures actively monitor for new traffic matching your filters and write the complete packet data to a cloud storage bucket you own. Before starting a full capture, you must first configure a bucket.

Send a packet capture request

Currently, when a packet capture is requested, packets flowing through Cloudflare's global network via the Magic Transit system are captured. The default API field for this is "system": "magic-transit", both for the request and response.

Packet capture limits

Sample and full

  • time_limit: The minimum value is 1 second and maximum value is 300 seconds.
  • packet_limit: The minimum value is 1 packet and maximum value is 10000 packets.

Full

  • byte_limit: The minimum value is 1 byte and maximum value is 1000000000 bytes (1 GB).
  1. In the Cloudflare dashboard, go to the Network health page.

    Go to Network health
  2. Go to the Diagnostics tab.

  3. In Network packet captures, select Start a capture.

  4. Choose the type of capture you want to perform, and select Next.

  5. Fill out the required fields to begin the capture and then select Start.

The Network packet captures page displays a list of captures.

Check packet capture status

  1. In the Cloudflare dashboard, go to Network health.
  2. Go to the Diagnostics tab.
  3. Locate your capture under Network packet captures.

The capture status displays one of the following options:

  • Complete (API: success): The capture is done and ready for download.
  • In progress (API: pending): Packets have been captured but the PCAP file is still being assembled.
  • Failure: The capture failed. For full captures, verify that your bucket is correctly configured and that Cloudflare has write access to it. For sample captures, verify your filter configuration.

Download packet captures

After your request finishes processing, you can download your packet captures.

  1. In the Cloudflare One dashboard, go to Network visibility > Diagnostics.
  2. In Packet captures, select Start a capture.
  3. Locate your packet capture you want to download, and select Download.

Packet captures are available to download when the Status displays Success.

List packet captures

  1. In the Cloudflare dashboard, go to the Network health page.

    Go to Network health
  2. Go to the Diagnostics tab.

The list of packet captures associated with your account displays under Network packet captures.