Introducing the BPF Tools
Jul 3, 2014Marek Majkowski

Summary
This post introduces Cloudflare's open-sourced BPF Tools, designed for high-performance packet filtering to combat large-scale DDoS attacks. It details how these tools, including `pcap2hex`, `parsedns`, `bpfgen`, `filter`, and `iptables_bpf`, can be used to analyze pcap files, generate BPF bytecode for specific traffic patterns (like DNS floods targeting subdomains), verify the bytecode, and deploy it via iptables rules. The contribution highlights the practical application of BPF for dropping malicious traffic at the iptables level before it impacts application servers, with a focus on DNS traffic and the ability to match IPv6 packets, perform suffix matching, and handle case-insensitive domain matching.
More from the Website Security & Threat Management trail
- We tested our own WAF with frontier AI models. Here’s what we found
- When scanners miss the attack: how Cloudflare Client-Side Security protects storefronts
- Introducing automatic remediation policies with Cloudflare CASB
- Introducing context-aware vulnerability discovery and remediation with Cloudflare Managed Defense and OpenAI Daybreak Models
- Introducing Adaptive Intelligence: undermining the economics of every bot attack