A site-to-site VPN is an encrypted connection between two or more whole networks, such as a head office and a branch office, over the public internet. A VPN gateway at each site encrypts traffic, sends it through an IPsec tunnel, and the gateway at the other end decrypts it, so devices on both networks can share files, servers and apps as if they were on one local network.
Key takeaways
- A site-to-site VPN connects entire networks through gateways, so individual users need no VPN software on their devices.
- IPsec is the usual protocol: IKE authenticates the gateways and negotiates encryption, then the tunnel carries the traffic.
- It protects data only between sites, so you still need firewall rules, patching and access controls inside each network.
If your company has two offices, a head office and a warehouse, or an office and a cloud network, staff at each site still need the same files, printers and internal apps. A site-to-site VPN gives them that shared access without exposing your internal network to the public internet.
What is a site-to-site VPN?
A site-to-site VPN is a secure connection between two or more entire networks over the public internet. Instead of protecting one device at a time, it links whole local networks, such as a head office and a branch office, so they behave like a single private network.
Each network has a VPN gateway, usually a firewall or a VPN-capable router. The gateways build an encrypted tunnel between them. Traffic from one office enters its gateway, is encrypted, crosses the internet, and is decrypted by the gateway at the other office before it reaches its destination.
Once the tunnel is up, users notice nothing. A worker in one office can open a file server, a database or an internal app in the other office as if it were down the hall. No VPN app is needed on their laptop, phone or printer.
Common uses include linking branch offices to headquarters, connecting an office to a data center, joining an on-premises network to a cloud network, and giving a trusted partner controlled access to part of your network.
How does a site-to-site VPN work?
A site-to-site VPN works in three stages: the gateways authenticate each other, they negotiate encryption settings, and then they encrypt, send and decrypt traffic through a tunnel. The most common protocol suite for this is IPsec.
First, each gateway must prove it is who it claims to be. This uses the Internet Key Exchange (IKE) process, with digital certificates or a pre-shared key, plus Diffie-Hellman key exchange to agree on session keys. Palo Alto Networks describes this as IKE phase 1, which establishes a secure channel and authenticates the peer.
Next, the gateways agree on the details of the tunnel: which encryption algorithm to use, how to check data integrity, and how long the keys last. These settings are stored as IPsec Security Associations at each end. IKE phase 2 then creates the tunnel itself.
When a device sends traffic to the other site, its gateway wraps the original packet inside a new packet. The outer header carries the public IP address of the remote gateway, while the inner packet stays encrypted. At the far end, the remote gateway removes the outer header, decrypts the payload, and forwards the original packet to its destination on the local network.
Traffic only enters the tunnel if your routing rules send it there. In a route-based VPN, the firewall routes traffic to the tunnel based on the destination IP address. In a policy-based VPN, rules based on source, destination and service decide which traffic is tunneled.
What are the types of site-to-site VPN?
The two main types are intranet-based and extranet-based VPNs. The difference is who owns the networks on each side and how much access the other side gets.
Intranet-based site-to-site VPN
An intranet-based VPN connects offices or branches within the same organization. A retail chain might link every store to head office, or a company might link its offices in two cities. All sites belong to one organization, so the tunnel can carry broad internal traffic.
Extranet-based site-to-site VPN
An extranet-based VPN connects separate organizations, such as a company and a supplier, partner or client. Access is deliberately narrow: the partner reaches only the specific systems it needs, such as one ordering portal or one shared folder, and nothing else.
Cloud and hybrid site-to-site VPN
A third common pattern connects an office to a cloud network, or two cloud networks to each other. The cloud side uses a virtual gateway provided by the cloud platform. This is how many hybrid teams extend their office network into AWS, Azure or Google Cloud without a leased line.
Site-to-site VPN vs remote access VPN: what is the difference?
A site-to-site VPN connects networks; a remote access VPN connects one person to a network. That single difference shapes everything else, from setup to who needs software installed.
| Site-to-site VPN | Remote access VPN | |
|---|---|---|
| Connects | Whole networks to each other | One device to a network |
| Software on user devices | None needed | VPN app needed on each device |
| Connection | Always on, between gateways | On demand, when the user connects |
| Best for | Offices, data centers, cloud networks | Remote and hybrid workers |
| Managed by | Network admins at each site | IT team plus each user |
| Typical protocol | IPsec | IPsec, OpenVPN, WireGuard, SSL VPN |
Most larger organizations use both. Site-to-site tunnels link the fixed locations, while remote access VPNs serve staff working from home, on the road or at a client site. If your team is mostly remote, a site-to-site VPN alone will not cover them.
A related option is a point-to-site VPN, which is another name for a remote access VPN: one endpoint, such as a laptop, connects to a site network. Do not confuse it with site-to-site, which has no single-user endpoint at all.
Which protocols do site-to-site VPNs use?
IPsec is the standard protocol suite for site-to-site VPNs. It handles authentication, encryption and integrity checking, and it is supported by almost every business firewall and router.
Within IPsec, two parts matter most. IKE authenticates the gateways and negotiates the security settings. ESP, the Encapsulating Security Payload, encrypts the packet and protects its integrity as it crosses the internet.
Other protocols appear alongside IPsec rather than replacing it. GRE creates a tunnel but does not encrypt anything, so it is usually paired with IPsec. L2TP also needs IPsec for encryption. OpenVPN is used in some flexible or custom setups, especially where standard IPsec is hard to configure through a particular firewall.
NordVPN's guide to site-to-site VPN types and setup covers the same matching problem and the ports IPsec typically needs.
When you choose, match the protocol on both gateways. Both sides must agree on the protocol, the encryption algorithm, the authentication method and the key lifetime, or the tunnel will not come up. That matching is the most common source of setup failures.
What are the benefits of a site-to-site VPN?
The main benefit is simple: your offices work as one network, securely, over the internet you already pay for. Staff share resources without workarounds such as emailing files to themselves or exposing a server to the public internet.
- Encrypted traffic between sites. Data crossing the internet is unreadable to anyone who intercepts it without the keys.
- No software on every device. Printers, servers, cameras and older devices that cannot run a VPN app are protected by the gateway instead.
- Shared resources. File servers, databases, internal apps and backups are reachable from every connected site.
- Cheaper than leased lines. A tunnel over ordinary internet links usually costs far less than a dedicated private circuit between sites.
- Centralized control. Admins can apply consistent routing and firewall rules to traffic between sites.
For a small business with two or three sites, this is often the cheapest way to get a joined-up network. You can start with VPN-capable routers you already own and add redundancy later.
What are the limitations and risks?
A site-to-site VPN only protects data while it travels between gateways. Once traffic is decrypted inside a site, it is only as safe as that site's own network. A weak password, an unpatched server or a compromised device inside one office can still cause harm.
It also does not cover people outside the connected sites. Remote workers, freelancers and staff on mobile data have no gateway to go through, so they need a separate remote access VPN or another secure access method.
Other limits are practical. If the internet link at either site goes down, the tunnel goes down with it. Tunnels across many sites are harder to manage centrally, because each site needs matching configuration. And a tunnel that is too broad can be a risk: if one site is breached, an attacker may be able to reach the other site through the tunnel.
How do you set up a site-to-site VPN?
Setting up a site-to-site VPN is a matching exercise: both gateways need the same protocol, encryption, authentication and subnets. Plan the addressing first, then configure both sides, then test.
- Choose VPN-capable hardware. Pick a firewall or router at each site that supports IPsec site-to-site VPNs and can handle the encryption load without slowing the link.
- Plan your subnets. Give each site a different private subnet, for example 192.168.1.0/24 and 192.168.2.0/24, so routing stays simple and addresses never overlap.
- Get static public IPs. Each gateway needs a stable public address so the other side can always find it.
- Agree the settings. Match the protocol, encryption such as AES-256, integrity algorithm, IKE version and key lifetime on both sides.
- Set up authentication. Use digital certificates where you can. If you use a pre-shared key, make it long, random and unique to this tunnel, and store it securely.
- Define local and remote subnets. Tell each gateway which local network it serves and which remote network lives across the tunnel.
- Open the firewall ports. IPsec typically needs UDP 500 and UDP 4500 open between the gateways, plus the IPsec protocol itself.
- Enable NAT traversal if needed. Turn it on when either gateway sits behind NAT, which is common in smaller offices.
- Test from both sides. Ping a server across the tunnel, check that traffic is encrypted, and confirm that only the intended subnets are reachable.
Before you go live, check the basics from outside the tunnel too. Our what is my IP checker shows the public address your site presents to the internet, which is the address the remote gateway needs.
How do you keep a site-to-site VPN secure?
Getting the tunnel up is only the start. A tunnel that is never patched or reviewed slowly becomes a weak point, because it is a trusted path straight into your network.
- Use strong encryption. AES-256 with IPsec is the usual baseline. Avoid outdated algorithms and short pre-shared keys.
- Patch firmware promptly. VPN gateways are exposed to the internet and are a frequent target, so firmware updates are urgent, not routine.
- Restrict what the tunnel can reach. Use firewall rules on both sides so each site only reaches the services it needs.
- Watch the logs. Alert on repeated authentication failures, unexpected tunnel drops and traffic spikes between sites.
- Review partner tunnels regularly. When a supplier or contractor relationship ends, remove their tunnel and keys the same day.
Also check the services you expose at each site. A tunnel does not fix a misconfigured web server, so run our free SSL checker on any site your offices share.
For the wireless side of each office, review your guide to securing your Wi-Fi. The IPsec setup itself is described in Palo Alto Networks site-to-site VPN documentation.
When should you use a site-to-site VPN?
Use a site-to-site VPN when you have two or more fixed locations that need constant, automatic access to each other. Offices, warehouses, data centers and cloud networks are the classic cases.
It is a weaker fit when your workforce is mostly remote, when you only need occasional access to one app, or when you need fine-grained access per user rather than per network. In those cases, a remote access VPN, a zero-trust network access tool, or a cloud-based secure access service may fit better.
For partner access, weigh the trade-off carefully. An extranet VPN is simple and cheap, but it gives a whole network segment access. If the partner only needs one application, giving them an account on that app with strong authentication may be safer than a tunnel.
The bottom line
A site-to-site VPN joins your locations into one private network over the public internet, with no software needed on individual devices. IPsec and IKE do the heavy lifting: authenticating the gateways, negotiating encryption, and carrying traffic through a tunnel.
Choose the type that matches your relationship, keep the tunnel narrow, patch the gateways, and pair it with remote access for staff outside the offices. You can start by checking what the internet sees of your network with the free DNS lookup tool.
Frequently asked questions
What is a site-to-site VPN in simple terms?
It is a secure link between two or more whole networks. A gateway at each site encrypts traffic and sends it through a tunnel over the internet, so staff at different offices can use shared servers and files as if they were in the same building.
What is the difference between a site-to-site VPN and a remote access VPN?
A site-to-site VPN connects networks to each other through gateways, with no software needed on each device. A remote access VPN connects one person and their device to a central network, usually through an app on that device.
What protocol does a site-to-site VPN use?
Most use IPsec. IKE authenticates the two gateways and negotiates the encryption settings, then IPsec encrypts and authenticates the traffic in the tunnel. Some setups also use OpenVPN, GRE with IPsec, or L2TP with IPsec.
Do users need VPN software for a site-to-site VPN?
No. Once the gateways are connected, any device on either network can reach the other network through its local gateway. That is one of the main advantages for offices with many devices, printers and servers.
Is a site-to-site VPN safe?
It is safe when it is configured well: strong encryption such as AES-256, certificates or strong pre-shared keys, patched firmware, and firewall rules that limit what each site can reach. A weak key, an unpatched gateway or an overly broad tunnel can still be attacked.
What are the disadvantages of a site-to-site VPN?
It does not help remote workers at home, it only protects traffic between gateways, and managing tunnels across many sites can be complex. Internet outages at either site also break the link, so high-availability setups need a backup path.
Can a site-to-site VPN connect to the cloud?
Yes. Many teams connect an office network to a virtual network in AWS, Azure or Google Cloud, or connect two cloud networks to each other. The cloud side runs a virtual VPN gateway instead of a physical firewall or router.
How much does a site-to-site VPN cost?
The cost depends on your hardware, licenses and internet links. Small offices may only need VPN-capable routers they already own, while larger setups pay for firewalls, redundant links and management. It is usually cheaper than leased lines for the same connection.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against Palo Alto Networks VPN documentation and NordVPN and OpenVPN site-to-site VPN guides.
How we write and fact-check →