VPN gateway

On this page 7

A VPN gateway is a managed network endpoint that connects a cloud virtual network to on-premises data centers, branch offices or remote users through encrypted tunnels over the public internet. In Cloud networking, it is the most common way to extend a VPC privately to existing infrastructure without leasing a dedicated physical circuit.

Cloud providers offer VPN gateways as fully managed services: the provider runs redundant tunnel endpoints, while the customer configures peer addresses, routing and encryption parameters. The gateway typically uses IPsec with IKEv2 for site-to-site links and TLS or IPsec for point-to-site client access.

How a VPN gateway builds encrypted tunnels

A VPN gateway establishes IPsec security associations with a peer device, usually a firewall or router at the customer site, and then encapsulates traffic between the two networks inside encrypted packets. The negotiation runs in two phases: IKE phase 1 authenticates the peers and creates a protected control channel, and IKE phase 2 creates the child security associations that carry user data.

Each packet leaving the virtual network is encrypted, given a new outer header addressed to the peer’s public IP address, and sent across the internet. The receiving side decrypts it and forwards the inner packet to its local destination. Because of this encapsulation, both networks behave as if joined by a private link, although the transport is shared.

The table below lists the main parameters that both ends of a site-to-site tunnel must agree on.

ParameterTypical valuesWhat it affects
IKE versionIKEv2 preferred, IKEv1 for legacy peersNegotiation reliability and features
Encryption algorithmAES-256-GCM, AES-128-GCMConfidentiality and throughput
Integrity algorithmSHA-256 or SHA-384Tamper detection
Diffie-Hellman groupGroup 14, 19, 20 or 21Strength of key exchange
AuthenticationPre-shared key or certificatePeer identity assurance
SA lifetimeAbout 1 to 8 hoursFrequency of rekeying
Key tunnel parameters

A mismatch in any of these parameters is the most frequent reason a tunnel fails to come up. Providers publish supported combinations, and the on-premises device must be configured to match them exactly.

Site-to-site, point-to-site and routing options

VPN gateways support two main connection types: site-to-site, which links entire networks, and point-to-site or client VPN, which connects individual devices. They also differ in how routes are exchanged, either through static routes or through dynamic routing with BGP.

The following table compares the connection and routing variants and when each applies.

VariantConnectsBest suited for
Site-to-site, staticNetwork to network with fixed prefixesSmall sites with stable address ranges
Site-to-site, BGPNetwork to network with dynamic routesMultiple sites and automatic failover
Point-to-siteSingle device to virtual networkRemote administrators and developers
Policy-basedTraffic matched by selectorsLegacy firewalls that require it
Route-basedTraffic routed into a tunnel interfaceMost modern cloud deployments
VPN gateway variants

Route-based tunnels with BGP are the recommended default for production, because routes update automatically when prefixes change and traffic shifts to a surviving tunnel when one fails. Providers generally assign each tunnel a link-local inside address range for the BGP session.

VPN gateway compared with other cloud connectivity

A VPN gateway is the fastest and cheapest hybrid connectivity option, but it is not the only one. Dedicated private circuits, often called Cloud interconnect, and hub services such as a Transit gateway solve related problems with different trade-offs.

The comparison below places the VPN gateway beside its closest neighbors in cloud networking.

OptionTransportTypical bandwidthMain trade-off
VPN gatewayEncrypted tunnels over the internetAbout 1.25 Gbps per tunnelVariable latency, quick to deploy
Cloud interconnectDedicated physical circuit1 to 100 GbpsPredictable performance, weeks to provision
VPC peeringProvider backboneNot limited by a gatewayLinks cloud networks only, no transit
Transit gatewayProvider backbone hubHigh aggregate capacityCentral routing, separate hourly and data charges
Hybrid and inter-network connectivity options

Many enterprises combine options: a dedicated circuit as the primary path and a VPN gateway as an encrypted backup. Some also run IPsec over the dedicated circuit when regulations require encryption on every link.

Designing a resilient VPN gateway deployment

A resilient design removes every single point of failure: two tunnels per connection, two customer devices where possible, and dynamic routing that detects failure within seconds. Most providers already place their side of the tunnels in separate zones, so the weakest link is usually the on-premises end.

The decision table below matches common requirements with a suitable design choice.

RequirementRecommended designReason
High availabilityActive-active tunnels with BGPTraffic continues if one tunnel drops
Throughput above one tunnelEqual-cost multipath across tunnelsAggregates bandwidth of several tunnels
Many VPCs to connectTerminate VPN on a transit hubAvoids one gateway per VPC
Remote workforce accessPoint-to-site with identity providerPer-user authentication and revocation
Overlapping address rangesRenumber or apply NATRouting cannot resolve duplicate prefixes
Design decisions for VPN gateways

Address planning deserves attention before deployment. Overlapping CIDR ranges between the cloud and on-premises networks are a common blocker, and fixing them after systems are live is far more expensive than reserving distinct ranges at the start.

Limitations and frequent mistakes

The main limitation of a VPN gateway is that it rides on the public internet, so latency and jitter vary with conditions outside the provider’s control. Per-tunnel throughput caps and encryption overhead also make it unsuitable for sustained multi-gigabit replication.

  • MTU and MSS issues: encapsulation adds overhead, so packets near 1,500 bytes may fragment or drop unless the MSS is clamped to about 1,350 to 1,380 bytes.
  • Single tunnel configured: many outages occur because only one of the two provided tunnels was set up on the customer device.
  • Weak cryptography: keeping IKEv1 or old Diffie-Hellman groups for convenience weakens the whole link.
  • Missing route propagation: the tunnel is up, but subnet route tables do not point traffic toward the gateway.
  • Firewall rules forgotten: Security group and network ACL rules must still allow the on-premises prefixes.

Monitoring should cover tunnel state, BGP session state and bytes transferred, with alerts on any tunnel that stays down. A tunnel that silently fails leaves the connection running without redundancy until the second tunnel also fails.

A plain-language summary

A VPN gateway is a secure doorway between a company’s network in the cloud and its offices or employees elsewhere. Data travels over the ordinary internet, but it is locked inside an encrypted envelope that only the two ends can open.

It is a bit like sending valuables through the regular postal service inside a sealed, tamper-proof box. The roads are public, but nobody along the way can see or change what is inside. The key benefit is a private connection without building a private road.

An example from practice

A regional insurance company moves its claims application to a cloud VPC but keeps its document archive in its own data center. The network team needs a private link within two weeks, far faster than a dedicated circuit could be ordered.

The team deploys a managed VPN gateway and configures two route-based IPsec tunnels with BGP to a pair of on-premises firewalls, using AES-256-GCM, SHA-256 and Diffie-Hellman group 20. They clamp the TCP MSS to 1,360 bytes and set alerts on tunnel and BGP state.

The connection goes live in three days. Claims staff retrieve archived documents with latency of roughly 15 to 25 milliseconds, and during a planned firewall upgrade traffic fails over to the second tunnel without users noticing. The company later adds a dedicated circuit and keeps the VPN gateway as its encrypted backup path.