Networking
Packet Capture Runbook: Best Practices for Cisco, FortiGate, and Juniper Troubleshooting
Learn how to plan and execute packet capture on Cisco routers, FortiGate firewalls, and Juniper devices effectively by defining source, destination, protocol
Reviewed by QCS Network & Security Engineering
Direct answer
A well-planned packet capture is essential for accurate network troubleshooting on Cisco, FortiGate, and Juniper devices. Before running any capture commands on production routers or firewalls, define the capture scope by specifying the source and destination IP addresses, protocols of interest (e.g., TCP, UDP), relevant interfaces, packet count, timing, and assign an evidence owner responsible for capturing and analyzing the data.
This proactive definition ensures minimal performance impacts and precise data for investigation.
On Cisco devices, use the Embedded Packet Capture (EPC) feature (
Key Takeaways
- Always define source, destination, protocol, interface, and packet count before starting capture.
- Cisco IOS EPC stores packets in DRAM buffers and can export PCAP files for analysis.
- FortiGate uses CLI sniffer trace commands to capture live traffic.
- Juniper supports packet capture via firewall filters and stores data in libpcap format for offline analysis.
- Careful use of capture filters reduces performance impact and increases troubleshooting accuracy.
- Packet captures on production devices should be supervised by an evidence owner to maintain audit and operational control.
Terms Used in This Guide
- Packet Capture
- The process of intercepting and logging network packets traveling over a digital network for analysis and troubleshooting.
- Cisco Embedded Packet Capture (EPC)
- A Cisco IOS feature to capture packets directly on the router, storing them temporarily in DRAM for troubleshooting.
- FortiGate Sniffer Trace
- A CLI-based tool on Fortinet FortiGate firewalls for live packet capture on interfaces.
- Juniper Packet Capture
- A Junos OS feature using firewall filters and operational mode commands to capture network traffic for analysis.
- PCAP File
- A standardized file format used to store packet data captured over a network, compatible with tools like Wireshark and tcpdump.
Introduction to Packet Capture in Network Troubleshooting
Packet capture is a critical technique for network engineers to analyze traffic, detect anomalies, and resolve complex connectivity or performance issues. Effective packet capture depends on defining precise filters and capture parameters to limit the scope and performance impact. This runbook focuses on practical steps for Cisco IOS/EPC, FortiGate FortiOS sniffer, and Juniper Junos OS devices as per official documentation and best practices. [1][2][3]
- Capture only necessary traffic by defining filters
- Assign an evidence owner to maintain accountability
- Avoid running broad captures on production devices without planning
Cisco Embedded Packet Capture (EPC): Configuration and Execution
Cisco's Embedded Packet Capture lets you capture traffic directly on routers or switches running IOS or IOS XE. The process involves several steps:
1. Define a capture buffer (size, max packet size, circular or linear). 2. Create an ACL filter with source/destination IPs and protocols. 3. Define a capture point on an interface (physical, tunnel). 4. Associate the buffer with the capture point. 5. Start and stop the capture. 6. Review the capture summary or dump the capture buffer. 7. Export the capture as a PCAP file via TFTP.
The capture resides in DRAM and does not persist across reloads, so timely export is critical. EPC configuration is temporary and does not save to startup-config ensuring no impact post troubleshooting.
This method supports capturing on physical and sub-interfaces and filtering by access lists. However, L2 info may be lost during export, and IPv6 is limited in some configurations. [1]
- Use 'monitor capture buffer' commands to create capture buffers and filters
- Associate capture points to interfaces specifying direction
- Export captures as PCAP files for tools like Wireshark
- Temporary in nature: does not persist through reloads
FortiGate Sniffer Trace: Performing Packet Capture via CLI
FortiGate firewalls use a CLI-based sniffer trace to capture network traffic live on interfaces. To ensure precise capture:
- Define filters to specify source/destination IPs and protocols. - Set a capture duration or packet count to limit impact. - Redirect or save capture output for analysis.
FortiGate CLI commands allow starting and stopping the sniffer, selecting interfaces, and applying filters similar to tcpdump syntax. This live capture method provides real-time insights into traffic flowing through the firewall.
Remember that sniffer traces run on the data plane and can impact performance if not limited by count or time. Assigning an evidence owner ensures responsible use and capturing relevant sessions only. [2]
- Use CLI 'diagnose sniffer packet' commands with filters
- Specify interface, protocol, and packet count/time for capture
- Manage captures carefully to avoid undue production impact
Juniper Packet Capture: Firewall Filter-Based and Operational Mode Capture
Juniper devices support packet capture through firewall filters applied to interfaces combined with operational mode commands.
Configuration includes: - Defining firewall filters to match packets by IP address, port, or protocol. - Applying filters as input/output on physical or logical interfaces. - Setting maximum capture file size, number of files, and packet size limits.
Captured packets, including Layer 2 headers, are saved in libpcap format in /var/tmp and can be retrieved via FTP or SCP for offline analysis with tcpdump or Wireshark.
Juniper also provides a CLI operational mode 'request packet-capture start/stop' for on-demand captures, useful for quick troubleshooting without configuration commits. However, operational mode captures are temporary and non-persistent.
Careful filter planning reduces performance impact and collects only relevant packet data. [3]
- Configure 'firewall filter' terms to specify captured traffic
- Apply filters on interface input/output directions
- Capture files persist until deleted and rotate on size limits
- Use operational mode commands for quick, temporary captures
Best Practices for Packet Capture on Production Devices
To avoid service disruption, follow these guidelines before initiating packet capture:
- Define source and destination addresses clearly to limit capture scope. - Specify protocol types (e.g., TCP, UDP, ICMP) to filter unnecessary traffic. - Select the correct interface(s) where the traffic flows. - Determine packet count or capture duration limits to avoid memory exhaustion. - Assign an evidence owner responsible for executing captures and managing data securely. - Avoid capturing on high-speed or critical interfaces during peak traffic. - Use maintenance windows if possible. - Export and analyze captures promptly; buffer memory is limited. - Remove or disable capture configurations immediately after use.
Implement capture filters, audit trails, and documentation for every capture in compliance with organizational policies. [1][2][3]
- Plan capture parameters comprehensively before collecting data
- Minimize filter scope to reduce device performance impact
- Designate a responsible evidence owner for data integrity
- Use off-box analysis tools for detailed packet inspection
- Delete temporary capture configurations and data promptly
Practical Checklist
Define source and destination addresses before capture
Specify protocol filters (tcp, udp, icmp)
Select capture interface and direction (inbound/outbound)
Set packet count or capture duration limits
Assign an evidence owner for oversight
Start capture using device-specific commands
Stop capture promptly after collecting required data
Export captured data in PCAP/libpcap format
Analyze captures with tools like Wireshark or tcpdump
Delete temporary captures and disable capture settings
Questions Teams Ask
Why define source, destination, and protocol filters before packet capture?
Defining filters before capture limits the scope to relevant traffic, reduces device performance impact, and avoids collection of unnecessary data. This ensures the capture is focused and efficient, facilitating faster troubleshooting and minimizes operational risks. [1][3]
How do Cisco IOS and IOS XE differ in packet capture configuration?
Cisco IOS uses monitor capture buffer, ACLs, and capture points for EPC, while IOS XE provides enhanced commands with inline filters and interface/tunnel support. Both store captures in DRAM temporarily, but IOS XE has improved features and supports more interface types. [1]
Can FortiGate sniffer trace run on production devices without impact?
FortiGate sniffer trace captures live traffic but may impact performance if run without filters or for long durations. It's critical to limit packet counts, use specific interface filters, and perform captures during low traffic periods or maintenance windows on production devices. [2]
What file formats are used for packet capture on Cisco, FortiGate, and Juniper?
Cisco exports captures in PCAP format, FortiGate captures can be saved in pcap or console output formats, and Juniper stores captures in libpcap format, compatible with tcpdump and Wireshark. These standardized formats enable offline analysis. [1][3]
How to analyze captured packets after export?
After exporting captured traffic files from devices, use packet analysis tools such as Wireshark or tcpdump to open PCAP or libpcap files. These tools provide detailed protocol decodes and visualizations to aid troubleshooting and forensic analysis. [1][3]
Sources and Further Reading
How This Guide Was Prepared
Researched from the listed primary and official sources, written for operational decision-making, and reviewed through QCS editorial QA. Sources checked 2026-07-30.
Technical review: QCS Network & Security Engineering, Technical review team.
