pfSense is the most widely deployed open-source firewall in the world — a FreeBSD-based distribution built around the pf packet filter that turns a spare PC, a mini-appliance or a virtual machine into an enterprise-grade edge device. In one install you get a stateful firewall, a NAT router, a DHCP and DNS server, a VPN concentrator, and a package ecosystem that adds intrusion detection, DNS-level ad-and-malware blocking and traffic analytics. This guide covers the free Community Edition (CE 2.8.x), the current stable branch maintained by Netgate.
You will build it three ways — on bare metal for a home or office edge, in VirtualBox for a self-contained lab on your laptop, and on Proxmox VE / VMware ESXi for a homelab hypervisor — then run the console interface assignment and the web setup wizard, write your first real firewall rules and port-forwards, and lock the box down.
The back half is where a defender earns their keep: pfBlockerNG for DNSBL and IP-feed blocking, Suricata for IDS/IPS, WireGuard for remote access, plus syslog forwarding into your SIEM, config backup, upgrades and a full troubleshooting table. Every command is copy-pasteable. Deploy only on networks you own or are authorised to administer.
◈ Table of Contents
01 · What pfSense Is & Why Defenders Use It
Phase 1/11At its core pfSense is a management layer around FreeBSD's pf — the same battle-tested packet filter that ships in OpenBSD and macOS. What makes it a firewall rather than an operating system is the webConfigurator: a full web GUI that turns pf rule syntax, NAT tables, DHCP scopes, DNS resolvers and VPN tunnels into point-and-click configuration, with every change written atomically to a single config.xml. That one file is the whole firewall — back it up and you can rebuild the box in minutes.
For a SOC or homelab, pfSense is the natural place to see and shape traffic. It is a default-deny device: inbound connections from the WAN are dropped unless you explicitly allow them, while LAN egress is permitted and tracked statefully. Add the package ecosystem and the same box becomes a sensor — Suricata reads the wire and raises alerts, pfBlockerNG sinkholes known-bad domains and IP ranges, and native syslog shipping feeds every firewall and IDS event into Splunk, Elastic or Microsoft Sentinel.
Home & SMB Edge
Replace a consumer router with a real stateful firewall, VLAN segmentation, VPN and DNS filtering on cheap hardware.
Security Homelab
Segment a vulnerable-VM range from your home network, mirror traffic to an IDS and practise detection engineering safely.
SOC Sensor
Run Suricata inline, forward alerts and firewall logs to your SIEM, and pivot on the connection records during IR.
VPN Concentrator
Terminate WireGuard or OpenVPN for remote workers and site-to-site links without a per-seat licence.
Two editions exist. Know which one this guide targets and why CE is the right pick for labs and self-managed edges.
| Edition | What it is | Licence / cost | Use it when |
|---|---|---|---|
| pfSense CE 2.8.x | Community Edition — the free, self-installed build covered here | Apache 2.0, free | Homelab, SMB edge, self-managed installs on your own hardware or VM |
| pfSense Plus | Netgate's commercial build, free on Netgate appliances | Free on Netgate hardware; licensed elsewhere | You bought a Netgate appliance or need vendor support/TAC |
CE 2.8 pulled in features that were once Plus-only, including encrypted Automatic Config Backup, Kea DHCP high-availability and NAT64. For most labs and home/SMB edges, CE is functionally complete — you reach for Plus mainly when you want Netgate support or run their hardware.
pfSense is an edge security device. A misconfigured firewall is worse than none — it creates a false sense of safety. Change the default credentials, never expose the management GUI to the WAN, and test every rule change from a client you can afford to lose access from.
02 · Prerequisites & Requirements
Phase 2/11The single hard requirement is two network interfaces — one for WAN (uplink) and one for LAN (protected network). Everything else scales with throughput: routing a gigabit line with basic rules is trivial for any modern CPU, but running Suricata deep-packet inspection at multi-gig needs cores and RAM. Intel NICs (igb / ix drivers) are the gold standard on FreeBSD; Realtek works but can be flaky under load.
| Component | Minimum | Recommended | Notes |
|---|---|---|---|
| CPU | 64-bit dual-coreMIN | Quad-core+ with AES-NIREC | AES-NI accelerates VPN throughput |
| RAM | 1 GB | 4 GB+ (8 GB with Suricata/pfBlockerNG) | IDS + DNSBL feeds are memory-hungry |
| Storage | 8 GB SSD/eMMC | 32 GB+ SSD | ZFS + logs; avoid worn USB sticks for the OS |
| NICs | 2 × interfaces (WAN+LAN) | Intel igb/ix; add ports for VLANs/DMZ | Realtek re0 works but Intel is preferred |
| Boot media | 1 GB USB stick (installer) | USB 3.0 stick | The memstick image is written, then discarded |
| Access PC | Any browser on the LAN | Wired client at 192.168.1.x | You configure pfSense over HTTP/HTTPS from LAN |
Decide the layout before you install. At minimum: WAN (uplink), LAN (trusted), and — for a security build — one or more OPT interfaces/VLANs for servers, IoT and a vulnerable-lab segment. Pick a LAN subnet that does not collide with any upstream network.
Avoid 192.168.0.0/24 and 192.168.1.0/24 for your LAN — they collide constantly with consumer routers and VPN clients. A less-common /24 like 192.168.10.0/24 saves hours of double-NAT debugging.
Grab the installer and its checksum from the official download page before anything else. CE ships as a gzipped memstick (USB) image for the AMD64 architecture.
Always verify the SHA256. A firewall image tampered in transit is a supply-chain compromise of your entire network. Never install from an unverified mirror or a torrent of unknown provenance.
03 · Method 1 — Bare-Metal Install
Phase 3/11Bare metal is the production path: a dedicated appliance (a fanless mini-PC, a repurposed thin client, or a small server) sits at your edge with WAN plugged into your modem/ONT and LAN into a switch. The installer boots from USB, copies pfSense to the internal disk, and reboots into your firewall.
On Linux/macOS use dd. On Windows use Rufus in DD-image mode. Identify the correct target device first — writing to the wrong disk destroys it.
Triple-check the of= target. dd will happily overwrite your laptop's system disk if you point it at the wrong device. When unsure, remove all other external drives first.
Boot the appliance from USB (disable Secure Boot in BIOS/UEFI if the stick is skipped). Accept the licence, choose Install, then pick your filesystem. Choose ZFS — it gives you checksums and, crucially, boot-environment snapshots that make firmware upgrades reversible. Use the GPT partition scheme on modern UEFI hardware.
ZFS boot environments are pfSense's best-kept upgrade safety net: an upgrade creates a new environment, and if the new build misbehaves you roll back to the previous one from the boot menu — no reinstall, no lost config.
Physical topology matters: WAN port to your modem/ONT (or the upstream network), LAN port to a switch or directly to your configuration PC. On first boot pfSense tries to auto-detect which NIC is which; you will confirm or correct that in the console (Phase 6).
- USB installer removed; box boots pfSense from internal disk
- WAN NIC cabled to the internet uplink
- LAN NIC cabled to a switch or your laptop
- Console reachable (monitor+keyboard, or serial for appliances)
04 · Method 2 — VirtualBox Lab VM
Phase 4/11A VirtualBox VM is the fastest way to get a self-contained pfSense lab on a laptop: WAN on a NAT adapter (internet via your host), LAN on an internal network that other lab VMs join. This is the classic "firewall in a box" arrangement for practising rules and IDS without touching your real network. Below is the fully scripted VBoxManage build so it is reproducible.
Adapter 1 = NAT (becomes WAN, gets internet from the host). Adapter 2 = Internal Network labnet (becomes LAN). FreeBSD likes the Intel 82540EM emulated NIC.
For a VM, use the ISO installer variant (or the same memstick image attached as a disk). Attach it to a virtual optical drive, boot, and run the identical ZFS install flow from Phase 3.
Any lab VM you want protected by pfSense simply joins the same internal network — set its adapter to --intnet labnet. It will pull DHCP from pfSense's LAN and route out through the firewall, exactly like a real client.
In a NAT-on-WAN lab the WAN interface receives a private (RFC1918) address from VirtualBox. pfSense blocks "private networks" on WAN by default, which is fine — but if you later switch WAN to a bridged private LAN and expect inbound access, you must uncheck that filter (Phase 7) or traffic silently drops.
05 · Method 3 — Proxmox VE / VMware ESXi
Phase 5/11On a homelab hypervisor pfSense becomes a virtual edge router: you map two virtual switches / bridges — one bound to a physical WAN NIC, one to your internal LAN bridge — and pfSense routes between them. VirtIO NICs give near-native throughput. Below is a scripted Proxmox build plus the ESXi equivalent notes.
Upload the ISO to local:iso first (Datacenter → Storage → ISO Images, or scp it to /var/lib/vz/template/iso/). Here vmbr0 is your WAN bridge and vmbr1 your LAN bridge.
On ESXi create a VM (Guest OS: FreeBSD 14/15 64-bit), attach two VMXNET3 adapters mapped to a WAN port group and a LAN port group, and enable Promiscuous mode only if you intend to bridge or run inline IDS across port groups. After first boot, tune offloading so VirtIO/VMXNET checksums do not corrupt state tracking.
Virtual NIC offloading is the #1 cause of "pfSense works but throughput is terrible / connections hang" on hypervisors. If a fresh virtual pfSense has flaky networking, disable checksum, TSO and LRO offload and reboot before troubleshooting anything else.
06 · First Boot — Console Interface Assignment
Phase 6/11Whatever the install method, the first boot drops you at the pfSense console menu. This text menu is your out-of-band lifeline — it works even when the GUI is locked out. Two options matter now: 1) Assign Interfaces and 2) Set interface(s) IP address.
| Option | Action | When you need it |
|---|---|---|
| 0 | Logout (SSH only) | End a remote console session |
| 1 | Assign Interfaces | Map NICs to WAN/LAN/OPT, set up VLANs |
| 2 | Set interface(s) IP address | Change the LAN IP / DHCP range |
| 3 | Reset webConfigurator password | Locked out of the GUI |
| 4 | Reset to factory defaults | Start over cleanly |
| 5 / 6 | Reboot / Halt system | Safe power cycle |
| 8 | Shell | Drop to the FreeBSD shell (pfctl, tcpdump) |
| 11 | Restart webConfigurator | GUI unreachable but box is up |
| 12 | PHP shell + pfSense tools | Scripted config / playback |
| 13 | Update from console | Upgrade without the GUI |
| 14 | Enable Secure Shell (sshd) | Turn on SSH management |
| 15 | Restore recent configuration | Roll back a bad config.xml |
Auto-detection is usually right, but confirm it. If wrong, choose option 1 and map interfaces manually. Decline VLAN setup unless you are trunking a tagged uplink now.
The default LAN is 192.168.1.1/24 with DHCP handing out 192.168.1.100–192.168.1.150. Change the subnet here if it clashes with an upstream network (a very common cause of "no internet" when pfSense sits behind another router on the same 192.168.1.0/24).
- The webConfigurator is now at https://192.168.10.1/
- Connect a client to LAN, take DHCP, browse to that URL
If you ever lock yourself out during rule tightening, the console never lies: option 8 → pfctl -d disables the firewall entirely (temporarily) so you can regain GUI access and fix the rule, then pfctl -e re-enables it.
SSH gives you a reliable shell when the GUI is unhappy. Enable it from the console (option 14) or System > Advanced > Admin Access, then switch to key-only auth. Keep SSH reachable from the LAN/VPN only — never the WAN.
Disable password SSH once your key works. An SSH service that accepts passwords, even on the LAN, is a lateral-movement target once one internal host is compromised.
07 · Initial Web Configuration Wizard
Phase 7/11Browse to the LAN IP from a wired client. The default login is username admin / password pfsense. The Setup Wizard launches automatically on first login and walks nine screens: hostname/domain, DNS, timezone, WAN type, LAN IP, and the admin password.
Set a hostname and domain (e.g. fw.lab.local). Leave "Override DNS" ticked if your ISP supplies DNS, or set explicit resolvers (e.g. 9.9.9.9 Quad9, 1.1.1.1). Pick your timezone — accurate time is non-negotiable for log correlation in a SIEM.
Choose the WAN type: DHCP (most home connections), Static (business line), or PPPoE (many DSL/fibre ISPs — enter the username/password from your provider). At the bottom sit two checkboxes that trip up every lab builder.
- Block RFC1918 Private Networks — drops inbound private-IP sources on WAN
- Block bogon networks — drops traffic from unallocated address space
Leave both checked for a real internet-facing edge. But when pfSense sits behind another router (double-NAT lab, or WAN on a private bridge), the upstream is RFC1918 — untick "Block private networks" on the WAN interface or all inbound traffic from your own uplink is silently dropped.
Set a strong admin password on the final screens and reload. This is the single most important hardening step — an internet-facing pfSense on admin/pfsense is an open door.
Never expose the webConfigurator or SSH to the WAN. If you need remote management, reach it over the VPN (Phase 9). A management interface on the public internet is brute-forced within hours.
The default "anti-lockout" rule guarantees the LAN can always reach the GUI so a bad rule cannot brick you. Keep it on until your ruleset is stable; disable it only when you have an out-of-band console and a tested management VLAN.
08 · Core Firewall: Rules, Aliases & NAT
Phase 8/11This is the firewall doing its job. pfSense rules are evaluated top-down, first-match-wins, per interface, and they filter traffic entering that interface. WAN starts fully closed (default deny inbound); LAN starts with a permissive "allow LAN to any" rule you will tighten. Rules live at Firewall > Rules.
An alias is a named group of hosts, networks or ports. Reference the alias in rules instead of raw IPs — change the alias once and every rule updates. Create them at Firewall > Aliases.
Aliases turn an unreadable wall of IP rules into English. A ruleset built on AdminHosts, ServersVLAN and WebPorts is auditable at a glance and survives IP changes — this is the difference between a maintainable firewall and a fragile one.
The stock "LAN → any" rule lets everything out. For a security-minded network, replace it with explicit allows and log the implicit deny. Order matters — put specific allows above the catch-all block.
Enable logging on your deny rules (the rule's "Log packets handled by this rule" box). A firewall that blocks silently gives you nothing to hunt on. Logged denies are how you spot a compromised host beaconing out.
To publish an internal service (say a web server at 192.168.10.50:443), create a NAT port-forward. pfSense auto-generates the matching WAN pass rule. Outbound NAT (masquerade) for LAN clients is automatic in the default mode.
Verify the live rule state from the shell — this is the ground truth pf is actually enforcing:
Front internet-facing services with a reverse proxy or HAProxy (a pfSense package) plus the ACME package for free Let's Encrypt certs, rather than exposing app ports directly. Fewer open WAN ports means a smaller attack surface.
LAN clients reach the internet because pfSense masquerades their private IPs behind the WAN address. The default Automatic mode handles this for you; switch to Hybrid when you need a few custom rules (e.g. a static 1:1 NAT for a server) without hand-managing everything.
09 · Integration: pfBlockerNG, Suricata & VPN
Phase 9/11Packages turn pfSense from a router into a security platform. Install them from System > Package Manager > Available Packages. The three that matter most for a defender are pfBlockerNG (DNS/IP blocking), Suricata (IDS/IPS) and WireGuard (VPN) — plus native syslog shipping to your SIEM and a Docker-based service lab sitting safely behind the LAN.
pfBlockerNG sinkholes malicious/ad domains via the DNS Resolver (Unbound) and blocks known-bad IP ranges at the firewall using public threat feeds. Install pfBlockerNG-devel, run the wizard, then add feeds.
pfBlockerNG's DNSBL requires the built-in DNS Resolver (Unbound). If you switch pfSense to DNS Forwarder mode, DNSBL stops working. Keep Unbound as the resolver and point your LAN clients at pfSense for DNS.
Suricata inspects traffic against signature rulesets (ET Open, Snort community). Run it in IDS (alert-only) mode on the WAN first, tune out false positives, then flip to inline IPS so it drops. Blocking blind will break legitimate traffic.
Suricata logs live on disk — tail them during tuning or ship them onward:
On a hypervisor, IDS is easiest on the LAN interface where traffic is already decrypted at the network layer. Reserve inline WAN IPS for hardware with spare cores — deep-packet inspection at line rate is CPU-bound.
WireGuard gives you fast, modern remote access so you never expose management to the WAN. Install the package, create a tunnel, add a peer per device, then a WAN rule allowing the UDP port and a rule on the WireGuard interface allowing tunnel traffic to your LAN.
Forward firewall and Suricata events to your SIEM via remote syslog (Status > System Logs > Settings > Remote Logging) — enable firewall events and point them at your collector on UDP/TCP 514. To exercise the firewall, stand up a small service stack on a LAN host with Docker; pfSense protects and observes it exactly like any client.
Keep intentionally vulnerable containers (like DVWA) on an isolated LAN/VLAN with an egress-deny rule. A firewall lab is only safe if the vulnerable targets cannot reach the internet or your real hosts — segment them, then block RFC1918 and WAN egress from that segment.
Instead of port-forwarding raw app ports, terminate TLS at a reverse proxy. The ACME package issues free Let's Encrypt certificates and HAProxy fronts your backends — one WAN port, centralised TLS, and per-host ACLs. This shrinks the attack surface dramatically.
With HAProxy in front you expose exactly one port (443) regardless of how many internal apps you publish, and you get HTTP health checks, rate limiting and header hardening for free — a far safer posture than a fan of individual port-forwards.
10 · Monitoring, Maintenance & Troubleshooting
Phase 10/11A firewall is a living system. This phase covers the day-two work: watching traffic, backing up the one file that is your firewall, upgrading safely, and fixing the failures every pfSense admin eventually hits.
The GUI dashboard, Status > Traffic Graphs and Diagnostics > States cover most needs, but the shell is faster for triage. Capture packets, watch states and confirm what pf is really doing.
Everything is in /cf/conf/config.xml. Back it up before every change from Diagnostics > Backup & Restore, enable the encrypted Automatic Config Backup (ACB), and snapshot the VM before installing packages or upgrading.
Because ZFS created a boot environment during install, a failed upgrade is recoverable: reboot, pick the previous boot environment from the loader menu, and you are back on the working build with the old config intact. Test upgrades on a VM clone first for production edges.
The overwhelming majority of pfSense problems fall into a handful of buckets. Work this table top to bottom before deep-diving.
| Symptom | Likely cause | Fix |
|---|---|---|
| LAN has no internet | WAN subnet == LAN subnet, or DNS not set | Change LAN off 192.168.1.0/24; set resolvers in General Setup |
| Can't reach the GUI | Locked out by a rule / wrong protocol | Console opt 8 → pfctl -d; opt 11 restart GUI; opt 3 reset pw |
| Port forward doesn't work | No WAN pass rule, or double-NAT upstream | Add associated filter rule; forward the port on the upstream router too |
| Throughput terrible on VM | Hardware checksum/TSO/LRO offload | System > Advanced > Networking — disable offloads, reboot |
| WAN gets no IP | PPPoE creds / bad NIC assignment | Re-check WAN type; console opt 1 reassign; verify link/cable |
| pfBlockerNG blocks nothing | Using DNS Forwarder not Resolver | Enable Unbound (DNS Resolver); Force Reload feeds |
| Inbound from lab uplink dropped | "Block private networks" on WAN | Interfaces > WAN — untick the RFC1918/bogon filters |
Before blaming pfSense, confirm the layer below it: cable/link status, correct NIC assignment (console option 1), and that the upstream device actually hands out an address. Most "pfSense is broken" reports are a swapped WAN/LAN NIC or a subnet clash.
Turn the install into a defensible edge. These are the settings an attacker hopes you skipped.
- Strong unique admin password; no management access from WAN
- HTTPS webConfigurator on a non-default port; anti-lockout scoped to a mgmt VLAN
- Default-deny WAN; least-privilege LAN egress with logged denies
- Segment untrusted devices/labs into VLANs with inter-VLAN block rules
- pfBlockerNG DNSBL + IP feeds enabled and auto-updating
- Suricata tuned in IDS, then inline IPS on capable hardware
- Remote access via WireGuard only; MFA on any exposed portal
- Syslog to a SIEM; encrypted Auto Config Backup enabled
- Firmware current; ZFS boot environment verified for rollback
Treat the firewall as an IR asset, not just plumbing. Its logs are often the first place a compromise shows up — a LAN host suddenly hammering blocked destinations, or a new outbound state to a pfBlockerNG threat feed IP. Forward those events and alert on them.
11 · Sources & References
Phase 11/11Primary documentation for every step above. Prefer the official Netgate docs for version-specific behaviour, since defaults and menu paths shift between releases.
◈ MAKE THE EDGE YOUR FIRST SENSOR, NOT JUST YOUR FIRST WALL
A tuned pfSense box blocks, segments and tells you when something is wrong. Pair it with our Suricata detection and homelab virtualization guides for the full defensive stack, and run suspicious outbound IPs through the CyberHawk IOC Scanner. Explore more hands-on SOC tooling walkthroughs on the CyberHawk Blog.
◈ Stay Connected
Follow CyberHawk Threat Intel for threat intelligence, deployment guides and hands-on SOC tooling content.
"They can't exploit you if you are the Exploit."