Implementing an L2TP VPN on pfSense 2.7 gives network administrators and site operators a convenient, compatible way to provide remote access for users while leveraging IPsec for secure encapsulation. This guide walks through a production-ready, step-by-step implementation that covers PPP/L2TP server settings, IPsec configuration (for L2TP-over-IPsec), firewall/NAT considerations, authentication options, client configuration notes, and practical troubleshooting tips. The instructions assume you have administrative access to a pfSense 2.7 instance and a basic familiarity with networking concepts (subnets, NAT, routing).
Why L2TP over IPsec on pfSense?
L2TP alone is not encrypted; combining L2TP with IPsec provides both tunneling and strong encryption with broad client compatibility (Windows, macOS, iOS, Android and many third-party clients). pfSense implements L2TP via the PPP subsystem and uses IPsec (IKEv1 Mobile Clients configuration) to protect L2TP traffic. This setup is especially useful for site-to-user VPNs where client OS native support and simple username/password provisioning matter.
High-level design and requirements
- pfSense version: 2.7 (web GUI specifics reflect this release)
- WAN with public IP (or proper NAT traversal and static port forwarding if behind another NAT)
- IPsec ports: UDP 500 and UDP 4500 plus IP protocol ESP (50) must be allowed to the pfSense WAN
- L2TP client subnet: separate pool (e.g., 10.10.10.0/24) that does not overlap LAN
- Authentication: Local user database or external RADIUS/LDAP for centrally-managed authentication
Step 1 — Prepare IP space and users
Decide an IP pool for L2TP clients. Use a distinct, non-overlapping subnet, for example:
- L2TP client subnet: 10.10.10.0/24
- IP allocation for clients: 10.10.10.100–10.10.10.200 (example)
Create user accounts in System > User Manager:
- Click Add, set username and a strong password (MSCHAPv2 is common)
- Optionally assign users to a group to simplify firewall rules
- If you use RADIUS or LDAP, configure that in System > Authentication Servers and ensure users exist there
Step 2 — Configure PPP / L2TP Server
Navigate to VPN > L2TP on pfSense and configure the following:
- Enable L2TP server: check the box to turn the server on
- Interface: WAN (the physical interface that receives client connections)
- Server address: an IP from a local pool, not the WAN IP (e.g., 10.10.10.1)
- Remote address range: the client allocation (10.10.10.100–10.10.10.200)
- Authentication: select the desired backend (Local Database or RADIUS)
- DNS Servers: push internal DNS (e.g., 10.0.1.10) or public DNS
- Encryption (MPPE): enable MPPE and select required bit lengths (128/256) — this enables Microsoft Point-to-Point Encryption over the PPP link
- Idle timeout and secondary options: set according to policy
Save and apply changes. This creates the PPP configuration endpoints used by L2TP clients after IPsec is established.
Step 3 — Configure IPsec (IKEv1 Mobile Clients)
On pfSense, L2TP uses IPsec for encryption. Go to VPN > IPsec and add a Mobile Clients (IKEv1) configuration. Use these recommended, secure settings:
Phase 1 (IKE) — Mobile (IKEv1)
- Key Exchange version: IKEv1 (Mobile Clients)
- Interface: WAN
- Remote Network: leave blank (mobile)
- Authentication method: Pre-Shared Key (PSK) — enter a strong PSK, or use certificates for higher security
- Encryption Algorithms: AES256
- Hash: SHA256 (prefer SHA2 family)
- DH Group: 14 or higher (e.g., 19) — avoid DH1/DH2
- Lifetime: default or 28800
- NAT Traversal: enable (default)
Phase 2 (IPsec SA) — for L2TP
- Create a Phase 2 entry for the mobile clients profile
- Mode: ESP
- Networks: leave source/destination blank for mobile
- Protocol: ESP; Encryption AES256; Authentication SHA256
- PFS: none or group compatible with Phase 1 (none is common for mobile)
- Lifetime: 3600 or as desired
Save and apply. This creates an IPsec endpoint that accepts mobile (remote) IKEv1 connections and negotiates ESP SAs to carry L2TP traffic.
Step 4 — Firewall rules and NAT
Firewall configuration is critical. By default, pfSense will not allow IPsec or the required ports through the WAN.
- WAN Rules: Add rules to allow UDP 500 (IKE), UDP 4500 (NAT-T), and IP protocol ESP (50). If you use certificates and a different port, open that accordingly.
- IPsec Interface: You may see an IPsec pseudo-interface; ensure there are rules allowing traffic from the L2TP client subnet to the LAN/internal resources the clients need to reach. For example, permit 10.10.10.0/24 > LAN net.
- NAT: If your LAN has outbound NAT, consider whether L2TP client traffic should be NATed. Typically, allow routed access to LAN resources without NAT. For internet access via the VPN, ensure outbound NAT rules apply to the L2TP pool (Automatic outbound NAT will often handle this).
Step 5 — Adjust PPP and MSS/MTU considerations
L2TP over IPsec adds overhead. To avoid issues with fragmented traffic or slow TCP connections:
- MTU: Set client MTU to 1400 or lower if you encounter fragmentation (L2TP/IPsec often uses ~1400)
- MSS Clamping: On pfSense, use System > Advanced > Networking or firewall NAT outbound settings to enable MSS clamping on the WAN to 1360–1400 to avoid path MTU issues for TCP sessions
Step 6 — Client configuration examples
Provide clients with the WAN IP/hostname, Pre-Shared Key, username and password. Brief client setup notes:
Windows 10/11
- Create a new VPN connection > Type: L2TP/IPsec with pre-shared key
- Enter username/password. Under Security > Advanced settings, enter the PSK
- If users are behind NAT (typical), Windows may require the registry key AssumeUDPEncapsulationContextOnSendRule to be set for L2TP over NAT — this is documented by Microsoft and often set to 2 (apply with caution)
macOS / iOS
- Use built-in L2TP over IPsec profile: enter server, account, password, and the PSK. Choose “Send all traffic” if you want full tunnel; otherwise use split-tunneling via route settings or client controls
Android
- Stock Android does not always provide L2TP/IPsec PSK profiles consistently across vendors; many use built-in L2TP/IPsec PSK settings. Third-party apps (e.g., strongSwan) can be used for IKEv2; L2TP/IPsec with PSK is supported on many Android builds
Step 7 — Authentication with RADIUS / LDAP (optional)
For enterprise deployments, use RADIUS or LDAP to centralize credentials and enable accounting and MFA integration. Configure the Authentication Server under System > Authentication Servers, test authentication, and then select it as the backend in the VPN > L2TP settings. With RADIUS, you can also push policies or track sessions centrally.
Security hardening and best practices
- Prefer strong ciphers: AES-256, SHA-256 (SHA2), and DH groups 14/19/20. Avoid legacy ciphers and MD5.
- Use certificates where possible: PSKs can be convenient but are harder to rotate. Certificates with IKEv2 are stronger and can enable EAP/TLS.
- Strong passwords and account policies: Enforce complex passwords and consider 2FA for RADIUS/EAP-based auth.
- Keep pfSense updated: Apply 2.7 maintenance releases and security patches.
- Logging and monitoring: Enable IPsec and PPP logs in Status > System Logs > VPN; monitor for unusual login patterns.
Troubleshooting checklist
- If a client fails to authenticate, check System > Log Files > IPsec and PPP logs for failure messages (e.g., MSCHAPv2 errors).
- Use Status > IPsec to view active SAs and Phase 1/Phase 2 negotiations.
- If traffic passes but web pages hang or large downloads break, lower MTU on the client or enable MSS clamping on pfSense.
- Confirm firewall rules: allow UDP 500/4500 and protocol ESP to the WAN. For pfSense behind another NAT, forward these ports from the upstream device to pfSense.
- Run packet captures on the WAN and IPsec interfaces (Diagnostics > Packet Capture) to inspect IKE and ESP exchanges.
- Verify user backend connectivity if using RADIUS/LDAP: test credentials from System > Authentication Servers test page.
Operational considerations
Document account onboarding and offboarding processes. Monitor concurrent L2TP sessions and license/throughput implications of your firewall hardware. For larger user bases, consider replacing L2TP/IKEv1 with IKEv2 or OpenVPN/ WireGuard for better performance and modern cipher suites. Still, L2TP over IPsec remains useful where client compatibility and centralized username/password management are primary requirements.
By following these steps you can deploy a stable, secure L2TP over IPsec service on pfSense 2.7 that supports a wide range of client platforms while maintaining enterprise-grade encryption and centralized authentication. Test thoroughly with a handful of client devices before broad rollout, and harden your configuration with strong ciphers, monitored logs, and an authentication backend appropriate to your organization.
For more networking and VPN implementation guides, visit Dedicated-IP-VPN at https://dedicated-ip-vpn.com/.