π pfSense + LDAP Authentication Setup Guide A step-by-step guide to integrate pfSense with Active Directory over secure LDAPS using a Letβs Encrypt certificate issued via DNS validation.
β
1. Prerequisites π₯οΈ Windows Server 2025 as Domain Controller (DC) π A pfSense firewall instance π A domain name (e.g., packetrealm.io) βοΈ Cloudflare for DNS management π Admin access to pfSense Web UI πΆ Internet access from the Domain Controller π 2. Configure DNS in Cloudflare Log in to your Cloudflare dashboard Select your domain (e.g., packetrealm.io) Navigate to DNS β Add an A record: Name: dc IPv4 address: IP of your DC (LAN IP or WAN if accessible) Proxy status: βͺ DNS only Save and verify with: nslookup dc.packetrealm.io π 3. Issue TLS Certificate via Win-ACME (Manual DNS) π§° 3.1 Download Win-ACME π Download Win-ACME Use the win-acme.v2.x.x.x.x64.trimmed.zip version Extract to C:\win-acme π₯ 3.2 Issue Certificate (Manual DNS-01) cd C:\win-acme .\wacs.exe Choose M β Create new certificate with advanced options Enter: dc.packetrealm.io Choose DNS-01 challenge Select Manual for DNS update method Add TXT record in Cloudflare: Name: _acme-challenge.dc Value: TXT value from wacs After propagation, hit Enter to continue π 3.3 Verify Certificate Open mmc.exe Add Certificates β Local Computer Navigate to Personal β Certificates Ensure: Issued to: dc.packetrealm.io Enhanced Key Usage: Server Authentication π 3.4 Restart NTDS Restart-Service ntds π 4. Import Letβs Encrypt Root CA to pfSense π 4.1 Download Root Certificate π ISRG Root X1 - PEM format π οΈ 4.2 Add to pfSense Go to System β Cert Manager β CAs Click Add Name: Letβs Encrypt ISRG Root X1 Paste entire PEM contents Save β
π€ 5. Create LDAP Bind Account (Best Practice) Open Active Directory Users and Computers Create OU: ServiceAccount (if needed) Add user: ldapbind Set password + Password never expires Example DN: CN=ldapbind,OU=ServiceAccount,DC=packetrealm,DC=io π§© 6. Configure LDAP in pfSense Go to System β User Manager β Authentication Servers Click Add: Type: LDAP Hostname: dc.packetrealm.io Port: 636 Transport: SSL Peer CA: Letβs Encrypt ISRG Root X1 Base DN: DC=packetrealm,DC=io Bind DN: CN=ldapbind,OU=ServiceAccount,DC=packetrealm,DC=io Password: your ldapbind password Save & test with Diagnostics β Authentication π 7. Enable LDAP Authentication in pfSense Go to System β User Manager β Settings Set your LDAP server as the authentication backend Apply settings π 8. Automate Certificate Renewal β
Win-ACME installs a scheduled task It auto-renews and places cert in Local Computer > Personal pfSense trusts it through the CA, no re-import needed Monitor expiry as a safeguard π οΈ 9. Troubleshooting Test LDAPS connectivity
...