

Edgerouter x site to site vpn setup: a complete step-by-step guide to configure EdgeRouter X for reliable site-to-site IPsec VPN between two networks with GUI and CLI options
Edgerouter x site to site vpn setup is done by configuring an IPsec tunnel between two EdgeRouter devices. In this guide, you’ll get a clear, practical path to set up a robust site-to-site VPN on EdgeRouter X, with both GUI-first steps and CLI-friendly notes, plus troubleshooting, security tips, and advanced options. Think of this as your one-stop playbook for linking two office networks, a data center, or a remote site securely over the public internet. If you’re juggling multiple sites, you’ll appreciate the step-by-step approach, real-world tips, and common gotchas included here. And if you’re evaluating extra protection during testing or remote access, check out NordVPN’s current deal here: 
Useful resources to reference along the way non-clickable:
- EdgeRouter X official page – ubnt.com/products/edgerouter-x
- EdgeOS documentation – docs.ubnt.com
- IPsec site-to-site VPN overview – en.wikipedia.org/wiki/Virtual_private_network
- VPN protocol comparisons – www.techradar.com/vpn/ips v-openvpn-vs-ipsec
Introduction: what you’ll learn and how this guide is organized Does microsoft have vpn on Windows 11: built-in client, Always On VPN, and third-party options explained
- What is a site-to-site VPN and why EdgeRouter X fits the bill
- How to plan your topology, addresses, and security policies
- A practical, repeatable setup workflow using Graphical User Interface GUI
- A concise CLI reference you can adapt if you prefer command-line setup
- Firewall, NAT, and routing considerations to keep traffic flowing across sites
- Troubleshooting steps and performance optimization tips
- A thorough FAQ with common questions and quick answers
What you’ll need before you start
- Two EdgeRouter X devices with EdgeOS the latest stable firmware is recommended
- Public IP addresses for each site static is easiest. dynamic IPs require a Dynamic DNS setup
- Local networks at each site for example, Site A: 192.168.1.0/24, Site B: 192.168.2.0/24
- A pre-shared key PSK or certificate-based authentication if you’re into PKI
- Basic firewall rules that won’t block VPN traffic on the required ports UDP 500, UDP 4500, and ESP protocol 50, plus standard IPsec requirements
- Administrative access to both EdgeRouter X devices GUI via the EdgeOS portal or CLI
Topology ideas and design considerations
- Classic hub-and-spoke: one central site with multiple spoke sites. The hub handles most of the route translations. spokes only know their local networks and the hub network.
- Fully meshed: each site connects to every other site. This can get complex fast but reduces single points of failure.
- Remote branches with mixed networks: you may need to tailor firewall rules and NAT exemptions so that traffic between specific subnets doesn’t get unnecessarily translated or dropped.
Step-by-step setup: GUI-based approach recommended for most users
Note: The exact menu names can vary slightly by EdgeOS version, but the workflow is the same.
- Prepare the network map and gather required data
- Site A: Public IP example: 203.0.113.10, Local network 192.168.1.0/24
- Site B: Public IP example: 198.51.100.8, Remote network 192.168.2.0/24
- Shared PSK: “YourStrongP@ssw0rd” store securely
- Choose Phase 1 IKE and Phase 2 ESP settings that balance security and compatibility AES-256, SHA-256, Perfect Forward Secrecy with a suitable DH group
- Create the VPN tunnel on Site A GUI
- Log in to EdgeRouter X via the web UI.
- Navigate to VPN or VPN IPsec depending on your firmware.
- Create a new IKE/Phase 1 group: select AES-256 for encryption, SHA-256 for integrity, a reasonable lifetime e.g., 3600 seconds, and a DH group like 14 2048-bit or higher.
- Create a Phase 2 ESP/Phase 2 group: AES-256, SHA-256, PFS enabled or disabled depending on your policy, lifetime around 3600 seconds.
- Define a new IPsec tunnel:
- Local/public endpoint: Site A’s public IP 203.0.113.10
- Remote/public endpoint: Site B’s public IP 198.51.100.8
- Local subnet: 192.168.1.0/24
- Remote subnet: 192.168.2.0/24
- PSK: YourStrongP@ssw0rd
- Enable the tunnel and set it to auto-start.
- Create the VPN tunnel on Site B GUI
- Mirror the exact settings from Site A with roles reversed:
- Local/public endpoint: Site B’s public IP 198.51.100.8
- Remote/public endpoint: Site A’s public IP 203.0.113.10
- Local subnet: 192.168.2.0/24
- Remote subnet: 192.168.1.0/24
- Use the same PSK for authentication
- Enable the tunnel and set to auto-start.
- Configure firewall rules to permit VPN traffic
- Ensure rules allow:
- IPsec ISAKMP UDP 500
- IPsec NAT-T UDP 4500 if NAT is involved
- ESP protocol 50
- Add firewall exceptions for the VPN tunnels and allow traffic from the remote network to your local network and return traffic.
- Add NAT exemptions no double NAT for VPN traffic
- If you’re behind NAT and want direct VPN flow, configure NAT exemption rules so that traffic destined for the remote site’s subnet isn’t NATed on either side.
- In most EdgeRouter setups, you’ll create a rule in the firewall or NAT section to exempt traffic between the two subnets from NAT.
- Verify connectivity and test the tunnel
- Check the VPN status in the GUI: it should show “up” or “connected” on both ends.
- From a host on Site A 192.168.1.0/24, ping a host on Site B 192.168.2.0/24. If ICMP is blocked by firewall, use a diagnostic tool like traceroute or path MTU tests to confirm the path.
- Confirm that routes are correct: the site-to-site tunnel should advertise remote subnets via the VPN interface. You should see a route like 192.168.2.0/24 reachable through the VPN tunnel.
- Optional: enable DNS leakage protection and split tunneling if needed
- If your devices in Site B should reach internal resources by name, ensure DNS resolvers can reach internal DNS servers across the tunnel.
- If you want only specific traffic to go through the VPN, set up policy-based routing to exclude certain internal traffic from the tunnel. For most site-to-site VPNs, you route all traffic destined for the remote site through the tunnel.
- Save, back up, and monitor
- Save the configuration on both EdgeRouter X devices.
- Back up the configuration to a secure location.
- Monitor tunnel health, uptime, and traffic statistics. Set up alerts if possible.
Step-by-step setup: CLI notes alternative to GUI
If you prefer the command line, you’ll be working with EdgeOS’ vpn ipsec commands. The exact syntax may vary slightly by firmware, so consult the official EdgeOS documentation for your version. A typical workflow looks like:
- Define IKE group IKEv1/v2 settings
- Define ESP group Phase 2 settings
- Create an IPsec tunnel with local/remote endpoints and local/remote subnets
- Apply the tunnel and enable auto-start
- Create firewall rules to permit IPsec traffic
- Add NAT exemptions to avoid double-NAT on the VPN path
- Verify tunnel status and traffic flow
Note: For accuracy and safety, use the GUI for most users, and refer to the EdgeRouter X CLI examples in the official docs if you’re comfortable with command-line configuration. What type of vpn is hotspot shield and how it works, security, pricing, and alternatives in 2025
Firewall, NAT, and routing best practices
- Lock down VPN traffic by default and only allow the necessary subnets through the tunnel.
- If you have multiple subnets, consider a route-based VPN design that uses a dedicated VPN interface and static routes toward the remote subnets.
- Ensure your NAT exemption rules are precise to prevent hairpin NAT or partial address translation that could drop traffic.
- Use strong authentication PSK with a long, random string. consider certificate-based authentication for larger deployments.
- Consider enabling Dead Peer Detection DPD to keep the tunnel alive and quickly detect dropouts.
Performance and security considerations
- Expect performance to vary based on CPU, encryption settings, and traffic patterns. EdgeRouter X hardware is capable, but IPsec throughput will depend on how hard the device is constrained by other firewall rules and NAT.
- For remote offices with heavy traffic, you might want to tune the IKE/ESP lifetimes and enable PFS to balance security and performance.
- Regularly update firmware to benefit from security patches and performance improvements.
Common pitfalls and fixes
- Mismatched phase 1/phase 2 settings: AES-256 vs AES-128, SHA-256 vs SHA-1, etc. Ensure both sides use the same proposals.
- Incorrect local/remote subnets: Double-check that each side’s VPN tunnel references the correct local and remote networks.
- PSK mismatch: Re-enter the PSK on both sides. trailing spaces and case sensitivity matter.
- Firewall rules blocking VPN traffic: Verify that UDP 500/4500 and ESP are allowed, both inbound and outbound, for the VPN interfaces.
- Dynamic IPs without DDNS: If you’re using dynamic IPs, set up a Dynamic DNS DDNS service and use the hostname instead of a fixed IP when configuring the opposite end.
Advanced topics you may want to explore
- Dynamic DNS integration: If you don’t have static IPs, DDNS helps keep the tunnel endpoints stable. Use a reliable DDNS provider and update the VPN peer with the hostname.
- Route-based vs policy-based VPN: Route-based VPNs use a virtual VPN interface and are simpler to manage when you have many subnets. Policy-based VPNs are more granular but can be fiddly in complex environments.
- Certificate-based authentication: For larger deployments, consider PKI-based authentication to replace PSKs with certificates for stronger security.
- BGP or static routes: If you have multiple networks across several sites, BGP can help in dynamic route advertisement, but it adds complexity. For smaller setups, static routes are usually enough.
Maintenance and future-proofing Pure vpn edge extension setup guide for Microsoft Edge: features, performance, privacy, and step-by-step install
- Regularly back up EdgeRouter configurations on both ends.
- Document your topology and VPN parameters subnets, PSK, gateway IPs, lifetimes.
- Periodically test failover scenarios and ensure the VPN remains stable after firmware updates.
- Keep an eye on latency and jitter. if you notice degraded VPN performance, revisit the encryption settings and check for bottlenecks elsewhere in your network.
Useful tips to improve reliability
- Use a dedicated management VLAN or management IP for EdgeRouter administration to avoid accidental changes during daily traffic.
- Segment VPN management traffic from user traffic with proper firewall rules.
- Monitor VPN health with simple uptime metrics and alert if the tunnel goes down for a defined period e.g., 5 minutes.
Frequently Asked Questions
What is a site-to-site VPN, and why would I use it with EdgeRouter X?
A site-to-site VPN creates a secure, encrypted tunnel between two or more networks over the public internet, so devices in different locations can talk as if they were on the same LAN. It’s ideal for linking branch offices, data centers, or remote sites using EdgeRouter X with IPsec.
Can I use OpenVPN on EdgeRouter X for site-to-site VPN?
EdgeRouter X is optimized for IPsec-based site-to-site VPNs. While you can run OpenVPN on EdgeRouter, IPsec often provides better performance and stability for site-to-site deployments. If you specifically need OpenVPN, you can implement it for remote access rather than site-to-site in most cases.
Should I use PSK or certificates for authentication?
For small setups, a strong pre-shared key PSK is simple and effective. For larger, more secure deployments, certificate-based authentication PKI offers better security and easier key management. Planet vpn firefox extension
How do I test if the VPN is working?
From a host on Site A, ping a host on Site B and vice versa. Check VPN status in the EdgeRouter UI, and verify that routes to the remote subnet are active. If ping fails, review the tunnel status, firewall rules, and NAT exemptions.
What if the tunnel drops frequently?
Check your internet link for stability, verify DPD settings, ensure both sides have matching IKE/ESP proposals, and confirm PSK/certificates are consistent. Review firewall rules that might intermittently block IPsec traffic.
Can I run multiple VPN tunnels with EdgeRouter X?
Yes. You can create multiple IPsec tunnels to different remote sites, but you’ll need to manage IP addresses, subnets, and firewall rules carefully to avoid conflicts.
How do I handle dynamic public IPs at the remote site?
Use Dynamic DNS DDNS to keep a consistent hostname for the remote gateway. In your VPN configuration, reference the hostname instead of a fixed IP if the platform supports it.
What are the best practices for firewall rules with IPsec?
Allow IPsec traffic UDP 500/4500, ESP. Then create specific rules to permit traffic between the local and remote subnets through the VPN while blocking other flows. Keep rule order in mind — the first match wins. X vpn microsoft edge
How do I back up EdgeRouter X configurations?
In the GUI, go to System or Settings and choose “Backup/Restore.” Save a copy to a secure location. For CLI, use the appropriate export commands in the EdgeOS environment.
How can I optimize VPN performance on EdgeRouter X?
Simplify firewall rules to minimize processing, keep encryption algorithms strong but not excessive for your hardware, and ensure your hardware is not bottlenecked by other processes. Regular firmware updates can also improve performance and reliability.
Are there security considerations I should keep in mind?
Always use a strong PSK or certificate-based authentication, keep firmware updated, limit exposed services on the EdgeRouter, and monitor for unusual VPN activity. Consider enabling logging for VPN events to track failures and successes.
Can I mix different subnet sizes across sites?
Yes, but you must ensure the VPN’s local and remote subnet definitions are precise and don’t overlap. VLANs or subnets with identical ranges across sites can cause routing issues.
What if I need to add a third site later?
Add a new IPsec tunnel to the existing EdgeRouter X on both ends, ensuring the new tunnel uses unique local/remote subnets and proper routing rules. Revisit firewall policies to accommodate the additional path. Edge vpn iphone: the ultimate guide to using Edge VPN on iPhone, setup, features, performance, privacy, and comparisons
Final note
Edgerouter x site to site vpn setup can seem daunting at first, but with a clear topology, consistent settings, and careful firewall and routing planning, you’ll have a solid, reliable site-to-site VPN that keeps your networks connected securely. Start with the GUI approach for clarity, and use the CLI only if you’re comfortable with EdgeOS syntax. Remember to back up configurations and test thoroughly after any change. If you’re shopping for extra security during testing or for remote access scenarios, consider the NordVPN offer linked above to complement your network security strategy.