Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Peter N. M. Hansteen

Rating No ratings yet

OpenBSD's stateful packet filter, PF, is the heart of the OpenBSD firewall. With more and more services placing high demands on bandwidth and an increasingly hostile Internet environment, no sysadmin can afford to be without PF expertise. The third edition of The Book of PF covers the most up-to-date developments in PF, including new content on IPv6, dual stack configurations, the “queues and priorities” traffic-shaping system, NAT and redirection, wireless networking, spam fighting, failover provision ing, logging, and more.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A practical, example-driven guide to building real networks with OpenBSD's PF packet filter—from a single machine to gateways, DMZs, wireless, and failover—for sysadmins who want secure, well-shaped traffic without hand-waving. 【Book Arc】 - **Opening (~0%–10%)**: Frames PF as the kernel-level heart of the OpenBSD firewall and sets expectations—firewalling, NAT, traffic control, and bandwidth management in one system—while orienting newcomers to the BSD way of working. - **Early (~10%–32%)**: Builds the foundation: enabling PF with `pfctl`, writing a minimal single-machine rule set (`block in all` / `pass out all keep state`), and understanding that filtering is only one of several uses for packet criteria. - **Middle (~32%–48%)**: Extends the single-machine setup into a gateway for a home or small office, introducing macros like `$localnet` for readable rule sets and handling awkward services such as FTP via `ftp-proxy`. - **Late (~48%–70%)**: Moves into trickier territory—wireless with authpf access control, DMZs and multiple subnets, redirection and relayd load balancing, and proactive defense against brute-force and spam (spamd). - **Ending (~70%–100%)**: Covers traffic shaping with the queues-and-priorities system (replacing ALTQ), plus monitoring/visualization and failover provisioning with CARP—rounding out operations beyond basic filtering. (Excerpts do not detail the final chapters' internals.) 【Key Takeaways】 - **PF is more than a blocker** (Early): Filtering criteria can redirect traffic to hosts, assign it to queues, shape bandwidth, or hand it to other software—so treat the rule set as a traffic policy, not just a deny list. - **Start minimal, then grow** (Early): The book deliberately begins with the simplest possible rule set on a standalone machine, because every later configuration builds on that baseline; skipping ahead makes later chapters harder. - **Macros make rule sets maintainable** (Middle): Defining `$localnet`, `$ports`, and similar macros shrinks rule sets and makes logic legible—crucial for long-term upkeep and auditing. - **Document policy before converting** (Early): Hansteen urges resisting automated conversion from other firewall products; instead re-specify your network's goals in prose (or config comments) and implement those policies in PF. - **Awkward protocols need special handling** (Middle): FTP and similar services require helpers like `ftp-proxy` and careful pass rules—an early lesson that "just open the port" often isn't enough. - **Defense can be proactive** (Late): Tools like spamd and rate-limiting against brute-force attempts turn the firewall into an active defender, making the network friendlier to legitimate users. - **Traffic shaping is a first-class concern** (Late): The queues-and-priorities system (post-ALTQ) keeps networks responsive under load—bandwidth management belongs in your PF design, not as an afterthought. - **Availability and visibility matter** (Late): CARP, relayd, and monitoring/NetFlow-style tooling extend PF from a perimeter device into a resilient, observable network component. 【Reading Tips】 - **Deep-read Chapters 2–3**: the single-machine and gateway configurations are the load-bearing foundation; type out and test each rule set rather than skimming. - **Skim the BSD-orientation material** if you already run OpenBSD/FreeBSD/NetBSD, but don't skip the `pfctl` enable/load workflow—it recurs throughout. - **Treat FTP, wireless, and spamd sections as pattern libraries**: read them when your network actually needs them, and consult the referenced man pages for edge cases. - **Watch version drift**: the book targets OpenBSD 5.6, FreeBSD 10.x, and NetBSD 6.x; verify syntax against current man pages, especially for queues/priorities and ALTQ migration. - **Keep a written policy alongside your config**: follow the author's advice and comment your rules—future-you will thank present-you. 【Coverage Limits】 This guide is synthesized from stratified excerpts covering roughly the first half of the book plus front matter; later chapters on queues, monitoring, and failover are represented only by their stated themes, so specifics there are not covered.
Excerpt 1
, and more. be well prepared to unlock PF’s full potential. You’ll also learn how to: A B O U T T H E A U T H O R • Create rule sets for all kinds of network...
View in text
Excerpt 2
orities and queues systems introduced in OpenBSD 5.5. This chapter also contains tips on how to convert earlier ALTQ-based setups to the new system, as well...
View in text
Excerpt 3
ou’re ready to move on to creating a complete configuration. The supplied /etc/pf.conf file contains no active settings; it has only comment lines starting w...
View in text
Excerpt 4
pass rule that is useful to those who want the ability to administer machines from elsewhere: pass in proto tcp to port ssh Or use this form, if you prefer:...
View in text
Excerpt 5
ce-specific programs, such as wicontrol and ancontrol, are still around, but for the most part, they are deprecated and have long been replaced with ifconfig...
View in text
Excerpt 6
eds to surf the Web and have access to a service that runs on a high port on a specific machine could get what he needs with a /etc/ authpf/users/peter/authp...
View in text
Excerpt 7
s on a machine that’s primarily a firewall isn’t desirable. This means we’re back to the situation where we do our NAT at the gateway. Fortunately, the redir...
View in text
Excerpt 8
ey are, it’s confirmation that the bridge has been enabled. If they’re not, go back and see what went wrong and why. n o T e These values apply to filtering...
View in text
Tags
AI categories
CybersecurityOS
ISBN: 1593275897
Publisher: No Starch Press
Publish Year: 2014
Language: English
Pages: 248
File Format: PDF
File Size: 5.3 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…