

Yes, you can set up a site-to-site VPN on EdgeRouter X. In this guide, I’ll walk you through a practical, no-nonsense approach to designing, configuring, and validating a reliable IPsec site-to-site VPN between two networks using EdgeRouter X. You’ll get a step-by-step CLI workflow, key considerations for network design, firewall tweaks, testing tips, and common troubleshooting tricks. Whether you’re connecting two branch offices or linking a data center to a remote site, this guide keeps things approachable and actionable. Plus, I’ve peppered in real-world tips and best practices to help you avoid the usual headaches.
If you’re wondering about extra layer of protection while you tinker or manage remote devices, NordVPN can help with secure remote access, and there’s a deal you’ll want to check out in the intro. 
Introduction: what you’ll learn and how it helps your network Ultrasurf edge
- Understand when to use a site-to-site VPN on EdgeRouter X and what it protects.
- Plan a simple, non-overlapping IP addressing scheme for two sites.
- Configure a robust IPsec setup IKE and ESP groups, PSK, and tunnel definitions.
- Create precise firewall rules and NAT behavior to allow VPN traffic without exposing your LAN.
- Add static routes so traffic destined for the remote network actually goes through the VPN.
- Validate the tunnel, monitor its status, and troubleshoot common issues quickly.
- Get practical tips for dynamic IPs, failover, and performance tuning.
Useful resources and references unlinked text, not clickable
Apple Website – apple.com, OpenWrt Project – openwrt.org, Vyatta EdgeOS Documentation – edgeos.support, IPsec Wikipedia – en.wikipedia.org/wiki/IPsec, Ubiquiti Community – community.ubiquiti.com
What you’ll need before you begin
- Two EdgeRouter X devices or one EdgeRouter X at each site with EdgeOS firmware up to date.
- Publicly reachable WAN IP addresses on both sides static is ideal, dynamic is possible with DNS or a dynamic DNS setup.
- Two private LANs you want to connect, e.g., Site A: 10.1.0.0/24 and Site B: 10.2.0.0/24.
- A shared pre-shared key PSK for IPsec authentication.
- Basic admin access to both EdgeRouter X devices and a plan for firewall rules.
Design considerations: what to plan in advance
- IP address plan: Keep the two LANs distinct and non-overlapping. If you’re using private addresses, ensure there’s no overlap with the remote network.
- Tunnel direction and routing: Decide whether you’ll use a policy-based route static route-based policy on each router or rely on the VPN tunnel to steer traffic automatically via the remote network’s CIDR.
- Security posture: Use a strong PSK at least 128 bits, and pick modern encryption and hashing algorithms. Avoid outdated combos like DES or SHA-1 when possible.
- Firewall posture: Harden the EdgeRouter with a default deny policy, then only allow IPsec-related traffic and management interfaces.
Section 1: EdgeRouter X prerequisites and basic setup recap
- Confirm you’re on a recent EdgeOS version the Web UI is fine for most folks, but the CLI is preferable for repeatable configs.
- Confirm WAN/LAN mapping: typically eth0 is WAN, eth1 and possibly eth2 is LAN on EdgeRouter X, but verify your hardware wiring.
- Bring up basic LAN access, set a management IP, and ensure you can SSH or use the Web UI to reach the device.
Section 2: Network design for a simple site-to-site VPN Surf vpn chrome extension: the definitive guide to using Surf VPN in Chrome, setup tips, safety, and comparisons
- Site A LAN: 10.1.0.0/24
- Site B LAN: 10.2.0.0/24
- Site A WAN: public IP A
- Site B WAN: public IP B
- Non-overlapping is critical. If you must use overlapping ranges, you’ll need NAT traversal or a different addressing plan, but non-overlapping is strongly recommended for least friction.
Section 3: Step-by-step EdgeRouter X site-to-site VPN setup IPsec
Note: The exact syntax can vary slightly between EdgeOS versions, but the general approach and commands are consistent.
Step 1 – Gather inputs and plan the parameters
- Site A local network: 10.1.0.0/24
- Site B remote network: 10.2.0.0/24
- Site A WAN IP: A_PUBLIC_IP
- Site B WAN IP: B_PUBLIC_IP
- PSK: your_secure_psk
- IKE Group: choose a solid option for example, 14 or 19
- ESP Group: choose matching encryption/hash for example, aes256 with sha256
Step 2 – Configure IKE IKE-GROUP
set vpn ipsec ike-group IKE-GROUP0 proposal 1 encryption aes256
set vpn ipsec ike-group IKE-GROUP0 proposal 1 hash sha256
set vpn ipsec ike-group IKE-GROUP0 proposal 1 dh-group 19
set vpn ipsec ike-group IKE-GROUP0 lifetime 3600 Usa vpn extension edge
Step 3 – Configure ESP ESP-GROUP
set vpn ipsec esp-group ESP-GROUP0 proposal 1 encryption aes256
set vpn ipsec esp-group ESP-GROUP0 proposal 1 hash sha256
set vpn ipsec esp-group ESP-GROUP0 lifetime 3600
Step 4 – Enable NAT-T for IPsec behind NAT if either end sits behind NAT
set vpn ipsec nat-traversal enable
Step 5 – Define the site-to-site peer Site A ↔ Site B Edge vpn download guide: how to install, optimize, and compare Edge VPN for secure browsing, streaming, and everyday use
Site A configuration on EdgeRouter X at Site A
set vpn ipsec site-to-site peer B_PUBLIC_IP authentication mode pre-shared-secret
set vpn ipsec site-to-site peer B_PUBLIC_IP authentication pre-shared-secret ‘your_secure_psk’
set vpn ipsec site-to-site peer B_PUBLIC_IP ike-group IKE-GROUP0
set vpn ipsec site-to-site peer B_PUBLIC_IP esp-group ESP-GROUP0
set vpn ipsec site-to-site peer B_PUBLIC_IP local-address A_PUBLIC_IP
set vpn ipsec site-to-site peer B_PUBLIC_IP tunnel 1 local-prefix 10.1.0.0/24
set vpn ipsec site-to-site peer B_PUBLIC_IP tunnel 1 remote-prefix 10.2.0.0/24
Step 6 – Bring up the tunnel and apply changes
commit
save
reload
Notes:
- The “peer” is the remote site’s public IP B_PUBLIC_IP from Site B. “local-address” is your own WAN IP at Site A.
- tunnel 1 is a logical identifier. you could have multiple tunnels if you have more networks, but for a basic two-site VPN one tunnel is enough.
Step 7 – Ring-fence the traffic with firewall rules Edge vpn download for pc
-
You’ll want to allow IPsec/IKE/NAT-T traffic through the WAN interface.
-
Create a firewall policy to accept established/related traffic on the WAN while denying unsolicited inbound traffic, then add a clear rule that permits IPsec UDP 500, UDP 4500, ESP through to the EdgeRouter’s IPsec subsystem.
-
Example high level:
set firewall name WAN-IN description ‘Allow IPsec’
set firewall name WAN-IN rule 10 action accept
set firewall name WAN-IN rule 10 protocol 50
set firewall name WAN-IN rule 10 description ‘ESP’
set firewall name WAN-IN rule 20 protocol UDP
set firewall name WAN-IN rule 20 destination port 500
set firewall name WAN-IN rule 20 description ‘IKE’
set firewall name WAN-IN rule 30 destination port 4500
set firewall name WAN-IN rule 30 description ‘NAT-T’ -
Attach the firewall to the WAN interface.
Step 8 – Static routes to reach the remote LAN policy-based routing Does microsoft have vpn and how to use built-in Windows VPN plus Azure VPN for home and business
- On Site A, add a static route for the remote network via the VPN tunnel:
set protocols static route 10.2.0.0/24 next-hop 0.0.0.0 distance 1 - Or, depending on your policy, you might rely on the VPN’s tunnel policy to automatically push the correct traffic. The exact method can vary, but the key is ensuring traffic destined for 10.2.0.0/24 uses the VPN tunnel.
Step 9 – Validate everything is up
- In the EdgeRouter X CLI, run:
show vpn ipsec sa
This shows active IPsec Security Associations and can confirm if the tunnel is up. - Ping from Site A to a host on Site B’s LAN, e.g., ping 10.2.0.10.
- Check the logs if the tunnel isn’t establishing:
show log | match ipsec - You can also test from Site B to Site A to verify two-way connectivity.
Section 4: Verify, monitor, and troubleshoot quick wins
- Tunnel status: The IPsec SA table tells you if the tunnel is in use. If you don’t see a SA, recheck PSK, peer address, and IKE/ESP group settings.
- Mismatched IKE/ESP: Ensure both sides use the same IKE group and ESP group. A mismatch here is the most common reason tunnels fail to establish.
- NAT-T issues: If one side sits behind a double NAT or a firewall is interfering, double-check NAT-T is enabled and UDP ports 500 and 4500 are allowed outward.
- DNS and dynamic IPs: If one side has a dynamic IP, consider using a dynamic DNS name as the remote-peer address, but most EdgeRouter setups still require a relatively stable public IP for IPsec peers.
- Firewall blocking: Ensure IPsec and IKE traffic isn’t blocked by a local firewall rule on either side.
Section 5: Advanced tips and common patterns that help real-world
- Dynamic IPs: If you’re dealing with dynamic public IPs, you can pair a dynamic DNS entry with a script to update the remote peer whenever your WAN IP changes. This reduces the risk of a VPN tunnel breaking due to IP changes.
- Redundancy: If you need high availability, you can run a second EdgeRouter X on the same site and use a secondary tunnel to the other site, along with a policy to fail over if the primary goes down.
- Performance tuning: If you’re hitting throughput or CPU limits on EdgeRouter X, reduce encryption overhead by adjusting the cipher suite to aes128. this can help free CPU cycles for routing tasks. If you’re using AES-256 for security, ensure the device’s CPU can handle the load, or consider a more powerful device for high-throughput VPN links.
- DNS considerations: When the VPN is active, clients on one side can resolve hosts on the other side through typical DNS resolution. You may want to configure DNS forwarders on your EdgeRouter or point clients to a local DNS server on the remote site.
- Split-tunneling vs full-tunnel: Decide if you want all traffic to flow through the VPN full-tunnel or just site-to-site traffic split-tunnel. The configuration above is effectively a site-to-site tunnel, but you can extend it to route ad-hoc traffic by adjusting firewall rules and routing.
Section 6: Real-world troubleshooting checklist
- Tunnel never establishes:
- Confirm PSK matches on both sides.
- Ensure public IP addresses are correct and reachable no ISP blocks or CGNAT issues.
- Verify IKE group and ESP group match on both ends.
- Traffic doesn’t reach remote LAN:
- Check static routes or policy-based route setup.
- Verify firewall rules aren’t blocking traffic across the VPN.
- Intermittent drops:
- Check for IPsec SA lifetime mismatches.
- Confirm NAT-T is enabled if NAT is involved anywhere along the path.
- Look for frequent IP address changes on the remote side if dynamic IPs are used.
Section 7: Optional enhancements and best practices Pure vpn edge extension setup and optimization guide for Chrome and Edge, features, privacy, and speed
- Documentation: Maintain a small runbook with site IPs, PSKs securely stored, and remote subnets. This makes future changes much easier.
- Monitoring: Use snmp traps or a simple syslog setup to monitor VPN uptime and LAN reachability. A lightweight alerting rule for VPN down events can save you trouble.
- Security hardening: Limit management access to the EdgeRouter X to your admin IPs, use strong passwords, and rotate PSKs periodically.
- Backups: Export and back up your EdgeRouter X configuration after you’ve confirmed the VPN is stable. A quick restore can save you hours during a failure.
Section 8: Frequently Asked Questions
What is a site-to-site VPN on EdgeRouter X?
A site-to-site VPN on EdgeRouter X creates a secure IPsec tunnel between two distinct networks over the internet, allowing devices on one LAN to reach devices on the other LAN as if they were on the same private network.
Do I need two EdgeRouter X devices for a site-to-site VPN?
Not necessarily, but it’s common. One EdgeRouter X on each site makes the tunnel and routing easier to manage. If you only have one device, you can still connect to a remote VPN gateway, but you’ll be limited to one end of the tunnel on that device.
Can I use dynamic IPs on either side?
Yes, but it’s more complex. You’ll typically rely on dynamic DNS at the remote peer and scripts to update the peer address if the IP changes. Still, static IPs are much easier to maintain for a stable tunnel.
What should I put for local-address and peer-address?
Local-address is your side’s public IP or the IP that faces the internet. Peer-address is the remote site’s public IP. If you’re behind NAT, NAT-T helps, but you still configure those public IPs. X vpn microsoft edge: the complete guide to using a VPN with Microsoft Edge for privacy, security, streaming, and work
Which encryption and hashing should I choose?
AES-256 with SHA-256 is a solid, common choice for security and performance. If you’re constrained by hardware, AES-128 with SHA-256 is a good balance. Always align with the remote side.
How do I test the tunnel once it’s configured?
Use the EdgeRouter CLI to check the status: show vpn ipsec sa. Then ping from a host on Site A to a host on Site B e.g., ping 10.2.0.10. Review logs for any issues if you don’t see a tunnel.
What if the tunnel is up but I can’t access the remote network?
Double-check routing and firewall: ensure the static routes or policy routes point traffic for the remote LAN through the VPN, and confirm firewall rules allow traffic between the two LANs over the VPN.
Can I run more than one site-to-site VPN on the same EdgeRouter X?
Yes, you can configure multiple IPsec peers and tunnels, as long as you manage the local and remote prefixes, PSKs, and firewall rules carefully. Each tunnel is configured under a separate site-to-site peer configuration.
How do I revert or rollback a VPN if something goes wrong?
If you need to revert, you can restore the EdgeRouter X configuration from a backup or carefully undo the changes you made IKE/ESP groups, PSK, tunnel definitions, local/remote prefixes, and firewall rules and re-run commit and save. What type of vpn is hotspot shield and how it works, features, pricing, and alternatives
Are there alternatives to IPsec on EdgeRouter X for site-to-site networking?
IPsec is the standard for site-to-site VPNs on EdgeRouter X. Other options include using OpenVPN or WireGuard, but EdgeRouter X is optimized for IPsec in EdgeOS. If you’re exploring alternatives, consider whether your devices and networks require a different approach or vendor solution.
Conclusion
Edgerouter x site to site vpn setup is a practical, robust way to link two networks over the internet with strong encryption and reliable performance. By planning your IP ranges, selecting solid IKE/ESP configurations, carefully placing firewall rules, and validating the tunnel with real traffic tests, you’ll have a stable, maintainable connection that scales with your network’s needs. Keep monitoring, document your settings, and don’t be afraid to tweak the setup as your topology evolves. If you want extra privacy during remote admin tasks or while tinkering, that NordVPN deal in the intro is a quick option to explore without breaking your workflow.