networking

Pfsense Wireshark Logging: Advanced Traffic Analysis Guide

Debugging elusive firewall drops or tracking down silent security anomalies requires packet level visibility that standard GUI logs simply don't provide. While pfSense records connection states and fi

Pfsense Wireshark Logging: Advanced Traffic Analysis Guide
In this story

Debugging elusive firewall drops or tracking down silent security anomalies requires packet-level visibility that standard GUI logs simply don't provide. While pfSense records connection states and firewall block events, it cannot expose the underlying protocol handshakes, payload signatures, or latency bottlenecks hiding within your streams. Bridging this gap involves capturing traffic at the gateway level and decoding it with Wireshark's deep inspection engine. This guide breaks down how to configure pfSense packet captures, extract precisely targeted data, and interpret complex network streams for robust troubleshooting.

Network visibility starts with knowing exactly where and how packets are intercepted. pfSense operates at Layer 3 through Layer 7 as a router and firewall, managing traffic flows across WAN, LAN, and optional OPT interfaces. While the Netgate documentation provides solid basics on the built-in packet capture utility, administrators often struggle with large capture files, incorrect interface selection, and filtering out background noise during live forensic investigations. Let's look at how to architect an efficient packet capture workflow without choking your storage or missing critical threat indicators.

Setting Up Targeted Captures on pfSense

Relying on full-interface packet captures creates massive files that overwhelm both disk space and Wireshark's parsing engine. Precision is required to isolate anomalies effectively.

Choosing the Correct Interface

Every physical or virtual interface in pfSense handles a different stage of packet processing. Selecting the wrong interface means you might capture traffic before Network Address Translation (NAT) or after firewall rules have dropped the packet. Further coverage on this trend has been provided by BBC.

  • LAN Interface: Captures traffic originating from internal clients before firewall evaluation or after successful internal routing. Ideal for troubleshooting local DNS issues or internal client chatter.
  • WAN Interface: Captures traffic after NAT and firewall filtering. This shows what is actually hitting your public IP or leaving your network to external servers. Use this to verify if port forwards are receiving external SYN packets.
  • OPT / VLAN Interfaces: Essential for segmented networks (such as Guest Wi-Fi or IoT VLANs) to isolate inter-VLAN routing problems or unauthorized lateral movement.

Configuring the Built-in Packet Capture Tool

Navigate to Diagnostics > Packet Capture in the pfSense web interface. Instead of running wide-open captures, configure these parameters to keep your captures focused:

  1. Interface: Select the specific interface (e.g., wan or lan).
  2. Promiscuous Mode: Enable this only if you need to capture traffic not directly addressed to the firewall interface (useful on mirrored switch ports).
  3. Packet Count: Set a sensible limit (e.g., 500 to 2000 packets) for active troubleshooting to prevent memory exhaustion on the firewall.
  4. Length (bytes): Leave at 0 for full packet capture, or specify a snapshot length (like 96 or 128 bytes) if you only need header analysis and want smaller file sizes.
  5. Address Family: Filter by IPv4 or IPv6 to cut out irrelevant protocol overhead.
  6. Port and Host Filters: Enter specific IP addresses or ports (e.g., source host 192.168.1.50 or destination port 443) to restrict the capture buffer to the relevant conversation.

Download the resulting .cap or .pcap file to your analysis workstation for deep inspection.

Advanced Wireshark Filters for pfSense Troubleshooting

Once you load the capture file into Wireshark, raw packet lists can look overwhelming. Mastering display filters allows you to instantly isolate problematic traffic patterns.

📖 Related: this post

Isolating Blocked and Dropped Connections

When pfSense drops a packet due to rules or state table limits, it often generates a TCP Reset (RST) or fails to complete a three-way handshake.

  • Use tcp.flags.reset == 1 to locate abrupt connection terminations. If you see repeated RST packets immediately following a SYN transmission, a firewall rule or upstream service is rejecting the session.
  • Use tcp.analysis.retransmission to find packets sent multiple times due to packet loss or congestion on the WAN link.

Tracing Stateful Firewall Behavior

pfSense relies on the pfsync state table to track active connections. If asymmetric routing occurs—where traffic enters one interface but leaves another—pfSense drops the packets as "out of state".

To diagnose state issues in Wireshark, examine the TCP handshake sequence between two hosts:

  • Filter by the specific client and server: ip.addr == 192.168.1.100 and ip.addr == 203.0.113.50
  • Look for missing SYN-ACK or ACK packets. If a client sends a SYN, the server responds with SYN-ACK, but the firewall drops the return packet because it doesn't match an active state table entry, Wireshark will show continuous client retransmissions with no server response.

Analyzing DNS and DHCP Anomalies

Network failures often trace back to name resolution or IP assignment faults.

💡 You might also like: this guide
  • Filter DNS traffic using dns. Check the Time column for high response latencies or examine the Flags field for Server Failure (Rcode = 2) responses originating from your local resolver (Unbound).
  • Filter DHCP traffic using bootp. This lets you inspect DHCP Discover, Offer, Request, and Ack cycles when clients fail to obtain leases on specific VLANs.

Automating Captures via Shell and tcpdump

For intermittent issues that happen unpredictably, manual webGUI captures are impractical. You can leverage the underlying FreeBSD shell on pfSense via SSH or the built-in Command Prompt to run automated tcpdump instances.

Execute a background capture targeting a specific host and save it with a timestamp:

tcpdump -i igb1 -C 50 -W 10 -w /var/log/traffic_debug.pcap "host 192.168.1.200 and not port 22"
  • -i igb1: Specifies the interface (adjust to match your interface name, such as em0 or vtnet0).
  • -C 50: Rotates the capture file when it reaches 50 megabytes.
  • -W 10: Keeps a maximum of 10 rotating files to prevent filling up the pfSense root partition.
  • "host 192.168.1.200 and not port 22": Capture filter that excludes your active SSH troubleshooting session while recording all other traffic for the target host.

You can review official packet capture syntax and guidelines directly via the Netgate Documentation portal. For protocol definitions and standard reference numbers, consult the Internet Assigned Numbers Authority (IANA) database.

Common Pitfalls and Best Practices

Avoiding common mistakes saves hours of debugging time and protects network performance.

  • Never run unconstrained captures on high-throughput interfaces: Capturing gigabit traffic without strict filters fills local storage rapidly and can degrade firewall CPU performance.
  • Account for hardware offloading: Features like Large Receive Offload (LRO) or Hardware Checksum Offloading can cause Wireshark to display incorrect checksum errors or segmented packets. If packets look malformed in Wireshark, check whether offloading is enabled on your pfSense network interface cards.
  • Protect sensitive PCAP data: Packet captures record unencrypted payloads, authentication tokens, and plain-text DNS queries. Transfer capture files securely using encrypted protocols like SFTP and delete them from firewall storage immediately after analysis.

Frequently Asked Questions

Can I run Wireshark directly on the pfSense firewall?

No, pfSense does not include a graphical interface for Wireshark. The firewall includes the tcpdump utility for capturing raw packets, which you then download and inspect using Wireshark on an external workstation.

Why do I see incorrect TCP checksum errors in Wireshark?

This is typically caused by hardware checksum offloading on your network interface cards. The network card calculates checksums in hardware after tcpdump captures the packet. You can disable checksum validation in Wireshark under Preferences > Protocols > TCP, or disable hardware checksum offloading in pfSense under System > Advanced > Networking.

How do I capture encrypted HTTPS traffic in Wireshark?

Standard HTTPS traffic is encrypted using TLS and cannot be decrypted by Wireshark without access to the private keys or session keys. For debugging encrypted web traffic passing through pfSense, configure a transparent SSL/TLS proxy or inspection service on the firewall if required for security monitoring, or decrypt traffic locally on the client machine using SSL key logging variables.

What is the difference between a capture filter and a display filter?

Capture filters (applied during the tcpdump command or pfSense GUI capture setup) dictate which packets are saved to disk. Display filters (applied inside Wireshark) change which saved packets are visible on your screen during analysis. Always use capture filters to limit file sizes.

CR

Written by

Chloe Ramirez

Chloe Ramirez excels at making complicated information accessible, turning dense research into clear narratives that engage diverse audiences.

More from networking