Modern Guide: pfSense Captive Portal with FreeRADIUS & ACME
Appearance
Modern Guide: pfSense Captive Portal with FreeRADIUS & ACME
Based on the Lawrence Systems Methodology
Reference Videos:
- pfSense Captive Portal with FreeRADIUS – Lawrence Systems
- Quick and Easy Local SSL Certificates for Your Homelab – Wolfgang's Channel
This guide focuses on a "production-ready" setup that minimizes browser errors (SSL warnings) on modern devices by using proper Let's Encrypt certificates and Split DNS. It also covers per-user bandwidth limiting and strict content whitelisting.
Prerequisites
- pfSense Firewall: Version 2.4/2.5 or higher.
- Domain Name: You need a domain name (buy one or use DuckDNS).
- Guest Network: A dedicated interface/VLAN (e.g., 192.168.2.1/24) for guests.
- Packages: Install
freeradius3andacme.
Phase 1: WebGUI Configuration (Port Conflict Prevention)
- Navigate to System > Advanced > Admin Access.
- TCP Port: Change this to
5555. - WebGUI Redirect: Ensure "Disable webConfigurator redirect rule" is unchecked.
- Click Save.
Phase 2: Free SSL Certificates (DuckDNS & Let's Encrypt)
The Problem: Modern browsers block "Self-Signed" certificates. The Fix: Use DuckDNS (free) to get a valid certificate.
Step A: Get a Free DuckDNS Domain
- Go to DuckDNS.org.
- Create a domain (e.g.,
mywifinetwork). - Copy your Token.
Step B: Configure ACME on pfSense
- Install ACME: Go to System > Package Manager and install
acme. - Create Account Key: Services > ACME > Account Keys > Add.
- Name:
LetsEncryptKey - Server: Let's Encrypt Production
- Name:
- Issue the Certificate:
- Go to Services > ACME > Certificates.
- Click Add.
- Name:
CaptivePortalCert - Domain name:
mywifinetwork.duckdns.org - Method: DNS-DuckDNS
- Token: Paste your token
- Click Save then Issue/Renew.
Phase 3: Split DNS Configuration
Ensure users resolve the domain to the local IP.
- Navigate to Services > DNS Resolver.
- Go to Host Overrides > Add.
- Host:
mywifinetwork - Domain:
duckdns.org - IP Address:
192.168.2.1(Guest Interface IP)
- Host:
- Click Save and Apply Changes.
Phase 4: Configure FreeRADIUS (Users & Bandwidth)
We will define three users with specific bandwidth limits.
1. Interfaces & Client
- Services > FreeRADIUS > Interfaces: Add
*for ports 1812 & 1813. - Services > FreeRADIUS > NAS / Clients: Add
127.0.0.1with secretSecretPass123.
2. Create Users
| User | Username | Password | Bandwidth Down | Bandwidth Up |
|---|---|---|---|---|
| Admin (Full Access) | adminuser
|
adminpass
|
Unlimited (leave blank) | Unlimited (leave blank) |
| Resident (0.1 Mbps) | resident
|
resident123
|
100 Kbps | 100 Kbps |
| Guest (0.01 Mbps) | guest
|
guest123
|
10 Kbps | 10 Kbps |
Phase 5: Firewall Rules & Whitelisting
Step A: Define Admin Devices (Static IPs)
- Go to Services > DHCP Server > [Guest Interface].
- Scroll to Static Mappings.
- Add your Admin Device's MAC Address and assign a specific IP (e.g.,
192.168.2.10). - Repeat for all Admin devices.
Step B: Create Aliases (The Whitelist)
- Go to Firewall > Aliases.
- Create Admin Alias:
- Name:
Admin_IPs - Type: Host(s)
- Content:
192.168.2.10(and other admin IPs)
- Name:
- Create Apps Alias:
- Name:
Allowed_Domains - Type: Host(s)
- Content:
grab.com,lalamove.com,api.grab.com,api.lalamove.com
- Name:
- Create Messaging Ports Alias:
- Name:
Messaging_Ports - Type: Port(s)
- Content: 3478 (WhatsApp/Messenger STUN), 5222 (WhatsApp/XMPP), 443 (HTTPS), 53 (DNS)
- Name:
Step C: Apply Strict Rules
Go to Firewall > Rules > [Guest Interface]. Delete any existing "Allow All" rules. Create these rules in this exact order:
| Rule # | Action | Source | Destination | Result |
|---|---|---|---|---|
| 1 | Pass | Single Host or Alias → Admin_IPs
|
Any | Admins bypass all blocks. |
| 2 | Pass (UDP) | Any | Port 53 (DNS) | Everyone needs DNS to function. |
| 3 | Pass (TCP/UDP) | Any | Allowed_Domains, Port 443
|
Allows traffic to Grab/Lalamove IPs. |
| 4 | Pass (TCP/UDP) | Any | Any, Port → Messaging_Ports
|
Allows WhatsApp/Messenger calls. |
| 5 | Block | Any | Any | Blocks YouTube, Social Media, general browsing for Residents/Guests. |
Phase 6: Configure the Captive Portal
- Enable Portal:
- Go to Services > Captive Portal.
- Add Zone
GuestZone, Enable it, select Guest Interface.
- Authentication:
- Method: RADIUS Authentication
- Primary Server:
127.0.0.1, Secret:SecretPass123 - Re-authentication: Checked (Every minute)
- RADIUS Options: Check Use RADIUS per-user bandwidth attributes
- HTTPS Login:
- Enable HTTPS: Checked
- Host Name:
mywifinetwork.duckdns.org - Certificate:
CaptivePortalCert
- Click Save.
Phase 7: Verification
Test Admin
- Connect with an Admin device (ensure it gets Static IP
192.168.2.10). - Log in as
adminuser. - Try YouTube. Result: Should work.
Test Resident
- Connect with a random phone.
- Log in as
resident. - Try Fast.com. Result: Speed capped at 0.1 Mbps.
- Try YouTube. Result: Blocked.
- Try Grab App. Result: Should load.
Test Guest
- Log in as
guest. - Try Fast.com. Result: Speed capped at 0.01 Mbps (very slow).