L2TP/IPsec
L2TP/IPsec is outdated and lacks modern cryptographic standards. Consider using WireGuard or modern OpenVPN instead. This documentation is provided for legacy support only.
In WinBox you can configure L2TP/IPsec in PPP -> Interface Templates and IP -> IPSec, or you can use terminal with commands /interface l2tp-server and /ip ipsec
L2TP (Layer 2 Tunneling Protocol) provides tunneling but no encryption, so it's combined with IPsec for security.
Prerequisites
Before configuring L2TP/IPsec, ensure you have:
Static public IP or working DDNS
Proper firewall rules for IPsec and L2TP traffic
Time synchronization - IPsec is sensitive to time differences
Certificate or PSK for IPsec authentication
Basic L2TP/IPsec server setup
Enable L2TP server
In WinBox go to PPP -> L2TP Server and configure:
Enabled - Yes
Use IPsec - Yes
IPsec Secret - Strong pre-shared key
Default Profile - Select appropriate PPP profile
Authentication - mschap2, mschap1, chap, pap (mschap2 recommended)
Create IP pool for clients
Create an IP pool for L2TP clients:
Configure PPP profile
Create or modify a PPP profile for L2TP clients:
In WinBox go to PPP -> Profiles and create/edit profile:
Name - l2tp-profile
Local Address - Gateway IP (e.g., 192.168.100.1)
Remote Address - l2tp-pool
DNS Server - Your DNS servers
Use Encryption - Yes
Update L2TP server to use custom profile
IPsec configuration
IPsec policy configuration
L2TP/IPsec requires specific IPsec policies. RouterOS should auto-generate these when you enable "use-ipsec", but you can configure manually:
IPsec proposal settings
Configure encryption and authentication methods:
Firewall configuration
Required firewall rules
L2TP/IPsec requires multiple firewall rules:
NAT configuration (if needed)
If L2TP clients need internet access:
User management
Create L2TP users
Add users in PPP -> Secrets:
Name - Username
Password - Strong password
Service - l2tp
Profile - l2tp-profile
User with specific IP
Assign specific IP to a user:
Client configuration
Windows built-in client
Windows 10/11:
Settings → Network & Internet → VPN
Add VPN connection:
VPN Provider: Windows (built-in)
Connection name: Your VPN name
Server name: Your server IP/domain
VPN type: L2TP/IPsec with pre-shared key
Pre-shared key: Your IPsec secret
Username/Password: Your PPP credentials
Registry fix for Windows (often required):
Android configuration
Android built-in VPN:
Settings → Network & Internet → VPN
Add VPN:
Type: L2TP/IPsec PSK
Server address: Your server IP
L2TP secret: (leave empty)
IPsec pre-shared key: Your IPsec secret
Username/Password: Your PPP credentials
iOS configuration
iOS built-in VPN:
Settings → General → VPN & Device Management → VPN
Add VPN Configuration:
Type: L2TP
Server: Your server IP
Account: Username
Password: Password
Secret: IPsec pre-shared key
Advanced configuration
Certificate-based authentication
Instead of PSK, you can use certificates (more secure but complex):
Multiple L2TP servers
You can run multiple L2TP server instances:
Troubleshooting
Common issues
Phase 1 failures (IKE):
Check IPsec secret matches on both ends
Verify firewall allows UDP 500 and 4500
Check time synchronization between client and server
Ensure correct authentication method
Phase 2 failures (ESP):
Verify L2TP server is enabled
Check firewall allows UDP 1701 and ESP protocol
Ensure PPP authentication credentials are correct
Windows-specific issues:
Apply registry fix for UDP encapsulation
Disable "Use default gateway on remote network" if not needed
Check Windows firewall settings
Diagnostic commands
Performance optimization
Migration recommendations
Why migrate from L2TP/IPsec
Outdated cryptography - Uses older encryption methods
Complex NAT traversal - Requires multiple ports and protocols
Performance issues - Higher overhead compared to modern VPNs
Limited mobile support - Inconsistent behavior across devices
Migration paths
To WireGuard:
Modern cryptography with better performance
Simpler configuration and better mobile support
Native support in RouterOS v7+
To OpenVPN:
Better compatibility across all platforms
More configuration flexibility
Established security track record
Coexistence period
You can run L2TP/IPsec alongside modern VPNs during migration:
Last updated
Was this helpful?