

Yes, Ubiquiti EdgeRouter supports site-to-site VPN configurations. In this guide, you’ll find a practical, step-by-step approach to configuring a site-to-site IPsec VPN between an EdgeRouter and a remote gateway, along with troubleshooting tips, performance considerations, and real-world best practices. Whether you’re linking two office sites, a data center to a remote location, or a home lab to a remote hub, this guide covers what you need to know to get reliable, encrypted traffic flowing.
If you’re curious about extra privacy for occasional lab traffic or remote testing, you can pair your site-to-site VPN with a consumer VPN service. NordVPN often runs promotions, and you can grab a substantial discount through this offer:
It’s not a replacement for a properly configured site-to-site tunnel, but for certain lab scenarios it can be a helpful complement. For more background, here are some useful resources you can check out non-clickable links listed as plain text:
Useful URLs and Resources:
– Ubiquiti EdgeRouter Documentation – help.ui.com
– IPsec Overview – en.wikipedia.org/wiki/IPsec
– EdgeRouter Community Forum – community.ui.com
– Small Business VPN Adoption – www.statista.com
– VPN Market Forecast – www.grandviewresearch.com
What is a site-to-site VPN on Ubiquiti EdgeRouter?
A site-to-site VPN creates a secure tunnel between two networks over the public Internet, allowing devices on one network to reach devices on the other as if they were on the same private network. On an EdgeRouter, this is typically done with IPsec IKEv1 or IKEv2 tunnels that encrypt traffic between defined subnets. Some key points to remember:
- It’s router-to-router, not user-to-network. Remote sites don’t need to log in individually. the gateways authenticate each other and route traffic.
- IPsec tunnels can be policy-based or route-based depending on the EdgeOS version and how you set up your policies. Most standard site-to-site setups on EdgeRouter rely on static routes that steer traffic through the tunnel.
- You can run multiple tunnels to multiple remote sites from a single EdgeRouter, depending on model performance and CPU capacity.
Real-world use cases include connecting branch offices to a central data center, linking disaster recovery sites, or creating a secure link for warehouse networks, retail locations, or remote development labs. For best results, plan out your subnets carefully to avoid overlaps, and map out which remote networks should be reachable via the VPN.
Prerequisites and planning
Before you start, gather and verify a few details. Having this information ready will speed up the setup and reduce back-and-forth debugging.
- EdgeRouter model and firmware version EdgeOS 2.x is common. newer firmware generally means better IPsec support and stability.
- Local network LAN subnet on the EdgeRouter and the remote network subnet at the other site.
- Remote gateway public IP or FQDN if you’re behind a dynamic IP, plan for dynamic DNS.
- Authentication method: pre-shared key PSK or certificate-based. PSKs are common for quick setups. certificates are more scalable for larger deployments.
- Encryption and hashing preferences: AES-GCM 256, AES-CBC 256, SHA-256, etc. If you’re limited by device capabilities, pick solid defaults like AES-256 with SHA-256.
- DH group and IKE version: IKEv2 is generally more reliable and faster than IKEv1, if supported by both sides.
- NAT traversal needs: if you’re behind NAT on either side, enable NAT-T.
Security suggestions:
- Prefer certificate-based authentication for larger or more dynamic environments. PSK is fine for smaller, static setups.
- Use PFS Perfect Forward Secrecy with a reasonable DH group for forward secrecy.
- Enable dead peer detection and regular re-keying to keep tunnels healthy.
Step-by-step setup guide EdgeRouter UI and CLI options
This section walks you through a typical site-to-site IPsec VPN setup between an EdgeRouter and a remote gateway. I’ll outline the UI approach first, then a compact CLI example for quick reference. Edge client vpn
Note: The exact menu labels can vary slightly by EdgeOS version, but the flow is similar: create an IPsec tunnel, define local/remote endpoints, set phase 1 IKE and phase 2 IPsec proposals, configure firewall rules, and add static routes.
- Create IKE IKEv1/v2 proposal and a tunnel
- Choose a strong encryption and hash combo for example, AES-256, SHA-256, and a suitable DH group such as Group 14 or Group 21 if supported.
- Decide on IKE version IKEv2 is preferred when supported on both sides because it handles NAT-T and rekeying more efficiently.
- Define the remote peer
- Local gateway: your EdgeRouter’s public IP or hostname if using dynamic DNS.
- Remote gateway: the public IP of the remote gateway the other site.
- Set a pre-shared key or certificate
- For PSK: pick a strong, random key and store it securely in both sides.
- For certificates: ensure the CA is trusted on both sides and that each peer has a valid certificate.
- Create the IPsec tunnel
- EdgeRouter creates one or more tunnels that tie the local networks to the remote networks.
- Map the local and remote subnet pairs for the tunnel e.g., 192.168.1.0/24 <-> 10.10.1.0/24.
- Add firewall rules to permit IPsec traffic
- Allow UDP ports 500 IKE and 4500 NAT-T as needed.
- Permit IPsec ESP traffic protocol 50 if your firewall rules are stateful and precise.
- If you’re using NAT, make sure NAT exemptions exist for your VPN traffic so VPN traffic is not NAT-translated.
- Configure static routes and traffic selectors
- Add routes so that traffic destined for the remote subnet goes through the tunnel.
- If you have multiple subnets on either side, configure additional tunnel instances or route rules as needed.
- Bring the tunnel up and test
- Verify tunnel status: you should see a tunnel state of up or connected.
- Test connectivity by pinging hosts on the remote network, or by tracerouting to verify traffic flows through the tunnel.
If you prefer a quick reference, here’s a compact CLI-style example adjust values to your environment:
Example pseudo-CLI:
- set vpn ipsec ike-group IKE-GROUP proposal 1 encryption aes256
- set vpn ipsec ike-group IKE-GROUP proposal 1 hash sha256
- set vpn ipsec ike-group IKE-GROUP proposal 1 dh-group modp2048
- set vpn ipsec site-to-site peer REMOTE-WAN-IP authentication mode pre-shared-key
- set vpn ipsec site-to-site peer REMOTE-WAN-IP authentication pre-shared-key ‘YourStrongPSK’
- set vpn ipsec site-to-site peer REMOTE-WAN-IP ike-group IKE-GROUP
- set vpn ipsec site-to-site peer REMOTE-WAN-IP tunnel 1 local-subnet 192.168.1.0/24
- set vpn ipsec site-to-site peer REMOTE-WAN-IP tunnel 1 remote-subnet 10.10.1.0/24
- set firewall name VPN-LOCAL-TO-REMOTE rule 10 action accept
- set firewall name VPN-REMOTE-TO-LOCAL rule 10 action accept
- set interfaces tunnel tun0 family inet address 172.16.0.1/30
- commit and save
For detailed UI steps, navigate to:
- VPN > IPsec > Add VPN Peer
- Enter remote gateway, local/remote subnets, and authentication method
- Save, then apply and test
Performance tips: J edgar review of the best VPNs for privacy, security, and streaming in 2025
- Use AES-GCM if possible. it often delivers better throughput than AES-CBC with the same key length.
- Enable PFS Diffe-Hellman with an appropriate group to improve security without introducing excessive CPU load.
- Keep the tunnel configuration tight: avoid overly broad remote subnets and unneeded tunnels that force extra CPU usage.
- If you’re hitting throughput ceilings, consider upgrading to a higher-end EdgeRouter model or offloading VPN tasks to a dedicated device for extremely busy sites.
Common pitfalls to watch out for:
- Overlapping subnets between local and remote networks. This will break routing and cause traffic to fall back or fail.
- Mismatched IKE versions or encryption suites. Ensure both sides agree on the same algorithm sets.
- NAT misconfigurations. If you’re behind NAT, NAT-T must be enabled and port 4500 allowed.
- Dynamic IP changes. If the remote gateway’s IP can change, you need a Dynamic DNS setup on both ends or configure a resilient failover mechanism.
Monitoring and troubleshooting basics:
- Check tunnel status in EdgeRouter UI or via CLI: you’re looking for “up” or “established.”
- Look at IPsec SA counters and error logs. Flags like “no proposal chosen” or “authentication failed” indicate mismatches.
- Verify that traffic to the remote subnet is routed through the tunnel and not through the WAN interface.
- Ensure the firewall rules don’t inadvertently block inbound or outbound VPN traffic.
Advanced optimization ideas:
- Use route-based tunnels if your EdgeRouter and the remote gateway both support them. route-based VPNs can simplify multi-subnet configurations.
- For multi-site deployments, assign each tunnel its own routing policy to minimize cross-effects between tunnels.
- Schedule regular rekey intervals and ensure redundant tunnels exist so a single tunnel failure doesn’t cut off an entire site.
Use cases and real-world scenarios
- Branch-to-branch connectivity: A corporate office and a smaller branch connect to share applications, printers, and file services over a secure path.
- Data-center to remote site: A secure, private link to backhaul critical services while still harnessing public Internet bandwidth.
- Lab-to-production environment: Isolated test networks can be bridged securely to production networks for demos or integration testing.
If you’re tying EdgeRouter into a larger network with a consumer VPN as an extra layer of privacy for specific traffic, remember that the primary VPN tunnel should always be the site-to-site IPsec connection. The consumer VPN should be treated as an optional, separate layer rather than a replacement for proper site-to-site security.
Security considerations and best practices
- Prefer certificate-based authentication for scalable deployments. PSKs are fine for small setups but can become cumbersome to manage as you scale.
- Enable perfect forward secrecy PFS with an appropriate DH group to protect session keys even if a gateway is compromised later.
- Use strong encryption and hash algorithms. AES-256 with SHA-256 is a solid baseline.
- Regularly rotate credentials and keys, and monitor tunnel health logs for unusual activity.
- Keep EdgeRouter firmware up to date to benefit from security and stability improvements.
Frequently asked questions
Can Ubiquiti EdgeRouter handle IPsec site-to-site VPN for multiple sites?
Yes. You can configure multiple IPsec tunnels from a single EdgeRouter to connect to several remote sites. Each tunnel typically maps to a distinct pair of local/remote subnets, and you’ll adjust routing accordingly to ensure traffic flows through the intended tunnel. Change vpn edge: how to switch and configure a VPN in Microsoft Edge with extensions, OS-level VPNs, and best practices
Which EdgeRouter models are best for site-to-site VPN?
Most EdgeRouter models support IPsec VPNs, but performance scales with CPU and memory. If you’re running multiple tunnels or higher throughput needs, consider a mid- to high-range model with more CPU power and memory to keep tunnel processing smooth.
Is IKEv2 always better than IKEv1 for EdgeRouter VPNs?
IKEv2 generally offers faster rekeying, better stability behind NAT, and simpler configuration when both sides support it. If your remote gateway supports IKEv2, use it. If not, IKEv1 remains a solid option with careful configuration.
Can I use dynamic DNS with EdgeRouter for a VPN?
Yes. If either gateway has a dynamic public IP, set up dynamic DNS on the EdgeRouter and your remote gateway so the IPs can be resolved even if they change.
How do I test my site-to-site VPN after setup?
Ping devices on the remote network from a device on your local network, or use traceroute to confirm the path goes through the VPN tunnel. Check IPsec status for tunnel health and review logs for any negotiation errors.
What’s the difference between a policy-based and route-based VPN on EdgeRouter?
Policy-based VPNs tie VPN traffic to specific subnets or policies, while route-based VPNs rely on tunnel interfaces and routing rules. EdgeRouter’s IPsec can support both approaches depending on the version and the configuration you apply. Edge vpn location
Can I connect to devices across different subnets at each site?
Yes. You’ll configure the tunnel to carry traffic between the two subnets for example, 192.168.1.0/24 at Site A and 10.0.1.0/24 at Site B, and ensure routing is set so traffic destined for the remote subnet is sent through the tunnel.
How secure is IPsec for site-to-site VPNs on EdgeRouter?
IPsec provides strong encryption, authentication, and integrity checks. Using modern ciphers AES-256, SHA-256 and enabling PFS improves security. Regular firmware updates and credential rotation further strengthen protection.
Can I use WireGuard on EdgeRouter for site-to-site VPN?
As of 2025, WireGuard isn’t natively supported for site-to-site VPN on EdgeRouter in the same seamless way IPsec is. Some users experiment with community builds or alternative devices for WireGuard, but for a mainstream EdgeRouter site-to-site VPN, IPsec remains the standard.
What should I do if the VPN tunnel won’t come up?
First, verify the shared PSK or certificate setup matches on both ends. Check IKE phase settings encryption/hash/DH group, verify public IPs, confirm firewall rules allow IKE UDP 500 and NAT-T UDP 4500, and ensure local/remote subnets don’t overlap. Look at VPN logs and IPsec SA counters for error codes and messages.
How can I optimize VPN performance without buying new hardware?
- Use AES-GCM 256 if supported. it often yields better throughput.
- Minimize additional routing rules that could slow down lookups.
- Ensure you’re not forcing unnecessary encryption on traffic that doesn’t need it avoid global encryption of all traffic unless required.
- Consider upgrading firmware and ensuring your remote site’s hardware is capable of handling IPsec at the desired rate.
Quick recap
- Ubiquiti EdgeRouter supports site-to-site VPN using IPsec, with IKEv1 or IKEv2 as applicable.
- Plan your subnets, authentication method, and encryption settings before you start.
- Use robust credentials, enable NAT-T when needed, and carefully configure firewall rules to protect the VPN.
- Test thoroughly, monitor regularly, and plan for scalability if you’re connecting multiple sites.
- For extended privacy scenarios, you can pair VPN activity with consumer VPN services, but keep the primary site-to-site tunnel as the main path for inter-site traffic.
If you’re building a small-to-medium network with two or more sites, this approach should give you a solid, reliable VPN backbone. If you want to explore more advanced topologies or multi-site architectures, I’ve got you covered with deeper dives and real-world examples in future posts. And if you’re evaluating a broader VPN strategy for a business, don’t forget to combine this with best-practice network security hygiene and regular audits. Does microsoft edge have a firewall and how to protect your browsing with Windows Defender Firewall and VPNs