Site-to-Site VPN
Connect two networks over the public internet with encrypted IPsec or WireGuard tunnels.
A site-to-site virtual private network (VPN) connects two private networks through an encrypted tunnel across an untrusted network such as the public internet. A gateway at each site encrypts traffic before it leaves that network and decrypts it at the other end. Hosts can then communicate using private addresses, subject to the routes and firewall policies at both sites.
Picture it: Think of two offices connected by a guarded bridge. The tunnel protects the trip; routes decide who may cross, and firewalls decide which doors are open at each end.
The pieces of a tunnel
Each endpoint needs a reachable gateway, a peer identity, compatible encryption settings, and a shared understanding of which traffic should use the tunnel. IPsec is widely supported by network appliances and cloud gateways. WireGuard is a simpler modern option supported by many platforms. They differ in how they establish peers and manage keys, so endpoints must use compatible configurations.
The tunnel does not replace routing. Each side needs routes for the remote network, and those address ranges must not conflict with local networks. Firewalls must permit the intended traffic, while denying access that the connection does not require. For dynamic environments, BGP can exchange routes and support failover; smaller designs may use carefully maintained static routes.
Plan before deployment
- List the networks. Record local and remote address ranges, gateways, and the services that need to communicate. Resolve overlapping address ranges before building the connection.
- Choose the tunnel endpoints. Decide whether the VPN terminates on firewalls, dedicated gateways, or cloud network services, and confirm the endpoints can reach each other.
- Agree on policy. Select supported cryptographic settings, peer authentication, key rotation, and the allowed traffic in both directions. Use each platform’s current security guidance rather than copying old defaults.
- Configure routing and filtering. Add only the necessary remote routes and firewall rules. A tunnel being up does not mean every host should be able to reach every other host.
- Test and monitor. Verify gateway status, route selection, name resolution, and application connectivity from both sites. Monitor tunnel health, logs, and traffic; test a planned failover before relying on it.
Reliability and security
Redundant tunnels and gateways can reduce outages, but they require tested route priorities and failover behavior. Monitor both tunnel establishment and the applications that depend on the tunnel. Keep gateway software updated, protect private keys, review access rules regularly, and remove unused peers and routes.
Site-to-site VPNs are a common way to connect an office network to a cloud virtual network. They provide protected transport between gateways; application authentication, endpoint security, and least-privilege network policy are still needed at each end.
Trusted references
- RFC 4301: Security Architecture for the Internet Protocol defines the IPsec security architecture.
- WireGuard Quick Start is the project’s official configuration guide.
- RFC 4271: Border Gateway Protocol 4 specifies BGP, which some site-to-site designs use to exchange routes.