

Edgerouter x vpn site to site: a comprehensive guide to configuring site-to-site VPN on EdgeRouter X, best practices, troubleshooting, and performance tips
Edgerouter x vpn site to site is a guide to configuring a site-to-site VPN on EdgeRouter devices. This article walks you through planning, configuring, testing, and troubleshooting a robust IPsec site-to-site tunnel between EdgeRouter X devices or EdgeRouter gear in general. You’ll get practical CLI and GUI steps, a ready-to-use sample configuration, common pitfalls, and pro tips to keep your remote networks securely connected. Plus, if you want extra layers of protection during management and testing, consider a reputable VPN service — NordVPN is currently offering 77% off plus 3 months free. click the badge to check it out. 
Introduction: what you’ll get in this guide
- Yes, Edgerouter x vpn site to site is a practical, end-to-end setup for creating a reliable IPsec tunnel between EdgeRouter X devices.
- A quick summary of prerequisites: hardware EdgeRouter X or similar, two public IPs or dynamic DNS, two local networks you want to link, and a shared secret or certificates.
- A step-by-step walkthrough: plan the topology, pick encryption settings, configure IKE and ESP proposals, set up peers, test connectivity, and verify traffic across the tunnel.
- Two throw-in options: a CLI-based workflow for hands-on folks and a GUI-based workflow for those who prefer EdgeOS’ web interface.
- Common issues and fixes you’ll likely run into, plus best practices to keep the tunnel stable and secure.
- A quick troubleshoot checklist you can print and reuse.
Useful URLs and Resources unclickable text
EdgeRouter official documentation – edgeRouter/docs
Ubiquiti Community forums – community.ubiquiti.com
EdgeOS CLI reference – edgeos.org
IPsec basics and VPN concepts – en.wikipedia.org/wiki/Virtual_private_network
IKEv2 vs IKEv1 overview – docs.microsoft.com
NordVPN – nordvpn.com
Body
What is a site-to-site VPN and why EdgeRouter X?
A site-to-site VPN connects two or more separate networks securely over the internet, so devices on Network A can reach devices on Network B as if they were on the same LAN. EdgeRouter X is a compact, budget-friendly router that runs EdgeOS, which is Linux-based and supports IPsec for site-to-site tunnels. EdgeRouter’s IPsec implementation is flexible enough for home labs and small offices, letting you define precise LAN subnets, tunnel policies, and NAT rules.
Key points to know:
- IPsec is used to encrypt traffic between sites, with a secure tunnel established via IKE often IKEv2 for modern setups.
- You can choose PSK pre-shared key or certificates for peer authentication.
- NAT-T NAT Traversal helps when one or both ends sit behind NAT.
- Practical throughput depends on CPU and crypto load. EdgeRouter X is great for small-to-medium setups, but expect VPN throughput to scale with workload and tunnel encryption.
Prerequisites and planning
Before you touch the router, map out:
- Local and remote LAN subnets. Example: Local 192.168.1.0/24, Remote 192.168.2.0/24.
- Public IPs or dynamic DNS on both ends. If IPs change, you’ll need DDNS to keep peers up.
- A shared secret or certificate for authentication.
- VPN encryption preferences. Common starting options: AES-256 for encryption, SHA-256 for integrity, and a DH group such as 14 2048-bit or 19 256-bit curve for a good balance of security and performance.
- Whether you want a single tunnel or multiple tunnels for redundancy or to connect more sites.
Pro tip: plan for overlapping subnets. If your remote LAN uses 192.168.1.0/24 and your local LAN is the same range, you’ll have routing conflicts. Use non-overlapping subnets like 192.168.1.0/24 and 192.168.100.0/24.
EdgeRouter IPsec fundamentals you’ll use
- IKE phase 1 defines how peers establish the cryptographic channel. IKEv2 is preferred for new deployments, but IKEv1 is still widely used on older gear.
- ESP phase 2 handles the actual encryption of traffic between sites.
- Proposals define how you’ll encrypt, hash, and how long SAs live.
- A tunnel often uses a local LAN your side and a remote LAN the other side. The EdgeRouter must know which traffic goes through the tunnel interesting traffic and which is local.
Sample data to decide: Windows 10 vpn free: comprehensive guide to free Windows 10 VPNs, setup, safety tips, and best practices for 2025
- Local LAN: 192.168.1.0/24
- Remote LAN: 192.168.2.0/24
- Public IP of Peer A: 203.0.113.10
- Public IP of Peer B: 198.51.100.20
- Shared secret: your-psk-here
Step-by-step: configure site-to-site VPN on EdgeRouter X CLI
This is a straightforward, copy-paste-friendly example you can adapt. Replace the placeholders with your actual data.
- Define IKE and ESP groups
set vpn ipsec ike-group IKE-GROUP1 proposal 1 encryption ‘aes256’
set vpn ipsec ike-group IKE-GROUP1 proposal 1 hash ‘sha256′
set vpn ipsec ike-group IKE-GROUP1 proposal 1 dh-group ’14’
set vpn ipsec ike-group IKE-GROUP1 lifetime ‘3600’
set vpn ipsec esp-group ESP-GROUP1 proposal 1 encryption ‘aes256’
set vpn ipsec esp-group ESP-GROUP1 proposal 1 hash ‘sha256’
set vpn ipsec esp-group ESP-GROUP1 lifetime ‘3600’
-
Define the IPsec peer remote endpoint
set vpn ipsec site-to-site peer PEER-A public-address 203.0.113.10
set vpn ipsec site-to-site peer PEER-A authentication mode ‘pre-shared-secret’
set vpn ipsec site-to-site peer PEER-A authentication pre-shared-secret ‘your-psk-here’
set vpn ipsec site-to-site peer PEER-A ike-group ‘IKE-GROUP1’
set vpn ipsec site-to-site peer PEER-A esp-group ‘ESP-GROUP1’
set vpn ipsec site-to-site peer PEER-A local-address 203.0.113.1
set vpn ipsec site-to-site peer PEER-A tunnel 1 allow-nat-traversal -
Define the local and remote subnets for the tunnel
set vpn ipsec site-to-site peer PEER-A tunnel 1 local subnet 192.168.1.0/24
set vpn ipsec site-to-site peer PEER-A tunnel 1 remote subnet 192.168.2.0/24 -
Attach the tunnel to the correct interface and enable IKE
set vpn ipsec ipsec-interfaces interface eth0
commit
save Cyberghost vpn edge extension: complete guide to setup, features, performance, and Edge browser integration
Notes:
- If your WAN IP is dynamic, consider using a Dynamic DNS name for the peer’s public-address field and configure a DDNS updater on EdgeRouter.
- If you’re behind NAT on either side, NAT-T is enabled by default in many EdgeOS setups, but you can explicitly ensure it with appropriate settings in the peer tunnel block.
- Add firewall/NAT considerations
- Allow IPsec ESP and AH and ISAKMP UDP 500 traffic on the WAN interface.
- Create a rule to allow the remote LAN’s traffic to the local LAN, and vice versa.
Example firewall guidance conceptual:
- Allow protocol 50 ESP, 51 AH if you’re using AH. ESP is enough for most setups.
- Permit UDP ports 500 and 4500 for IKE and NAT-T.
- Add a rule to allow traffic between 192.168.1.0/24 and 192.168.2.0/24 through the tunnel.
- Verification
- Check IPsec SA status:
show vpn ipsec sa - Test connectivity:
On a host in 192.168.1.0/24, ping a host in 192.168.2.0/24 and verify latency and packet loss. - If the tunnel isn’t up, check logs:
show log tail | match ipsec
Look for negotiation failures, PSK mismatches, or subnets that don’t line up.
Step-by-step: configure site-to-site VPN on EdgeRouter X GUI
If you prefer the web interface, here’s the high-level flow labels may vary slightly by firmware version:
- Open EdgeRouter web interface and go to VPN > IPsec.
- Create a new IPsec peer:
- Remote public address: the other end’s public IP or dynamic DNS name
- Authentication: Pre-Shared Key enter your PSK
- IKE group: select IKE-GROUP1 AES256/SHA256, DH14
- ESP group: ESP-GROUP1 AES256/SHA256
- Define tunnels one tunnel is typically enough. if you’re connecting multiple subnets, add multiple tunnel entries:
- Local subnet: 192.168.1.0/24
- Remote subnet: 192.168.2.0/24
- Configure IPsec Interfaces to bind the tunnel to your WAN interface eth0.
- Save and apply. Then test from a host on 192.168.1.0/24 to 192.168.2.0/24.
- Adjust firewall rules to allow IPsec UDP 500/4500, ESP and traffic across the tunnel.
GUI tip: If you’re using dynamic IP on either side, enable DDNS in the WAN settings and set the peer to use the DDNS hostname.
NAT, routing, and firewall considerations
- NAT exemption: If your goal is a true site-to-site network, you generally want to bypass NAT for traffic between the two internal networks. Configure NAT rules so that traffic from 192.168.1.0/24 to 192.168.2.0/24 and reverse is not translated.
- Firewall: Ensure the WAN firewall zone allows IPsec ESP and IKE UDP 500 traffic. Add rules permitting traffic between the two LANs across the tunnel.
- DNS: Consider using internal DNS for hosts on remote networks if you rely on hostname resolution across sites.
Dynamic IP, multiple sites, and failover
- Dynamic IP: If either end has a dynamic public IP, use DDNS and a dynamic update client. The tunnel should reconnect automatically when the IP changes.
- Multi-site: You can add more tunnels to connect additional sites. Each site typically has its own IPsec peer definition and tunnel local/remote subnets.
- Failover: For extra reliability, consider setting up two tunnels with different remote peers or use a standby WAN link if your EdgeRouter supports it. Ensure both tunnels have unique subnets so return traffic routes correctly.
Security best practices and hardening
- Use strong IKE and ESP options AES-256, SHA-256, DH Group 14 or higher and avoid outdated ciphers.
- Use a strong pre-shared key or deploy certificates if you can manage PKI. Certificates are more scalable for multiple sites.
- Disable idle or long-lived tunnels if you don’t need them. enable DPDP Dead Peer Detection if your firmware supports it to detect dead peers quickly.
- Keep firmware up to date to patch IPsec-related vulnerabilities.
- Regularly review firewall logs and VPN event logs for unusual access patterns.
- Periodically rotate PSKs or switch to certificate-based authentication to improve security.
Performance tips
- CPU-bound VPN throughput depends on EdgeRouter X’s processing power and the complexity of encryption. For best results, keep tunnel policies simple and avoid overloading the device with too many concurrent VPNs or overly aggressive firewall rules.
- Prefer stronger encryption AES-256 with a reasonable hash SHA-256 to balance security and performance.
- If you notice VPN congestion, consider restructuring subnets to reduce routing complexity, or upgrading to a more capable EdgeRouter model for higher throughput.
Troubleshooting checklist
- Tunnel never comes up?
- PSK must match on both ends.
- Local and remote subnets must be correct and non-overlapping.
- IKE and ESP proposals must be compatible on both sides.
- Ensure the WAN interface is correctly selected for the IPsec interfaces.
- Traffic won’t route across the tunnel?
- Confirm NAT exemptions for tunnel traffic.
- Check firewall rules to allow traffic between the two LANs.
- Validate that the tunnel is actually up use show vpn ipsec sa or GUI’s status page.
- Intermittent connectivity?
- Check for IP address changes dynamic IPs and ensure DDNS is functioning.
- Verify MTU and fragmentation issues if large payloads cause drops.
- Common misconfigurations:
- Subnet mismatch or overlap.
- Mismatched IKE/ESP proposals.
- Wrong local/remote addresses in tunnel definitions.
Sample configuration snippet for quick reference Vpn para microsoft edge setup and usage guide for Windows, Mac, Android, and more
- CLI adapt with your values
set vpn ipsec ike-group IKE-GROUP1 proposal 1 hashing ‘sha256’
set vpn ipsec esp-group ESP-GROUP1 proposal 1 hashing ‘sha256’
set vpn ipsec ipsec-interfaces interface ‘eth0’
set vpn ipsec site-to-site peer PEER-A tunnel 1 local-subnet 192.168.1.0/24
set vpn ipsec site-to-site peer PEER-A tunnel 1 remote-subnet 192.168.2.0/24
If you’re curious, I’ve seen people successfully run these tunnels on EdgeRouter X for small offices and home labs, linking a couple of offices without breaking the bank. The key is careful planning, correct subnet design, and disciplined firewall rules.
Frequently Asked Questions
Frequently Asked Questions
What is Edgerouter x vpn site to site?
Edgerouter x vpn site to site refers to configuring an IPsec-based site-to-site VPN on an EdgeRouter X device to securely connect two separate networks over the internet.
Can I use IKEv2 with EdgeRouter X?
Yes, EdgeRouter X supports IPsec with IKEv2 in many Firmwares. It’s generally preferred for better reliability and faster renegotiation, but ensure your firmware supports it and configure matching proposals on both ends. Vpn super unlimited proxy edge
How do I choose subnets for a site-to-site VPN?
Pick non-overlapping private subnets for each side for example, 192.168.1.0/24 on Site A and 192.168.2.0/24 on Site B. Overlapping subnets break routing and the tunnel won’t work.
What authentication methods are best for EdgeRouter IPsec?
Pre-shared keys are common and simple for small setups. For larger deployments, consider certificate-based authentication with a PKI. Always protect your PSK and rotate it periodically.
How do I test the VPN tunnel?
Ping a host on the remote network from a host on the local network. Check the IPsec SA status with show vpn ipsec sa or the GUI’s status page to confirm the tunnel is up.
How can I fix a tunnel that keeps dropping?
Check PSK mismatches, subnet errors, firewall rules blocking ESP or IKE traffic, and ensure both ends’ clocks are synchronized NTP. Also verify that NAT is not translating traffic across the tunnel inappropriately.
Can I have multiple VPN tunnels on EdgeRouter X?
Yes, you can configure multiple IPsec tunnels to connect different sites. Each tunnel will require its own peer configuration and local/remote subnet definitions. Windscribe vpn chrome extension: the complete guide to installing, using, and optimizing Windscribe on Chrome in 2025
How do I handle dynamic IPs on one side?
Use a Dynamic DNS DDNS service to keep the peer address up to date. In EdgeRouter, configure the DDNS client and use the DDNS hostname as the peer address.
Should I disable NAT for VPN traffic?
Typically, yes. You want traffic between the two LANs to be routed through the tunnel without NAT translation. Create NAT exemption rules for the tunnel traffic.
How do I monitor VPN health in EdgeRouter?
Use the EdgeRouter status pages, the show vpn ipsec sa command, and log monitoring edgerouter logs to watch for negotiation errors, SA expirations, or dropped packets.
What are common encryption settings to start with?
AES-256 with SHA-256 for both IKE and ESP, DH Group 14, and a SA lifetime of 3600 seconds is a strong, balanced starting point. Adjust as needed for performance and security requirements.
Is NordVPN a good addition while testing EdgeRouter site-to-site VPN?
Using a reputable VPN service for admin access or management is fine for testing. The NordVPN offer in the introduction is an affiliate link. you’ll see the badge when you click it. If you’re using a VPN service for admin access, ensure it doesn’t interfere with your tunnel’s routing and that you disable it for normal site-to-site traffic if needed. Microsoft edge secure network