← Back to all projects

LEARN PFSENSE DEEP DIVE

Learn pfSense: From Zero to Network Security Master

Goal: Deeply understand pfSense—from basic firewalling and routing to building secure, enterprise-grade network infrastructure with VPNs, intrusion detection, and high availability.


Why Learn pfSense?

pfSense is the world’s most trusted open-source firewall and router. It transforms commodity hardware into a powerful security appliance capable of features that rival expensive, enterprise-only solutions. For developers, sysadmins, and security enthusiasts, mastering pfSense means you can build robust, secure, and highly-customizable networks for any application, from a home lab to a corporate data center.

After completing these projects, you will:

  • Confidently navigate the pfSense web interface and system architecture.
  • Design and implement complex firewall rules and network segmentation.
  • Build secure remote access and site-to-site VPNs.
  • Deploy intrusion detection systems (IDS/IPS) to protect your network.
  • Understand and configure high-availability and load-balancing solutions.
  • Gain a foundational understanding of pfSense package development.

Core Concept Analysis

The pfSense Architecture & Philosophy

pfSense is built on FreeBSD and leverages its powerful pf (Packet Filter) firewall. Its philosophy is to provide a flexible, powerful, and free platform that can be extended through a robust package system.

┌───────────────────────────────────────────────────────────┐
│                       pfSense WebGUI                        │
│ (PHP, JavaScript, XML - Manages configuration)            │
├───────────────────────────────────────────────────────────┤
│                    pfSense Packages                       │
│ (Suricata, HAProxy, OpenVPN, etc. - Extends functionality)│
├───────────────────────────────────────────────────────────┤
│                   Core pfSense System                     │
│ (PHP backend, routing daemons, system scripts)            │
├───────────────────────────────────────────────────────────┤
│                      FreeBSD Base OS                      │
│   ┌───────────────────┬───────────────────┬───────────────┐ │
│   │   pf (Packet      │   Network Stack   │    Kernel     │ │
│   │   Filter)         │    (TCP/IP)       │   Drivers     │ │
│   └───────────────────┴───────────────────┴───────────────┘ │
├───────────────────────────────────────────────────────────┤
│                        Hardware/VM                        │
└───────────────────────────────────────────────────────────┘

Key Concepts Explained

1. Interfaces and VLANs

  • Interfaces: The physical or virtual network connections pfSense uses (e.g., WAN for internet, LAN for local network).
  • VLANs (Virtual LANs): A way to create multiple isolated networks on a single physical interface. Essential for segmenting traffic (e.g., separating IoT devices from trusted computers).

2. Firewall Rules and NAT

  • Stateful Firewall: pfSense tracks the state of connections. If you allow an outgoing connection, the return traffic is automatically permitted.
  • Rules Processing: Rules on an interface are processed from top to bottom. The first matching rule wins.
  • NAT (Network Address Translation):
    • Outbound NAT: Allows multiple devices on a private network (LAN) to share a single public IP address (WAN).
    • Port Forwarding (Inbound NAT): Forwards traffic from the internet on a specific port to a specific internal device.

3. VPNs (Virtual Private Networks)

  • OpenVPN: The gold standard for remote access VPNs (a user connecting to the network). Flexible and highly secure.
  • IPsec: The industry standard for site-to-site VPNs (connecting two networks together).
  • WireGuard: A modern, high-performance VPN protocol known for its simplicity and speed.

4. Packages and Services

  • Package Manager: Allows you to extend pfSense’s functionality by installing packages like Suricata (IDS/IPS), HAProxy (reverse proxy), or acme (for Let’s Encrypt certificates).
  • Core Services: DHCP (IP address assignment), DNS Resolver (domain name lookups), NTP (time synchronization).

5. High Availability (HA)

  • CARP (Common Address Redundancy Protocol): Allows two or more firewalls to share a single virtual IP address. If the primary firewall fails, the backup seamlessly takes over.
  • State Synchronization (pfsync): Ensures that the backup firewall has the same connection state table as the primary, preventing interruptions during a failover.

Project List

The following 10 projects will take you from a pfSense novice to a seasoned network administrator.


Project 1: The Basic Home Firewall

  • File: LEARN_PFSENSE_DEEP_DIVE.md
  • Main Programming Language: N/A (Web GUI Configuration)
  • Alternative Programming Languages: N/A
  • Coolness Level: Level 2: Practical but Forgettable
  • Business Potential: 1. The “Resume Gold”
  • Difficulty: Level 1: Beginner
  • Knowledge Area: Network Fundamentals / Firewalling
  • Software or Tool: pfSense, VirtualBox/VMware
  • Main Book: pfSense Official Documentation

What you’ll build: A virtual pfSense firewall that replaces your consumer-grade router, providing secure internet access to a virtual network.

Why it teaches pfSense: This is the “Hello, World!” of pfSense. It forces you to understand the initial setup, the web interface, network interfaces (WAN/LAN), DHCP, and basic NAT and firewall rules that make the internet “just work.”

Core challenges you’ll face:

  • Installation and initial setup → maps to understanding the console menu and interface assignment
  • Configuring WAN and LAN interfaces → maps to differentiating between your internet connection and your local network
  • Understanding the default firewall rules → maps to why the LAN is allowed out but the WAN is blocked in
  • Getting a client VM online → maps to verifying DHCP and DNS are working

Key Concepts:

Difficulty: Beginner Time estimate: Weekend Prerequisites: Basic understanding of IP addresses and networking.

Real world outcome: You’ll have a virtual machine (e.g., Ubuntu Desktop) that can browse the internet, with all its traffic passing through your pfSense VM. You can watch the firewall logs in pfSense and see the traffic being passed and blocked in real-time.

Implementation Hints:

  1. In VirtualBox/VMware, create two networks: a “Bridged” network for your WAN interface (to get a real IP from your home router) and an “Internal” or “Host-Only” network for your LAN.
  2. Create the pfSense VM with two network adapters, one for each network.
  3. Install pfSense, assigning the correct adapters to WAN and LAN during the setup.
  4. Create a client VM (e.g., Ubuntu) and attach its network adapter to the LAN network.
  5. Boot the client VM. It should automatically get an IP address from pfSense and have internet access.
  6. Questions to guide you: What IP address did the client get? What is the default LAN rule in pfSense that allows this to work? What happens if you try to ping the pfSense LAN address from your host machine?

Learning milestones:

  1. Client VM gets internet → You understand basic NAT and firewall pass rules.
  2. You can access the pfSense WebGUI from the client VM → You understand the LAN interface and web server.
  3. You can block a website using a firewall rule → You understand rule priority and the state table.

Project 2: Network Segmentation with VLANs

  • File: LEARN_PFSENSE_DEEP_DIVE.md
  • Main Programming Language: N/A (Web GUI Configuration)
  • Alternative Programming Languages: N/A
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 1. The “Resume Gold”
  • Difficulty: Level 2: Intermediate
  • Knowledge Area: Network Security / VLANs
  • Software or Tool: pfSense, a managed switch (or virtual switch)
  • Main Book: pfSense Official Documentation - VLANs

What you’ll build: You’ll segment your network using VLANs, creating separate, isolated networks for trusted devices (computers), IoT devices (smart plugs, cameras), and guests.

Why it teaches pfSense: This is a core security practice. It forces you to move beyond a flat network and learn how to use pfSense as an “inter-VLAN router,” controlling exactly what traffic can flow between your different networks.

Core challenges you’ll face:

  • Configuring VLANs on a managed switch and in pfSense → maps to understanding 802.1Q tags and trunk/access ports
  • Creating firewall rules to control inter-VLAN traffic → maps to explicitly allowing or denying traffic between segments
  • Setting up DHCP servers for each VLAN → maps to providing network services to multiple logical networks
  • Troubleshooting connectivity issues → maps to using firewall logs to see what’s being blocked

Key Concepts:

  • VLAN Trunking: A single link carrying multiple VLANs.
  • Firewall Aliases: Grouping IPs or ports into a named entity to simplify rules.
  • Rule of Least Privilege: Deny all traffic by default and only allow what is explicitly needed.

Difficulty: Intermediate Time estimate: 1-2 weeks Prerequisites: Project 1, access to a managed switch or a virtual switch that supports VLANs (e.g., vSphere, Hyper-V).

Real world outcome: You’ll have an IoT device on its own network that can access the internet but cannot initiate connections to your trusted computers. Your computer, however, can initiate connections to the IoT device. This is visible and testable with simple ping and port scanning tools.

Implementation Hints:

  1. On your managed switch, configure a “trunk” port that will connect to your pfSense LAN port. This trunk will carry all VLAN traffic.
  2. Configure “access” ports for your devices, assigning each to a specific VLAN (e.g., Port 2 is VLAN 10 for trusted, Port 3 is VLAN 20 for IoT).
  3. In pfSense, go to Interfaces > VLANs and create new VLANs (e.g., VLAN 10 on em0, VLAN 20 on em0).
  4. Go to Interfaces > Assignments to create new pfSense interfaces for each VLAN (e.g., TRUSTED, IOT).
  5. Enable the new interfaces, give them static IP addresses (e.g., TRUSTED is 192.168.10.1/24, IOT is 192.168.20.1/24), and set up DHCP servers for each.
  6. On the IOT firewall rules tab, add a rule to block traffic destined for the TRUSTED network. The default “allow all” rule will let it reach the internet.

Learning milestones:

  1. Devices in each VLAN get correct IP addresses → You understand DHCP on multiple interfaces.
  2. IoT devices can’t ping trusted devices → You’ve successfully created and firewalled a network segment.
  3. You can create an alias for “DNS_SERVERS” and use it in rules → You’re writing cleaner, more maintainable rules.

Project 3: Secure Remote Access with OpenVPN

  • File: LEARN_PFSENSE_DEEP_DIVE.md
  • Main Programming Language: N/A (Web GUI Configuration)
  • Alternative Programming Languages: N/A
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 2. The “Micro-SaaS / Pro Tool”
  • Difficulty: Level 2: Intermediate
  • Knowledge Area: VPN / Cryptography
  • Software or Tool: pfSense, OpenVPN Client
  • Main Book: pfSense Official Documentation - OpenVPN

What you’ll build: A remote access OpenVPN server that allows you to securely connect to your home network from anywhere in the world, as if you were physically there.

Why it teaches pfSense: VPNs are a cornerstone of network security. This project teaches you about certificate management (PKI), user authentication, and how to write firewall rules for VPN interfaces to securely tunnel traffic.

Core challenges you’ll face:

  • Creating a Certificate Authority (CA) and server/user certificates → maps to understanding the basics of Public Key Infrastructure
  • Configuring the OpenVPN server → maps to selecting cryptographic settings, tunnel network, and routing options
  • Creating firewall rules for the OpenVPN interface → maps to controlling what connected VPN users can access
  • Exporting and configuring a client → maps to using the client export package to simplify deployment

Key Concepts:

  • Public Key Infrastructure (PKI): A system for creating, managing, and revoking digital certificates.
  • Tunneling: Encapsulating one network protocol within another.
  • Split-Tunnel vs. Full-Tunnel: Deciding whether all client traffic, or just traffic for your home network, goes through the VPN.

Difficulty: Intermediate Time estimate: Weekend Prerequisites: Project 1, a way to test from an external network (e.g., a cell phone hotspot).

Real world outcome: You can connect to your home network from your laptop at a coffee shop using the OpenVPN client. You can access your internal web servers, printers, and other devices by their private IP addresses, and all your traffic is securely encrypted.

Implementation Hints:

  1. Start in System > Cert. Manager. Create a new Certificate Authority (CA).
  2. Create a Server Certificate signed by your new CA.
  3. Go to VPN > OpenVPN and run the wizard. It will guide you through creating the server. Choose “Local User Access” for authentication.
  4. The wizard automatically adds a firewall rule on the WAN to allow OpenVPN connections and a rule on the OpenVPN interface to allow clients to access everything. You should later restrict this.
  5. Go to System > Package Manager and install the openvpn-client-export package.
  6. This package provides a simple way to download a pre-configured installer for Windows, macOS, or a .ovpn file for other clients.
  7. Create a user in System > User Manager and create a client certificate for them.
  8. Use the Client Export utility to download the configuration for your user.

Learning milestones:

  1. A remote client successfully connects → Your CA, server config, and WAN firewall rule are correct.
  2. The client can ping a device on your LAN → Your tunneling and OpenVPN firewall rules are working.
  3. You can restrict a VPN user to only access a single server → You have mastered VPN firewall rules.

Project 4: Site-to-Site VPN with IPsec

  • File: LEARN_PFSENSE_DEEP_DIVE.md
  • Main Programming Language: N/A (Web GUI Configuration)
  • Alternative Programming Languages: N/A
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 3. The “Service & Support” Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: VPN / Advanced Networking
  • Software or Tool: pfSense x2 (or pfSense + a cloud VPN endpoint)
  • Main Book: pfSense Official Documentation - IPsec

What you’ll build: A permanent, secure tunnel connecting two separate networks using IPsec. For example, your home lab and a small VPC in the cloud, or two physical locations.

Why it teaches pfSense: This is how businesses connect offices. It teaches you the more complex and less forgiving IPsec protocol, forcing you to understand negotiation phases (Phase 1 & Phase 2), encryption domains, and policy-based routing.

Core challenges you’ll face:

  • Matching IPsec proposals perfectly on both sides → maps to Phase 1 (authentication) and Phase 2 (encryption) parameters must be identical
  • Configuring the correct local and remote network identifiers → maps to defining which subnets should be able to talk to each other
  • Creating the right firewall rules on the IPsec interface → maps to allowing traffic to pass through the tunnel once it’s up
  • Debugging connection failures → maps to reading and understanding the IPsec logs

Key Concepts:

  • IKE (Internet Key Exchange): The protocol used to set up a security association for IPsec. Phase 1 establishes a secure channel for negotiation, Phase 2 negotiates the actual tunnel parameters.
  • Encryption Domain: The network traffic that is designated to be encrypted and sent through the tunnel.
  • Route-based vs. Policy-based VPNs: A fundamental difference in how traffic is directed to the VPN. pfSense uses a policy-based approach.

Difficulty: Advanced Time estimate: 1-2 weeks Prerequisites: Project 1, two separate networks with pfSense firewalls. A great way to do this is one physical/virtual pfSense at home and another in a cloud provider like Linode or Vultr.

Real world outcome: A virtual machine in your cloud VPC can seamlessly ping and access a server in your home lab by its private IP address, and vice versa. All traffic between the two networks is automatically encrypted and tunneled.

Implementation Hints:

  1. Plan your networks. Site A LAN: 192.168.1.0/24. Site B LAN: 192.168.2.0/24.
  2. On both pfSense boxes, go to VPN > IPsec. Add a new Phase 1 entry.
    • Remote Gateway: The public IP of the other pfSense box.
    • Authentication Method: Pre-Shared Key (for simplicity).
    • Encryption Algorithm: Choose a matching set (e.g., AES-256-GCM with DH Group 14).
  3. Add a Phase 2 entry under the new Phase 1.
    • Mode: Tunnel IPv4.
    • Local Network: The LAN subnet of the current pfSense box.
    • Remote Network: The LAN subnet of the other pfSense box.
    • Proposal: Choose a matching set (e.g., AES-256-GCM).
  4. Go to Firewall > Rules > IPsec. Add a rule to pass traffic from the remote subnet. A simple “Pass Any to Any” rule will work to start.
  5. Go to Status > IPsec to check the tunnel status. If it’s not connected, check the logs. 99% of failures are due to mismatched proposals or incorrect network definitions.

Learning milestones:

  1. Phase 1 completes successfully → Both firewalls can authenticate each other.
  2. Phase 2 completes successfully → The tunnel for your specific subnets is established.
  3. A client on Site A can ping a client on Site B → Your firewall rules are correct and traffic is flowing.

Project 5: Intrusion Detection with Suricata

  • File: LEARN_PFSENSE_DEEP_DIVE.md
  • Main Programming Language: N/A (Web GUI Configuration)
  • Alternative Programming Languages: N/A
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: 3. The “Service & Support” Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Network Security / IDS/IPS
  • Software or Tool: pfSense, Suricata package
  • Main Book: “The Practice of Network Security Monitoring” by Richard Bejtlich

What you’ll build: An Intrusion Detection and Prevention System (IDS/IPS) on your firewall that actively monitors network traffic for signatures of malicious activity and can automatically block threats.

Why it teaches pfSense: This project moves you from a passive firewall administrator to an active network defender. You’ll learn how to use pfSense for deep packet inspection and how to manage threat feeds, rule sets, and the fine art of tuning out false positives.

Core challenges you’ll face:

  • Choosing and configuring the right interface → maps to monitoring the WAN to see external threats, or the LAN to see internal ones
  • Selecting and managing rule sets → maps to subscribing to threat feeds (like Snort or ET Open) and deciding what to enable
  • Switching from IDS (logging) to IPS (blocking) mode → maps to understanding the risks of blocking legitimate traffic
  • Analyzing alerts and tuning for false positives → maps to the daily work of a security analyst

Key Concepts:

  • IDS (Intrusion Detection System): Analyzes traffic and logs alerts when it finds something suspicious.
  • IPS (Intrusion Prevention System): Same as IDS, but can also actively block the suspicious traffic.
  • Signature-based Detection: Using a database of known attack patterns (signatures) to find threats.
  • False Positives: When the IDS/IPS incorrectly flags legitimate traffic as malicious.

Difficulty: Advanced Time estimate: 2-3 weeks Prerequisites: Project 1, a reasonably powerful machine for pfSense (IDS/IPS is resource-intensive).

Real world outcome: When you run a port scan against your public IP (using an external service), you will see alerts fire in the Suricata dashboard. If you enable blocking mode, the scanning IP will be automatically added to a block list, and you can see it in Diagnostics > Tables.

Implementation Hints:

  1. Go to System > Package Manager and install the suricata package.
  2. Go to Services > Suricata > Global Settings. Enable the rule sets you want to use (start with ET Open, it’s free). Update your rules.
  3. Go to the Interfaces tab. Add your WAN interface.
  4. In the WAN interface settings, configure the rule categories you want to enable. Start with categories like scan, exploit, and malware.
  5. Initially, leave “Block Offenders” unchecked. This runs Suricata in IDS mode, so it only logs.
  6. Go to the Alerts tab. Generate some “malicious” traffic (e.g., run a Nmap scan against your WAN IP from a cloud VM). You should see alerts appear.
  7. Once you are confident it’s detecting correctly, go back to the interface settings and check “Block Offenders” to enable IPS mode.

Learning milestones:

  1. Suricata generates alerts for a port scan → You have successfully configured signature-based detection.
  2. You can identify a false positive and suppress it → You understand how to tune the system.
  3. IPS mode successfully blocks an “attacker” → You have an active defense system running.
  4. You can add your own custom rules → You can protect against threats specific to your environment.

Project 6: High Availability with CARP

  • File: LEARN_PFSENSE_DEEP_DIVE.md
  • Main Programming Language: N/A (Web GUI Configuration)
  • Alternative Programming Languages: N/A
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: 4. The “Open Core” Infrastructure
  • Difficulty: Level 4: Expert
  • Knowledge Area: High Availability / Network Redundancy
  • Software or Tool: pfSense x2 (VMs are fine)
  • Main Book: pfSense Official Documentation - High Availability

What you’ll build: A fully redundant pair of pfSense firewalls. If the primary firewall is unplugged or fails, the secondary firewall will take over its IP addresses and connection states instantly, with no interruption to client traffic.

Why it teaches pfSense: This is the pinnacle of enterprise-grade reliability. It forces you to understand how state is synchronized, how virtual IPs work, and the intricate configuration required to make two machines act as one.

Core challenges you’ll face:

  • Configuring CARP Virtual IPs (VIPs) → maps to creating the floating IPs for WAN and LAN that will move between firewalls
  • Setting up state synchronization (pfsync) → maps to ensuring the backup firewall knows about all active connections
  • Configuring XML-RPC configuration sync → maps to making sure any rule change on the primary is copied to the secondary
  • Testing failover and failback → maps to verifying that the system works as expected by simulating an outage

Key Concepts:

  • CARP (Common Address Redundancy Protocol): A protocol that allows multiple hosts to share a set of IP addresses. It uses advertisement messages to determine which host is the “MASTER” and which is the “BACKUP”.
  • pfsync: A pf-specific protocol to synchronize firewall state tables between nodes.
  • XML-RPC Sync: The mechanism pfSense uses to synchronize its configuration file.

Difficulty: Expert Time estimate: 1-2 weeks Prerequisites: Project 1, two pfSense instances (VMs work great), a dedicated network interface for sync traffic.

Real world outcome: Start a continuous ping from a client on the LAN to an external address (e.g., ping 8.8.8.8 -t). While the ping is running, shut down or reboot the primary pfSense firewall. You will see at most one or two dropped packets before the secondary firewall takes over and the ping continues, demonstrating a near-seamless failover.

Implementation Hints:

  1. Set up two identical pfSense VMs (fw01, fw02).
  2. Add a third interface to each VM on a dedicated “HA” or “Sync” network. Configure this interface with a static IP on both firewalls (e.g., 192.168.100.1/30 and 192.168.100.2/30).
  3. Go to Firewall > Virtual IPs. On fw01, create a CARP VIP for your LAN (e.g., 192.168.1.1) and WAN. Use a unique VHID group number and a password.
  4. Go to System > High Avail. Sync. On fw01 (primary), enable pfsync on the Sync interface and enter the Sync Peer IP of fw02. Enable XML-RPC sync and enter fw02’s admin credentials.
  5. On fw02 (secondary), do the same but point back to fw01.
  6. Go back to Firewall > Virtual IPs on fw01. You should see it reporting “MASTER”. On fw02, you should see “BACKUP”.
  7. Change your LAN clients’ gateway/DHCP settings to use the CARP VIP (192.168.1.1) instead of the firewall’s physical LAN IP.

Learning milestones:

  1. CARP VIPs show MASTER on primary and BACKUP on secondary → Your redundancy protocol is configured correctly.
  2. A firewall rule added on the primary appears on the secondary → Your XML-RPC configuration sync is working.
  3. Pings continue after pulling the plug on the primary → You have achieved true, stateful failover.

Project 7: Build a Custom Dashboard Widget

  • File: LEARN_PFSENSE_DEEP_DIVE.md
  • Main Programming Language: PHP
  • Alternative Programming Languages: N/A
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 2. The “Micro-SaaS / Pro Tool”
  • Difficulty: Level 3: Advanced
  • Knowledge Area: pfSense Internals / Web Development
  • Software or Tool: pfSense, SSH client
  • Main Book: pfSense Developer Documentation (unofficial)

What you’ll build: A simple dashboard widget for the pfSense WebGUI that displays custom information, for example, the current Bitcoin price from a public API, or the status of a specific service on your network.

Why it teaches pfSense: This project demystifies pfSense’s internals. It’s a gentle introduction to pfSense development, teaching you about its PHP-based structure, where configuration is stored (config.xml), and how to safely execute shell commands and present data in the UI.

Core challenges you’ll face:

  • Finding the correct directory for widgets → maps to learning the pfSense filesystem layout
  • Writing the PHP code to render the widget → maps to understanding the basic widget structure and pfSense helper functions
  • Fetching and parsing external data → maps to using PHP to make a cURL request and handle JSON
  • Registering the new widget so it can be added to the dashboard → maps to understanding how the GUI discovers new elements

Key Concepts:

  • pfSense filesystem: /usr/local/www/widgets/widgets/ is where widget files live.
  • config.xml: The central repository for all pfSense configuration, located in /cf/conf/.
  • PHP on pfSense: pfSense uses a specific version of PHP with its own set of libraries and functions.

Difficulty: Advanced Time estimate: 1-2 weeks Prerequisites: Project 1, basic knowledge of PHP and HTML.

Real world outcome: Your custom widget appears in the list of available widgets on the pfSense dashboard. You can add it, and it will display the live data you chose to fetch, refreshing automatically.

Implementation Hints:

  1. SSH into your pfSense box and choose option 8 for a shell.
  2. Navigate to /usr/local/www/widgets/widgets/.
  3. Copy an existing simple widget to use as a template (e.g., cp system_information.widget.php my_widget.widget.php).
  4. Edit my_widget.widget.php.
    • Change the $widgetkey to a unique name.
    • Find the get_widget_data() function. This is where you put your logic.
    • Use PHP’s file_get_contents() or cURL to fetch data from a JSON API (e.g., https://api.coindesk.com/v1/bpi/currentprice.json).
    • Decode the JSON and store the result in the $data array.
  5. Find the HTML section at the bottom of the file. Modify it to display your data (e.g., <?= $data['btc_price'] ?>).
  6. The widget will automatically be available to add to the dashboard. No service restart is needed.

Learning milestones:

  1. Your widget appears in the “Available Widgets” list → You have correctly named and placed the file.
  2. The widget displays static text → You understand the basic rendering structure.
  3. The widget displays dynamic data from an external API → You have successfully implemented the data-fetching logic.

Project 8: Secure Web Publishing with HAProxy

  • File: LEARN_PFSENSE_DEEP_DIVE.md
  • Main Programming Language: N/A (Web GUI Configuration)
  • Alternative Programming Languages: N/A
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: 4. The “Open Core” Infrastructure
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Application Delivery / Reverse Proxy
  • Software or Tool: pfSense, HAProxy package, acme package
  • Main Book: “HAProxy Enterprise Documentation” (concepts apply to the free version)

What you’ll build: A professional-grade reverse proxy that securely exposes multiple internal web services (e.g., a wiki, a file server) to the internet on standard ports (80/443) with valid SSL/TLS certificates.

Why it teaches pfSense: This is how you securely publish applications. It moves beyond simple port forwarding and teaches you about Layer 7 routing, SSL offloading, and load balancing. It’s a critical skill for anyone running web services.

Core challenges you’ll face:

  • Configuring backends and frontends in HAProxy → maps to defining your internal servers and how the public will access them
  • Automating SSL certificate acquisition with Let’s Encrypt → maps to using the acme package to generate and renew certificates
  • Routing traffic based on hostname → maps to hosting multiple sites (wiki.mydomain.com, files.mydomain.com) on a single IP address
  • Implementing SSL offloading → maps to letting HAProxy handle the encryption/decryption, simplifying your backend servers

Key Concepts:

  • Reverse Proxy: A server that sits in front of web servers and forwards client requests to them. It provides a single point of control and security.
  • SSL Offloading: The process of decrypting SSL/TLS traffic at the proxy and sending unencrypted traffic to the backend servers.
  • Layer 7 Routing: Making routing decisions based on application-level data, such as HTTP headers (e.g., the hostname).

Difficulty: Advanced Time estimate: 2-3 weeks Prerequisites: Project 1, a registered domain name, internal web services to publish.

Real world outcome: You can access https://wiki.yourdomain.com and https://files.yourdomain.com from the public internet. Both sites will show a valid SSL certificate in the browser, and the traffic will be securely routed to the correct internal server by HAProxy. Port forwards are no longer needed.

Implementation Hints:

  1. Install the haproxy and acme packages.
  2. Go to Services > ACME Certificates. Configure an account key and add your domain names. Use the DNS validation method for best results.
  3. Go to Services > HAProxy > Backends. Create a backend for each internal web service, adding the server’s private IP and port.
  4. Go to the Frontends tab. Create a public-facing frontend listening on port 443.
    • Under SSL Offloading, select the ACME certificate you created.
  5. Use “Access Control Lists” (ACLs) and “Actions” to direct traffic.
    • Create an ACL: host_is_wiki with value wiki.yourdomain.com.
    • Create an Action: use_backend wiki_backend if host_is_wiki.
    • Repeat for your other services.
  6. Ensure you have a firewall rule on your WAN to allow traffic to port 443 on the pfSense box itself.

Learning milestones:

  1. HAProxy serves a single site with a valid SSL certificate → You understand SSL offloading and basic frontend/backend configuration.
  2. You can route to different backends based on hostname → You have mastered Layer 7 routing with ACLs.
  3. Certificates automatically renew → Your ACME client is configured correctly for long-term, hands-off operation.

Project 9: Centralized Logging & Alerting

  • File: LEARN_PFSENSE_DEEP_DIVE.md
  • Main Programming Language: N/A (SIEM/Log tool configuration)
  • Alternative Programming Languages: Python for custom alert scripts
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 3. The “Service & Support” Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Security Operations / Log Management
  • Software or Tool: pfSense, Graylog/ELK/Loki
  • Main Book: “Applied Security Visualization” by Raffael Marty

What you’ll build: A system that forwards all logs from your pfSense firewall to a central log management platform (like Graylog). You’ll then build dashboards to visualize traffic and create alerts for suspicious events.

Why it teaches pfSense: A firewall’s logs are a goldmine of information, but they are useless if you don’t analyze them. This project teaches you how to get data out of pfSense and turn it into actionable intelligence.

Core challenges you’ll face:

  • Configuring remote syslog in pfSense → maps to telling pfSense where to send its logs
  • Setting up a log management server (e.g., Graylog) → maps to creating an input to receive the syslog messages
  • Parsing the pfSense log format → maps to using extractors or grok patterns to turn raw text into structured data
  • Building dashboards and alerts → maps to visualizing data and creating rules to notify you of specific events

Key Concepts:

  • Syslog: The standard protocol for sending log messages.
  • SIEM (Security Information and Event Management): A system that aggregates and analyzes log data from multiple sources.
  • Grok Patterns: Regular expressions used to parse unstructured log data into structured fields.

Difficulty: Advanced Time estimate: 2-3 weeks

  • Prerequisites: Project 1, a separate VM to run your log management software.

Real world outcome: You have a web dashboard showing a real-time map of countries your firewall is blocking, a chart of the top blocked ports, and a list of all OpenVPN logins. You receive an email alert automatically if someone from a known malicious IP address attempts to connect to your network.

Implementation Hints:

  1. Set up a Graylog (or similar) VM on your network.
  2. In Graylog, go to System > Inputs and create a new “Syslog UDP” input listening on a specific port (e.g., 5140).
  3. In pfSense, go to Status > System Logs > Settings.
  4. Enable Remote Logging, enter the IP and port of your Graylog server, and check all the log message types you want to forward (Firewall, DHCP, OpenVPN, etc.).
  5. In Graylog, go to “Search”. You should see raw pfSense logs arriving.
  6. Use the “Create extractor” or “Grok pattern” tools to parse the firewall log messages. A typical pfSense filterlog pattern looks complex but is well-documented online.
  7. Once parsed, you’ll have fields like src_ip, dst_ip, dst_port, action (pass/block).
  8. Use these fields to build dashboards and create alert conditions.

Learning milestones:

  1. Raw pfSense logs appear in Graylog → Syslog forwarding is working.
  2. Firewall logs are parsed into structured fields → You can now search and aggregate data effectively.
  3. You have a dashboard visualizing blocked traffic → You are turning raw data into intelligence.
  4. You receive an email when a specific firewall rule is triggered → You have created an automated alerting system.

Project 10: Building a Custom pfSense Package

  • File: LEARN_PFSENSE_DEEP_DIVE.md
  • Main Programming Language: PHP, XML, Shell
  • Alternative Programming Languages: N/A
  • Coolness Level: Level 5: Pure Magic (Super Cool)
  • Business Potential: 4. The “Open Core” Infrastructure
  • Difficulty: Level 5: Master
  • Knowledge Area: pfSense Development / Systems Programming
  • Software or Tool: pfSense, FreeBSD build environment
  • Main Book: pfSense Developer Documentation (unofficial)

What you’ll build: A complete, installable pfSense package. The package will provide a GUI screen to manage a list of IP addresses for a custom blocklist, a cron job to download this list from a URL, and the logic to load it into a pf firewall alias.

Why it teaches pfSense: This is the ultimate pfSense project. It forces you to understand the entire system: how the GUI is built (XML and PHP), how configuration is saved and loaded, how background services are managed, and how to interact with the underlying pf firewall.

Core challenges you’ll face:

  • Setting up a pfSense build environment → maps to compiling the system from source, the prerequisite for building packages
  • Creating the package XML definition → maps to defining the package’s menu entries, GUI pages, and installation hooks
  • Writing the PHP for the GUI → maps to creating the user interface for configuring your package
  • Interacting with the firewall → maps to using pfctl or pfSense helper functions to load your blocklist into a pf table
  • Writing the installation/deinstallation logic → maps to ensuring your package cleans up after itself

Key Concepts:

  • Package XML: A manifest file that defines all aspects of your package for the pfSense package manager.
  • pf Tables: A feature of Packet Filter that allows for high-performance lookups of large lists of IP addresses. Ideal for blocklists.
  • pfSense Cron Package: A dependency used to manage scheduled tasks.
  • pfSense-pkg- Prefix: The naming convention for all pfSense packages.

Difficulty: Master Time estimate: 1 month+

  • Prerequisites: All previous projects, strong PHP and shell scripting skills, familiarity with FreeBSD.

Real world outcome: Your package, pfSense-pkg-MyBlocker, is installable via the pfSense Package Manager. Once installed, it adds a new menu under “Services”. On its page, a user can specify a URL to a list of IPs. A cron job periodically downloads this list, and you can see in Diagnostics > Tables that a pf table has been populated with these IPs. A firewall rule using this alias will now block all those addresses.

Implementation Hints:

  1. Follow the official pfSense developer documentation to set up a build environment (usually a FreeBSD VM).
  2. Create your package directory structure. It will contain subdirectories like files/usr/local/pkg/ for your PHP code and files/etc/inc/ for package integration.
  3. Create the main package definition file, e.g., pfSense-pkg-MyBlocker.xml. This defines the name, version, and GUI pages.
  4. Create the PHP file for your GUI, e.g., my_blocker.php. This will contain the HTML form for the user to enter the blocklist URL.
  5. Create the backend script (e.g., my_blocker_sync.php) that will be run by cron. This script will:
    • Read the URL from the saved configuration.
    • Download the list of IPs.
    • Sanitize the list.
    • Use pfctl -t my_blocker_table -T replace -f /path/to/list to load the IPs into a pf table.
  6. The package XML will need <install> and <deinstall> sections to add/remove the cron job and clean up files.

Learning milestones:

  1. Your empty package can be compiled and installed → Your build environment and package definition are correct.
  2. Your GUI page appears and can save its configuration → You understand how pfSense handles configuration.
  3. Your cron job runs and successfully downloads the blocklist → Your background task is working.
  4. The pf table is populated and successfully blocks traffic → You have integrated your package with the core firewall engine.

Project Comparison Table

Project Difficulty Time Depth of Understanding Fun Factor
Basic Home Firewall Beginner Weekend Foundational Practical
Network Segmentation Intermediate 1-2 weeks Core Security Genuinely Clever
OpenVPN Server Intermediate Weekend Cryptography & Auth Genuinely Clever
Site-to-Site IPsec Advanced 1-2 weeks Advanced Networking Practical
Intrusion Detection Advanced 2-3 weeks Active Defense Hardcore Tech Flex
High Availability Expert 1-2 weeks Enterprise Reliability Hardcore Tech Flex
Custom Widget Advanced 1-2 weeks pfSense Internals Genuinely Clever
HAProxy Reverse Proxy Advanced 2-3 weeks Application Delivery Hardcore Tech Flex
Centralized Logging Advanced 2-3 weeks Security Operations Genuinely Clever
Custom Package Master 1 month+ System Mastery Pure Magic

Recommendation

For a developer or sysadmin looking to truly understand networking and security, start with Project 1 (Basic Home Firewall) and immediately follow it with Project 2 (Network Segmentation). These two projects are foundational and provide the most “bang for your buck” in terms of learning core security principles that apply everywhere.

Once you are comfortable, move to Project 3 (OpenVPN) to master remote access, and then jump to Project 5 (Intrusion Detection). This will give you a powerful, secure, and well-monitored network that will serve as the perfect base for all subsequent projects.

Summary

  • Project 1: The Basic Home Firewall: N/A (Web GUI Configuration)
  • Project 2: Network Segmentation with VLANs: N/A (Web GUI Configuration)
  • Project 3: Secure Remote Access with OpenVPN: N/A (Web GUI Configuration)
  • Project 4: Site-to-Site VPN with IPsec: N/A (Web GUI Configuration)
  • Project 5: Intrusion Detection with Suricata: N/A (Web GUI Configuration)
  • Project 6: High Availability with CARP: N/A (Web GUI Configuration)
  • Project 7: Build a Custom Dashboard Widget: PHP
  • Project 8: Secure Web Publishing with HAProxy: N/A (Web GUI Configuration)
  • Project 9: Centralized Logging & Alerting: N/A (SIEM/Log tool configuration)
  • Project 10: Building a Custom pfSense Package: PHP, XML, Shell