A site-to-site VPN is an encrypted connection between two or more whole networks, such as a head office and a branch office, so devices on each network can communicate as if they were on the same local network. A VPN gateway at each site builds the tunnel, and no one at either site needs to open a VPN app.

Photo: Foreign, Commonwealth & Development Office, via Wikimedia Commons (CC BY 4.0). A site-to-site VPN links offices in different places into one private network.
What Is a Site-to-Site VPN?
A site-to-site VPN, often shortened to S2S VPN, connects entire networks to each other over the public internet. Instead of one person connecting a laptop to a company network, the connection joins two networks: the office in one city and the office, data center, or cloud network in another. Once the tunnel is up, a computer in the branch office can reach a file server at headquarters exactly as if both were plugged into the same switch.
It is one of the types of VPN in our overview. The key difference from the VPN most people know is who connects. A remote access VPN connects one user and one device at a time, and the user has to start the connection. A site-to-site VPN connects networks, and it runs all the time in the background. Nobody logs in, and nobody has to remember to switch it on. The connection is handled by the VPN gateway at each site, usually a router or firewall with VPN capability.
Site-to-site VPNs are also called network-to-network or router-to-router VPNs, because the tunnel runs between the two sites’ gateways rather than between individual devices. If you are new to the underlying idea, our guide to how does a VPN work explains tunnels, encryption, and authentication first.
How Does a Site-to-Site VPN Work?
Every site-to-site VPN follows the same basic sequence, whatever the hardware brand.
- Gateways are placed at each site. Each location needs a device that can run a VPN: a business router, a next-generation firewall, or a virtual gateway in the cloud. The gateway is the front door of its network.
- The gateways authenticate each other. Before any data flows, each side proves it is who it claims to be, using a pre-shared key or a digital certificate. This step blocks an impostor gateway from joining the tunnel.
- The tunnel is negotiated. The gateways agree on the encryption algorithm, the integrity check, and how long the keys last. This negotiation is handled by IKE, the Internet Key Exchange protocol, which is part of the IPsec suite.
- Traffic is selected by policy. The administrator defines which traffic enters the tunnel, usually by destination subnet. Traffic for the other office goes through the VPN; traffic for the public internet goes out directly.
- Packets are encrypted and wrapped. The gateway encrypts each packet and wraps it in a new outer packet addressed to the other gateway. Anyone capturing the traffic in transit sees only scrambled data.
- The far gateway unwraps and delivers. The receiving gateway strips the outer header, decrypts the packet, and forwards it to the destination device on its local network. Replies travel back through the same tunnel.
The tunnel stays up around the clock. If the connection drops, the gateways renegotiate it automatically, and users at either site usually notice nothing at all.
Types of Site-to-Site VPNs
Site-to-site VPNs fall into two groups, depending on who owns the networks on each side.
Intranet Site-to-Site VPN
An intranet VPN connects locations inside the same organisation: headquarters and branch offices, a head office and a warehouse, or an office and a company data center. All the sites belong to one company, so one IT team controls both ends of every tunnel, and the same security policy applies everywhere.
Extranet Site-to-Site VPN
An extranet VPN connects networks belonging to different organisations, such as a company and a supplier, a partner, or a contractor. Each side keeps control of its own network, and the tunnel is restricted to the specific systems the partner is allowed to reach. The access is narrower by design: the partner sees the shared application, not the whole company network.
Internet-Based vs MPLS VPNs
An internet-based site-to-site VPN runs over the public internet with encryption, which makes it the most common and cheapest option. The company pays only for its internet connections and the gateway hardware. An MPLS VPN runs over a carrier’s private network instead. The carrier builds virtual connections between the company’s sites across its own infrastructure. MPLS usually gives more predictable performance and lower latency, which matters for voice and video calls, but it costs more and takes longer to set up, because the carrier provisions each link.
Hub-and-Spoke vs Mesh Layouts
In a hub-and-spoke layout, every branch connects to headquarters, and branch-to-branch traffic passes through the hub. This is simple to manage, and it suits companies where most traffic goes to the central office anyway. In a mesh layout, sites connect directly to each other, which gives better performance between branches but means far more tunnels to manage as sites are added. Each new site in a full mesh needs a tunnel to every existing site, so the count grows quickly. For the mesh approach built on modern software rather than tunnels, see our guide to mesh VPN.
Site-to-Site VPN Protocols
IPsec is the standard protocol suite for site-to-site VPNs, and it is the one most gateways support. IPsec handles both the authentication and the encryption, and IKEv2 is the current version of the key exchange protocol: it is faster to reconnect than the older IKEv1 and copes better when a network address changes. IPsec is defined by the IETF in RFC 4301, and IKEv2 is defined in RFC 7296.
Other protocols appear in specific setups. OpenVPN can link two sites, and it is a practical choice when both gateways run software that supports it. WireGuard is increasingly used for the same job because its configuration is short, though it is newer in this role. Our guide to IPsec VPN explains the protocol suite in detail, and our VPN protocols comparison covers the alternatives side by side.
Site-to-Site VPN vs Remote Access VPN
The two designs solve different problems, and most companies use both.
| Site-to-Site VPN | Remote Access VPN | |
|---|---|---|
| Connects | Whole networks | One user and device |
| Started by | Gateways, automatically | The user, manually |
| Always on | Yes | Only while connected |
| User software | None needed | VPN client on the device |
| Best for | Offices, data centers, cloud | People working from home or travelling |
A remote access VPN gives a person a way into the office network. A site-to-site VPN gives the office itself a way to the other office. The gateway plays the server role in the tunnel; our guide to VPN client vs VPN server explains the two sides. A company with two offices and a remote team needs both: the site-to-site tunnel for the offices, and remote access for the people.
The related point-to-site design is different again: it connects individual devices to a cloud network, which is the model used by the cloud gateways described in our VPN gateway guide. If a single employee needs to reach a company network, that is remote access. If a whole branch office needs to reach it, that is site-to-site.
How to Set Up a Site-to-Site VPN
The exact menus differ by vendor, but the setup follows the same steps on every platform.
- Plan the networks. List the subnets at each site and make sure they do not overlap. Two sites using the same address range cannot route to each other, and fixing that after the tunnel is built is painful.
- Choose the gateways. Pick a router, firewall, or cloud gateway at each site that supports IPsec with IKEv2. Confirm both sides support the same encryption and authentication options.
- Configure matching settings on both ends. Create the tunnel on each gateway with the same pre-shared key or certificates, the same encryption algorithm, and the same key lifetimes. The two sides must agree exactly, or the tunnel will not come up.
- Add the routing rules. Tell each gateway which destination subnets go through the tunnel. Traffic for the other site enters the VPN; everything else uses the normal internet route.
- Open the firewall. Allow the VPN traffic through each site’s firewall, and check NAT settings where the gateway sits behind another device.
- Bring the tunnel up and verify. Check that the tunnel is established, then test traffic in both directions: a file share, an internal application, and a printer at the far site. Confirm failover behaviour if a second tunnel or a backup link exists.
- Monitor it. Watch tunnel status, logs, and route tables after go-live. The most common faults are mismatched settings after a firmware update, expired certificates, and a changed public IP address at one site.

Photo: U.S. Navy photo by Photographer’s Mate Airman Jason D. Landon, via Wikimedia Commons (public domain).
Site-to-Site VPNs in the Cloud
Cloud networks use the same idea. In Azure, a VPN gateway sends encrypted traffic between an Azure virtual network and an on-premises location over the public internet, using a site-to-site IPsec/IKE tunnel. The same gateway can also link two Azure virtual networks. Microsoft’s own documentation lists site-to-site as the connection for dev, test, lab, and small to medium production workloads, and notes that a gateway’s tunnels share its available bandwidth.
The cloud version has the same planning rules as the office version: non-overlapping address ranges, matching IPsec settings, and a gateway sized for the traffic it will carry. On Azure, the Basic gateway SKU supports up to 100 Mbps of aggregate throughput, while the largest zone-redundant SKU reaches 10 Gbps. If a deployment needs more than 100 site-to-site tunnels, Microsoft points to Virtual WAN instead of a single gateway.
Benefits and Limitations
The main benefit is cost. A site-to-site VPN uses internet connections the company already pays for, instead of leased lines between offices. It is also flexible: a new site needs only an internet connection and a gateway, not a circuit ordered from a carrier. Staff at both sites work as if they share one network, with the same file servers, printers, and internal applications.
The limits are real too. The public internet does not guarantee latency or bandwidth, so a tunnel can be slower or less steady than a private line, especially at busy times. Every new site adds tunnels to configure and monitor, so the design gets harder to manage as the company grows. And the tunnel is only as secure as the gateways at each end: a weak pre-shared key, an expired certificate, or an unpatched firewall undermines the encryption entirely. For those reasons, some companies now keep site-to-site VPNs for office-to-office links while moving user access to ZTNA / SASE, which gives each user access to specific applications instead of the whole network.

Photo: ProjectManhattan, via Wikimedia Commons (CC BY-SA 3.0). The gateway at each site encrypts traffic before it leaves the building.
When to Use a Site-to-Site VPN
A site-to-site VPN is the right choice when two or more fixed locations need to share resources all day, every day: branch offices reaching the head office file server, a warehouse reaching the stock system, or an office reaching a cloud network. It also works well as a backup path. If a private link fails, a site-to-site VPN over the internet can keep the sites connected until the main link is repaired.
It is the wrong choice when the need is really about people, not places. A single household with the same need can build a smaller version of the same idea as a self-hosted VPN. If the users are scattered and the applications live in the cloud, a remote access VPN or a ZTNA service fits better. It is also a poor fit for a single person working from home: that is what a remote access VPN is for, and running a site-to-site tunnel for one laptop adds cost and complexity for nothing.
Watch: How to Create a Site to Site Network with Access Server
OpenVPN shows how to set up a site-to-site network with Access Server, so devices in one network can reach devices in another physical network through the VPN.
“How to Create a Site to Site Network with Access Server (3.x)” by OpenVPN
FAQs
What is a site-to-site VPN in simple terms?
It is an encrypted link between two whole networks, so the offices at each end behave like one network. A gateway at each site builds and maintains the tunnel, and nobody at either site needs to log in.
What is the difference between a site-to-site VPN and a remote access VPN?
A site-to-site VPN connects networks to networks automatically and permanently. A remote access VPN connects one user and one device to a network, and the user starts the connection. Companies usually run both.
Which protocol is used for site-to-site VPNs?
IPsec with IKEv2 is the standard choice, because almost every business gateway supports it. OpenVPN and WireGuard are also used where both ends support them.
Is a site-to-site VPN secure?
Yes, when it is configured properly. Traffic is encrypted with IPsec, and the gateways authenticate each other before the tunnel opens. Security depends on strong keys or certificates, matching settings, and keeping the gateway software patched.
Can a site-to-site VPN connect to the cloud?
Yes. Cloud providers offer managed VPN gateways that terminate a site-to-site tunnel between an on-premises network and a cloud virtual network. Azure VPN Gateway and the equivalent AWS Site-to-Site VPN service both work this way.
Do I need a static IP address for a site-to-site VPN?
A fixed public IP address at each site makes the setup simpler and more reliable, because each gateway needs to find the other. Some gateways support dynamic addresses with dynamic DNS, but a static address avoids the tunnel breaking when an address changes.
Sources
8
- Palo Alto Networks. “What Is a Site-to-Site VPN?” https://www.paloaltonetworks.com/cyberpedia/what-is-a-site-to-site-vpn
- OpenVPN. “Site-to-Site VPNs: Types, Setup, Protocols, and When to Use Them.” https://blog.openvpn.net/site-to-site-vpns-types-setup-protocols-and-when-to-use-them
- Microsoft Learn. “About Azure VPN Gateway.” https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-about-vpngateways
- NIST. “SP 800-77, Guide to IPsec VPNs.” https://csrc.nist.gov/pubs/sp/800/77/final
- IETF. “RFC 4301: Security Architecture for the Internet Protocol.” https://www.rfc-editor.org/rfc/rfc4301
- IETF. “RFC 7296: Internet Key Exchange Protocol Version 2 (IKEv2).” https://www.rfc-editor.org/rfc/rfc7296
- NordLayer. “What Is a Site-to-Site VPN and How Does It Work?” https://nordlayer.com/blog/what-is-site-to-site-vpn/
- Surfshark. “What is a site-to-site VPN and how it works.” https://surfshark.com/blog/site-to-site-vpn
Every factual claim on this page was verified against a named source above.



