Site-to-Site VPN, Deconstructed

Site-to-Site VPN, Deconstructed

An advanced, interview-focused walkthrough of how AWS Site-to-Site VPN actually establishes, secures, and fails over its tunnels — dual-tunnel redundancy design, BGP versus static routing, ECMP throughput scaling through Transit Gateway, and the failure modes that only surface once you're running real production hybrid traffic through it, not just clicking through the console wizard.

Most engineers meet Site-to-Site VPN as “the thing you click through in the console to connect your data center to a VPC.” That description is accurate and almost useless for the person who has to keep hybrid production traffic flowing reliably over it. This article assumes you already know what a Virtual Private Gateway, a Customer Gateway, and a VPN connection are at a glance. We won’t re-explain them. Instead, we go deeper: why every connection provisions two tunnels and what that redundancy actually buys you, how BGP versus static routing changes your failover speed by an order of magnitude, how Equal-Cost Multi-Path routing through Transit Gateway lets you exceed a single tunnel’s throughput ceiling, and how real companies have used Site-to-Site VPN as either a permanent hybrid connectivity solution or a fast-to-provision failover path for Direct Connect.

1Advanced Core Concepts

Skipping the basics on purpose — this is the mental model of a VPN connection as a pair of independent, always-redundant tunnels, not a single logical link.

Every Connection Is Two Tunnels, by Design, Not by Choice

The single most important advanced fact about AWS Site-to-Site VPN, and the one most frequently glossed over in basic tutorials: every VPN connection provisions exactly two IPsec tunnels terminating at two different, physically separate AWS endpoints — not as an optional high-availability upgrade you can decline, but as the default, only way a connection is created. This is a deliberate design decision reflecting the reality that AWS’s own infrastructure performs maintenance and can experience localized failures, and a single-tunnel design would tie your hybrid connectivity’s availability to a single endpoint’s uptime. The advanced implication: a customer-side design that only terminates one of the two tunnels (common when a customer router has a single WAN interface) discards half of AWS’s built-in redundancy before it ever gets used, even though the connection is billed and provisioned as if both were active.

Analogy

Think of the two tunnels like a suspension bridge’s main cables. The bridge is engineered from day one with two independent cable systems, not because someone might want extra strength later, but because a single cable failing shouldn’t drop the deck. A customer network that only actually uses one of the two AWS-provisioned tunnels is like anchoring only one of those two cables to the far shore — the bridge still stands day to day, but it’s carrying real traffic on an engineering margin that was never meant to be its only support.

Virtual Private Gateway Versus Transit Gateway as the VPN Attachment Point

A Site-to-Site VPN connection terminates at either a Virtual Private Gateway (VGW), attached to a single VPC, or a Transit Gateway, which can aggregate many VPCs, many VPN connections, and Direct Connect attachments behind one routing domain. The advanced distinction goes beyond “VGW is older” — a Transit Gateway attachment supports Equal-Cost Multi-Path (ECMP) routing across multiple VPN connections, which a VGW attachment does not, making Transit Gateway the only path to aggregate throughput beyond a single connection’s per-tunnel ceiling. Any architecture anticipating growth beyond one VPC or needing throughput above a single tunnel’s limits should default to Transit Gateway from the outset, since migrating from a VGW-terminated design later is a non-trivial re-architecture, not a simple setting change.

Static Routing Versus BGP: Not Just “Which Is Easier to Set Up”

Static routing requires manually specifying the customer-side CIDR ranges the AWS side should route toward, but critically, it gives AWS no dynamic signal about tunnel health beyond IPsec-layer liveness — a static-routed tunnel that’s technically still up but whose customer-side network path is broken can continue receiving traffic that silently blackholes. BGP, by contrast, actively advertises reachable prefixes and withdraws them the moment a route becomes genuinely unavailable on the customer side, giving AWS a real-time, application-independent signal to shift traffic to the healthy tunnel. This is the advanced reason BGP is the default recommendation for any production deployment: it isn’t about configuration convenience, it’s about whether failure detection actually reflects true end-to-end reachability or merely tunnel-layer liveness.

Customer Gateway

A Resource, Not a Device

The AWS-side Customer Gateway resource is a configuration record (public IP, ASN, device type) representing your on-premises endpoint — it’s not itself a piece of infrastructure AWS manages, and it must exactly match your real router’s configuration.

Tunnel Options

Independently Tunable

Each of the two tunnels has its own IKE version, DPD timeout, pre-shared key, and inside-tunnel CIDR — they are not required to be configured identically, though most designs keep them symmetric for simplicity.

Accelerated VPN

AWS Global Accelerator Path

Routes tunnel traffic through the AWS global network via Global Accelerator anycast IPs instead of the public internet for the AWS-bound leg, often improving latency and consistency for geographically distant customer sites.

Transit Gateway ECMP

Aggregate Throughput

Multiple VPN connections attached to the same Transit Gateway can have their traffic load-balanced across tunnels via ECMP, the only native way to exceed a single connection’s per-tunnel throughput ceiling.

i
What an interviewer may ask

“Your VPN connection shows both tunnels as UP in the console, but traffic is still failing intermittently. What would you check?” A strong answer distinguishes tunnel-layer health from routing-layer health: confirm whether the connection uses BGP or static routing, and if static, recognize that “tunnel UP” only reflects IPsec liveness, not whether the customer-side network path for a given destination prefix is actually functional — a static-routed design has no mechanism to detect or route around that class of failure the way BGP does.

Slack’s Hybrid Connectivity During Early Cloud Migration

Companies migrating incrementally from on-premises data centers commonly use Site-to-Site VPN as the first hybrid connectivity layer — fast to provision (minutes, not the weeks a physical Direct Connect circuit requires), and sufficient for the traffic volumes typical of an early-stage migration where most services still live on-premises and only a subset of traffic crosses the hybrid boundary. The advanced lesson embedded in this common pattern: VPN and Direct Connect aren’t mutually exclusive alternatives chosen once — many production hybrid networks run both simultaneously, with VPN serving either as the initial bridge before Direct Connect is provisioned, or as the resilient failover path once Direct Connect becomes the primary link.

Route Propagation Into the VPC’s Own Route Tables

A subtlety that trips up otherwise-solid designs: routes learned by a Virtual Private Gateway or Transit Gateway from a VPN connection’s BGP session don’t automatically appear in every VPC subnet’s route table. Route propagation must be explicitly enabled on the relevant route tables (or, for Transit Gateway, the attachment must be associated with the correct Transit Gateway route table), and forgetting this step is one of the most common “the tunnel is up, BGP shows routes, but traffic still can’t reach the on-premises network” support cases — the VPN’s routing layer working correctly is necessary but not sufficient if the VPC’s own routing configuration never learned about it.

Transitive Routing Behavior Differs Between VGW and Transit Gateway

A Virtual Private Gateway attached to a single VPC has no concept of routing traffic onward to a different VPC — any multi-VPC connectivity requires a separate mechanism like VPC peering layered on top. A Transit Gateway, by contrast, natively supports transitive routing between all its attachments (subject to route table associations), meaning a single VPN connection into a Transit Gateway can reach every attached VPC without any additional peering configuration. This is one of the clearest, most concrete reasons advanced multi-VPC hybrid architectures default to Transit Gateway rather than VGW from the start.

2Internal Working

What actually happens when a tunnel establishes, and how routing decisions get made once it’s up.
flowchart TB
    ONPREM["On-Premises Router
Customer Gateway Device"] -->|"Tunnel 1 (IPsec)"| AZ1["AWS VPN Endpoint
Availability Zone A"] ONPREM -->|"Tunnel 2 (IPsec)"| AZ2["AWS VPN Endpoint
Availability Zone B"] AZ1 --> TGW["Transit Gateway
or Virtual Private Gateway"] AZ2 --> TGW TGW --> VPC1["VPC A"] TGW --> VPC2["VPC B"] ONPREM -.->|"BGP session per tunnel"| AZ1 ONPREM -.->|"BGP session per tunnel"| AZ2
Fig 1 — Two independent tunnels to two separate AWS Availability Zones, each carrying its own BGP session

IKE Negotiation: Two Phases Before Any Data Moves

Each tunnel establishes through the standard IPsec IKE (Internet Key Exchange) process in two phases, and understanding both matters for real troubleshooting. IKE Phase 1 negotiates a secure, authenticated channel between the two endpoints themselves — exchanging and validating the pre-shared key (or certificate, if configured), agreeing on encryption and hashing algorithms, and establishing what’s called the ISAKMP security association. IKE Phase 2 then negotiates the actual IPsec security associations that will protect data traffic, using the secure channel Phase 1 established. A tunnel stuck in a perpetual “negotiating” or flapping state is, in the overwhelming majority of real cases, a Phase 1 mismatch — an incompatible encryption algorithm, hashing method, Diffie-Hellman group, or a pre-shared key typo — and advanced troubleshooting starts by checking Phase 1 parameters match exactly on both sides before looking anywhere else.

sequenceDiagram
    participant CGW as Customer Gateway
    participant VPN as AWS VPN Endpoint

    CGW->>VPN: IKE Phase 1 — negotiate ISAKMP SA
    VPN-->>CGW: Phase 1 SA established (authenticated channel)
    CGW->>VPN: IKE Phase 2 — negotiate IPsec SA
    VPN-->>CGW: Phase 2 SA established (data channel ready)
    CGW->>VPN: BGP session establishes over tunnel
    VPN-->>CGW: Route advertisements exchanged
    Note over CGW,VPN: Data traffic now flows, encrypted, over the tunnel
        
Fig 2 — IKE’s two-phase negotiation must complete before BGP, and BGP must complete before real traffic reliably flows

Dead Peer Detection as the Tunnel-Layer Health Signal

Dead Peer Detection (DPD) is the mechanism by which each side periodically verifies the other endpoint is still responsive at the IPsec layer, independent of whether any actual data traffic is flowing — critical because a tunnel with no active data traffic for a period could otherwise sit in a stale, half-open state indefinitely without either side realizing the peer is gone. DPD’s configured timeout and retry behavior directly affects how quickly a genuinely dead tunnel is detected and torn down so failover can occur — an advanced tuning consideration distinct from BGP’s own timers, and one that matters independently because DPD operates below the routing layer entirely.

MTU and Fragmentation: A Frequently Underestimated Detail

IPsec encapsulation adds overhead to every packet, meaning the effective MTU available to traffic traversing the tunnel is smaller than a typical 1500-byte Ethernet MTU — AWS’s Site-to-Site VPN tunnels typically support an effective MTU around 1436 bytes. Traffic that doesn’t account for this and sends packets at the full 1500-byte MTU either gets fragmented (adding processing overhead and potential performance degradation) or silently dropped if the “don’t fragment” bit is set and Path MTU Discovery isn’t functioning correctly across the tunnel — a subtle, advanced-level root cause behind reports of certain large-payload requests failing over VPN while smaller requests work fine.

The Inside-Tunnel CIDR and Why It’s Easy to Overlook

Each tunnel requires its own small, dedicated /30 CIDR block for the IPsec-layer addressing between the two tunnel endpoints themselves — distinct from both the on-premises network’s addressing and the VPC’s own CIDR range entirely. AWS provides a default range for this if unspecified, but organizations with strict internal IP address management policies, or those running many VPN connections that might otherwise collide on the default range, need to explicitly assign non-overlapping inside-tunnel CIDRs per connection. Overlooking this as “just an internal implementation detail” can create genuine addressing conflicts at scale, particularly in environments already using significant portions of the private address space for other purposes.

Idle Timeout and Tunnel Re-Establishment After Inactivity

A tunnel with no BGP keepalive activity and no application traffic for an extended period can, depending on configuration and DPD settings, be torn down and require full re-establishment — including the complete IKE Phase 1 and Phase 2 negotiation sequence — rather than simply resuming. For traffic patterns with genuine idle periods (batch jobs that run once nightly, for instance), this re-establishment latency is worth accounting for explicitly in any end-to-end latency budget for the first request after an idle period, since it can add a meaningfully longer delay than steady-state tunnel traffic would suggest.

3Data Flow & Lifecycle

How a packet actually traverses a tunnel, and what happens during a failover event.

Encapsulation and the Path a Packet Actually Takes

A packet destined for a resource across the VPN boundary is encrypted and encapsulated in IPsec (typically ESP in tunnel mode) at the originating side’s tunnel endpoint, transmitted across the underlying network path (the public internet by default, or AWS’s own backbone if Accelerated VPN is configured) to the receiving endpoint, decrypted and de-encapsulated, and then routed normally within the destination network according to whatever routing table entries exist there. The advanced point worth internalizing: the VPN tunnel itself is purely a secure transport mechanism between two endpoints — actual routing decisions about where a packet goes once it’s inside the VPC, or once it’s inside the on-premises network, are governed entirely by each side’s own routing tables and have nothing to do with the tunnel’s own configuration beyond which prefixes are advertised into or out of it.

BGP Route Propagation and Path Selection

When BGP is used, each tunnel runs its own independent BGP session, meaning the same on-premises prefix can be advertised over both tunnels simultaneously, and standard BGP path-selection rules (AS path length, local preference, and other attributes you can configure) determine which tunnel a given prefix’s traffic actually prefers when both are healthy. Advanced designs deliberately configure asymmetric BGP attributes — a lower AS path prepend on the primary tunnel, a longer prepend on the secondary — specifically to control which tunnel carries traffic under normal conditions, rather than leaving path selection to whatever default the routers negotiate, which can result in unpredictable or asymmetric routing across your two tunnels.

What Actually Happens During a Tunnel Failover

When the active tunnel fails, the sequence of events differs meaningfully between BGP and static routing. With BGP, the failing tunnel’s peer stops sending keepalives, the BGP session times out (governed by the hold-timer, typically tens of seconds unless tuned more aggressively), the routes learned over that session are withdrawn, and traffic shifts to the surviving tunnel’s routes — a process that, with well-tuned BGP timers, can complete in single-digit seconds. With static routing, there is no equivalent automatic mechanism at the routing layer; failover depends entirely on whether the customer-side device is configured to detect the tunnel’s IPsec-layer failure and manually withdraw or deprioritize the affected static route, a process that’s both slower and dependent on correct customer-side configuration that AWS has no visibility into or influence over.

!
Failure Scenario

A common outage pattern: a static-routed VPN connection’s primary tunnel goes down, but the customer-side router’s static route table isn’t configured to detect this and fail over automatically — traffic continues being sent toward the dead tunnel, and the outage persists until someone notices and manually intervenes, often far longer than the seconds a properly tuned BGP failover would have taken.

Asymmetric Routing Risks Introduced by Multi-Path Hybrid Designs

When a network has multiple potential paths between on-premises and AWS — two VPN tunnels, or a VPN alongside a Direct Connect circuit — traffic in one direction can end up taking a genuinely different physical and logical path than the return traffic, unless routing policy is deliberately configured to keep flows symmetric. This matters beyond mere untidiness: stateful devices in the path (firewalls, NAT gateways, intrusion detection systems) that only see one direction of a given connection’s traffic often can’t properly track its state, leading to connections being dropped or misclassified. Advanced hybrid network designs treat symmetric routing as an explicit requirement to verify, not an assumption that naturally holds just because both paths are technically reachable.

Traffic Encryption Overhead’s Effect on Effective Throughput

Beyond the hard per-tunnel throughput ceiling covered in the performance chapter, the IPsec encryption and decryption process itself consumes CPU cycles on both the AWS-side endpoint and the customer-gateway device, meaning the practically achievable throughput for a given workload can fall meaningfully short of the theoretical ceiling if the customer-side device’s own encryption processing capacity — often dependent on whether it has hardware-accelerated IPsec support — is the actual bottleneck rather than AWS’s side. Advanced capacity planning verifies the customer-gateway device’s own throughput characteristics under real IPsec load, not just its stated maximum interface bandwidth.

4Advantages, Disadvantages & Trade-offs

At the advanced level, the honest framing isn’t “VPN connects your data center to AWS” — it’s “VPN trades the higher throughput ceiling, more predictable latency, and higher cost of a dedicated Direct Connect circuit for fast provisioning, no physical infrastructure dependency, and encryption built into the transport by default.”

Minutes
TO PROVISION, VS WEEKS FOR DIRECT CONNECT
~1.25 Gbps
PER-TUNNEL THROUGHPUT CEILING
Variable
LATENCY, RIDING PUBLIC INTERNET BY DEFAULT

Where VPN Wins

  • Fast provisioning for new hybrid connectivity needs, no physical circuit lead time
  • Built-in encryption without needing a separate MACsec or application-layer TLS setup for the transport itself
  • Cost-effective for moderate, non-latency-critical hybrid traffic volumes
  • Excellent, fast-to-deploy failover path for an existing Direct Connect circuit

Where VPN Falls Short

  • Per-tunnel throughput ceiling makes it a poor fit for sustained, very high-bandwidth transfer without ECMP scaling via Transit Gateway
  • Latency and jitter depend on public internet path quality by default, unlike Direct Connect’s dedicated, predictable circuit
  • IPsec encryption/decryption overhead adds processing cost absent from a dedicated physical circuit
Analogy

Choosing VPN over Direct Connect is like choosing a well-insulated courier van over building a private rail spur to your warehouse. The van can be on the road within hours, handles moderate volume perfectly well, and comes with its own lockbox for security built in — but if you need to move an enormous, sustained volume of freight reliably every single day, eventually the dedicated rail line’s higher upfront cost and lead time pays for itself in throughput and predictability the van simply can’t match.

The Trade-off Interviewers Actually Care About

The most tested trade-off is provisioning speed and flexibility versus throughput and latency predictability. VPN can be stood up and torn down in minutes, making it ideal for temporary needs, rapid prototyping of hybrid connectivity, or disaster-recovery scenarios where a new connection needs to exist quickly. Direct Connect requires physical circuit provisioning measured in weeks, but delivers a dedicated, non-internet-dependent path with far more predictable latency and no per-tunnel throughput ceiling. Advanced architecture decisions treat this as a genuine spectrum rather than a binary choice — many organizations run VPN for newly onboarded sites or temporary needs while a Direct Connect circuit is provisioned in parallel, then transition primary traffic to Direct Connect once it’s ready, keeping VPN as the ongoing failover path rather than decommissioning it.

Operational Ownership Trade-offs Between the Two Options

A less-discussed but real trade-off: Direct Connect typically involves an external telecom or colocation provider as a party in the relationship, adding a vendor management dimension to troubleshooting and change requests that a purely AWS-and-customer-router VPN connection doesn’t have. This means a VPN-only design keeps the entire troubleshooting surface within two parties’ direct control, which can meaningfully speed up incident resolution compared to a Direct Connect issue that might require coordinating with a third-party circuit provider — a consideration worth weighing separately from the pure throughput and latency comparison most discussions focus on.

5Performance & Scalability

The Per-Tunnel Throughput Ceiling Is a Hard Physical Constraint

Each individual IPsec tunnel is capped at approximately 1.25 Gbps of throughput — a limit rooted in the computational cost of IPsec encryption/decryption at the endpoint, not an arbitrary AWS-imposed quota that can be requested away. A workload that needs sustained throughput beyond this ceiling cannot get there by asking AWS for a higher limit on a single tunnel; the only native paths are aggregating multiple VPN connections via ECMP through a Transit Gateway, or moving to Direct Connect, which has a fundamentally different throughput profile because it isn’t encrypting every packet through IPsec by default.

flowchart LR
    ONPREM["On-Premises Network"] -->|"VPN Connection 1
~1.25 Gbps ceiling"| TGW["Transit Gateway
ECMP Distribution"] ONPREM -->|"VPN Connection 2
~1.25 Gbps ceiling"| TGW ONPREM -->|"VPN Connection 3
~1.25 Gbps ceiling"| TGW TGW --> VPC["Attached VPCs"]
Fig 3 — ECMP across multiple VPN connections on a Transit Gateway is the only native way past a single tunnel’s throughput ceiling

ECMP Requires Genuinely Equal-Cost Paths, Not Just Multiple Tunnels

Simply having multiple VPN connections attached to the same Transit Gateway doesn’t automatically grant proportional throughput scaling — ECMP requires the routes learned from each connection to actually be equal-cost from the routing protocol’s perspective (matching AS path length and other BGP attributes AWS’s ECMP implementation considers). A common advanced mistake is configuring multiple connections with mismatched BGP attributes for other reasons (like the primary/secondary preference pattern discussed in the routing chapter) and then being confused why traffic isn’t actually load-balancing evenly across them — the two goals, controlled failover preference and ECMP load balancing, are in direct tension and a design has to pick which one it’s actually optimizing for on a given set of connections.

Accelerated VPN’s Latency Improvement Is Path-Dependent, Not Universal

Accelerated VPN routes the AWS-bound leg of tunnel traffic through AWS’s global backbone via Global Accelerator’s anycast addressing, which tends to improve latency and reduce jitter specifically for customer sites geographically distant from the target AWS Region, where the public internet path would otherwise involve more hops and more variable routing. For a customer site already close to the target Region with a good direct internet path, the improvement is often marginal — advanced adoption decisions benchmark actual latency with and without acceleration for the specific customer-site-to-Region pair in question, rather than assuming a uniform benefit across every deployment.

Jitter and Packet Loss Sensitivity for Real-Time Workloads

Beyond raw throughput and average latency, workloads sensitive to jitter and packet loss — voice traffic, real-time control systems — face an additional consideration specific to VPN’s default reliance on the public internet: variable internet routing can introduce inconsistent latency and occasional packet loss that a dedicated Direct Connect circuit’s predictable path largely avoids. Advanced deployments for genuinely real-time-sensitive hybrid traffic either use Accelerated VPN specifically to reduce this variability, or conclude that VPN alone isn’t the right transport for that traffic class and pair it with Direct Connect instead, reserving VPN for traffic more tolerant of variable network conditions.

Capacity Planning Ahead of Known Volume Increases

Because the per-tunnel throughput ceiling is fixed and ECMP scaling requires provisioning additional VPN connections ahead of time (not something that can be requested as an instant, on-demand burst the way EC2 Auto Scaling handles compute), advanced capacity planning for a growing hybrid workload tracks utilization against the ceiling proactively and provisions additional ECMP-balanced connections well before sustained utilization approaches the limit, rather than discovering the ceiling has been reached only when application-layer performance degradation is already occurring.

6High Availability & Reliability

Dual Tunnels Protect Against AWS-Side Failure, Not Customer-Side Single Points of Failure

The two AWS-provisioned tunnels terminate at two different Availability Zones specifically to protect against a localized AWS-side failure or maintenance event. What they do not protect against, by themselves, is a failure on the customer’s own side — if both tunnels terminate at the same single customer-gateway device, that device remains a single point of failure regardless of how well AWS’s side is architected. True end-to-end high availability requires a second customer gateway device (often at a second physical location or at least a redundant device at the same site) with its own VPN connection, giving genuinely independent failure domains on both ends of the connection, not just the AWS side.

i
What an interviewer may ask

“You have two tunnels configured and both show healthy, but a planned AWS maintenance event still caused a brief outage. Why?” A strong answer checks whether the customer side has only one physical router terminating both tunnels — AWS’s dual-AZ redundancy is real, but it doesn’t help if the single customer-side device performing IPsec termination for both tunnels itself has a routing hiccup or resource constraint during a change on the AWS side, since that’s a customer-side single point of failure the AWS-side redundancy was never designed to cover.

Multiple VPN Connections for True Redundant-Site Designs

Advanced high-availability topologies commonly provision two entirely separate VPN connections — each with its own pair of tunnels — terminating at two physically distinct customer locations or devices, attached to the same Transit Gateway, with BGP attributes configured so one is clearly preferred under normal conditions and the other serves as a genuine, independent failover path. This is meaningfully more resilient than relying on a single connection’s built-in tunnel pair alone, because it removes the shared customer-side device as a common point of failure across both tunnels.

BGP Timer Tuning as a Direct Lever on Recovery Time

The default BGP hold-timer and keepalive interval represent a trade-off between failover speed and false-positive sensitivity — more aggressive timers detect a genuine failure faster but also increase the risk of a transient, brief network hiccup triggering an unnecessary failover event (and the “flapping” that comes with routes rapidly appearing and disappearing). Advanced designs tune these timers deliberately based on the actual reliability characteristics of the underlying network path, rather than leaving default values that may be either too slow for the business’s actual recovery-time requirements or too aggressive for a genuinely noisy internet path.

7Security

Pre-Shared Keys Versus Certificate-Based Authentication

Pre-shared keys are the simpler, more common authentication method for the IKE handshake, but they carry the operational burden of secure distribution and periodic rotation — a leaked pre-shared key compromises the tunnel’s authentication entirely until rotated on both sides simultaneously, which itself requires a coordinated maintenance window. Certificate-based authentication, where supported by the customer gateway device, avoids the shared-secret distribution problem entirely and integrates with existing PKI infrastructure for rotation and revocation, at the cost of more complex initial setup. Advanced security postures for long-lived, high-value VPN connections increasingly favor certificate-based authentication specifically to avoid the pre-shared key’s rotation and distribution risk.

Encryption Algorithm and Diffie-Hellman Group Selection

Tunnel options let you specify which encryption algorithms, integrity algorithms, and Diffie-Hellman groups are permitted for both IKE phases — and the advanced security discipline is restricting these to modern, strong choices explicitly (AES-256, SHA-2 family, higher-numbered DH groups) rather than accepting the broadest possible default set for compatibility, since a tunnel configured to accept weaker legacy algorithms as a fallback is only as strong as the weakest option it’s willing to negotiate down to if a peer requests it.

ADR-042 · Pre-Shared Key Rotation Decision Recorded
Context

A long-lived VPN connection’s pre-shared keys, set once at initial provisioning, had never been rotated, creating an open-ended exposure window if the key were ever leaked through a configuration backup, a support ticket, or an insider threat.

Decision

Establish a scheduled key rotation process, updating tunnel options with new pre-shared keys on both the AWS and customer-gateway sides within a coordinated maintenance window, using the connection’s second tunnel to preserve availability while the first tunnel’s key is rotated.

Consequence

Bounds the exposure window of any single leaked key to the rotation interval, at the cost of a recurring, coordinated operational task that must be scheduled and tracked rather than treated as a one-time setup step.

The Tunnel Encrypts Transport, Not Application-Layer Trust

It’s worth stating plainly because it’s a genuine, advanced-level misconception: a Site-to-Site VPN tunnel establishes an encrypted, authenticated network path between two networks — it says nothing about whether traffic arriving over that tunnel should be implicitly trusted at the application layer. A compromised device anywhere within the on-premises network that the VPN connects still has network-layer reachability to whatever the VPN’s routing advertises, and security groups, NACLs, and application-layer authentication within the VPC remain exactly as necessary as they would be for any other network path — the VPN’s encryption protects data in transit between the two networks, not the trustworthiness of everything already inside either network.

Limiting Advertised Routes to the Minimum Necessary Scope

It’s operationally convenient to advertise an entire on-premises supernet over BGP rather than carefully scoping advertisements to only the specific subnets that genuinely need hybrid connectivity, but this convenience has a real security cost: it grants the VPC-side network reachability to the entire advertised range, including systems that may have no legitimate reason to be reachable from AWS at all. Advanced network security reviews specifically check whether BGP advertisements are scoped tightly to the actual required subnets on both sides, treating an overly broad advertisement as a genuine finding worth remediating, not just a minor tidiness issue.

Auditing Tunnel Option Changes as a Security-Relevant Event

Because tunnel options — encryption algorithms, DH groups, pre-shared keys — directly determine the cryptographic strength of a production hybrid connection, changes to them are exactly the kind of event that should generate an audit trail and, ideally, a change-approval record, via CloudTrail on the AWS side and the customer-gateway device’s own audit logging. A silent downgrade of a tunnel’s permitted encryption algorithms — whether accidental or malicious — is the kind of change that could otherwise go unnoticed for a long time if nobody is specifically watching for it.

8Monitoring, Logging & Metrics

Tunnel State Alone Is an Insufficient Health Signal

CloudWatch’s TunnelState metric reports whether a tunnel’s IPsec layer is up, but as covered in the failover chapter, a tunnel can be “up” at that layer while the actual routes needed for real traffic are unavailable or the BGP session itself is unhealthy. Advanced monitoring dashboards track TunnelState alongside BGP session state and route count metrics together, because a healthy tunnel with zero advertised routes, or a tunnel whose BGP session has flapped repeatedly in a short window, represents a real operational problem that tunnel state alone would report as entirely fine.

Bytes-In and Bytes-Out Asymmetry as a Diagnostic Signal

A significant, sustained asymmetry between a tunnel’s inbound and outbound byte counts — far more traffic flowing one direction than the other, beyond what the actual application traffic pattern would explain — is often an early indicator of asymmetric routing (traffic going out over one tunnel but return traffic coming back over the other, or through a completely different path like Direct Connect if both exist), which can itself cause connection-tracking and stateful firewall issues on either side. Advanced network teams treat this metric as a routing-correctness check, not just a capacity or utilization number.

“A tunnel reporting healthy at the IPsec layer while its BGP session sits in a persistent Idle state is the single most common gap between ‘looks fine on the dashboard’ and ‘actually carrying traffic.'”

Logging BGP Session Events for Post-Incident Reconstruction

BGP session state changes — established, idle, active, the specific timestamps of route withdrawals — are essential forensic data during any post-incident review of a failover event, and advanced practice ensures these are captured either via the customer-gateway device’s own logging (typically the richer source) or CloudWatch Logs where the AWS side exposes them, rather than relying purely on tunnel-level up/down events that don’t capture the routing-layer detail needed to reconstruct exactly when and why traffic actually shifted between tunnels.

9Deployment & Cloud

Transit Gateway as the Hub for Multi-VPC, Multi-Connection Topologies

For any organization with more than a single VPC needing hybrid connectivity, attaching VPN connections to a Transit Gateway rather than individual VGWs per VPC centralizes routing management, enables the ECMP throughput scaling covered earlier, and lets Direct Connect and VPN attachments share the same routing domain — meaning a single Transit Gateway route table can express policies like “prefer Direct Connect, fail over to VPN” across the entire attached VPC fleet at once, rather than needing that logic replicated per VPC.

Multi-Region VPN Designs and Their Genuine Complexity

A Transit Gateway is regional, so a genuinely multi-Region hybrid network requires either separate VPN connections into a Transit Gateway per Region (with Transit Gateway peering connecting the Regions), or routing all hybrid traffic through a single Region’s Transit Gateway and relying on inter-Region VPC peering or Transit Gateway peering from there. Advanced designs weigh this complexity against actual multi-Region traffic requirements — a workload with only occasional cross-Region hybrid traffic may not justify the operational overhead of VPN connections duplicated per Region, while one with substantial, latency-sensitive traffic to multiple Regions likely does.

Infrastructure as Code for VPN Configuration Drift Prevention

Because a VPN connection’s correctness depends on exact agreement between the AWS-side Customer Gateway resource and the actual on-premises router configuration — IP addresses, ASN, pre-shared keys, tunnel options — manual console changes on either side that aren’t mirrored on the other are a common, entirely avoidable source of outages. Advanced practice manages both the AWS-side resources (via Terraform or CloudFormation) and, where the customer-gateway vendor supports it, the corresponding on-premises configuration through the same change-review process, specifically to prevent the two sides drifting out of sync silently.

Multi-Account Hybrid Connectivity via Shared Transit Gateway

In an AWS Organizations multi-account setup, a Transit Gateway in a dedicated networking account can be shared via Resource Access Manager with other accounts in the organization, letting a single set of VPN connections and their associated hybrid connectivity be reused across many application-owning accounts without each one needing its own separate VPN connection back to the same on-premises network. This centralization is an advanced organizational pattern that significantly reduces both the operational overhead of managing many redundant connections and the on-premises router’s own connection count, at the cost of requiring careful Transit Gateway route table segmentation so accounts only see the routes they’re actually meant to reach.

Testing Failover as Part of the Deployment Pipeline, Not Just Initial Setup

Beyond the one-time validation of a newly provisioned connection, advanced operational maturity treats periodic, scheduled failover testing as an ongoing practice — deliberately disabling the primary tunnel or connection in a controlled window and confirming traffic shifts to the secondary within the expected time, with the expected impact. Configuration changes elsewhere in the network (a firmware update on the customer-gateway device, a change to BGP timers, a new route added upstream) can silently break a failover path that worked correctly when it was last tested, and only a recurring test schedule catches that kind of regression before an actual incident does.

10Design Patterns & Anti-patterns

Pattern

VPN as Direct Connect Failover

A Site-to-Site VPN connection configured with a lower BGP preference than an existing Direct Connect circuit, activating automatically as a resilient backup path the moment Direct Connect degrades or fails, without manual intervention.

Pattern

ECMP-Scaled Aggregate Bandwidth

Multiple VPN connections with genuinely equal-cost BGP attributes attached to one Transit Gateway, deliberately used to exceed a single tunnel’s throughput ceiling for workloads that don’t yet justify Direct Connect’s cost and lead time.

Anti-pattern

Single Customer Gateway Device for “Redundant” Tunnels

Terminating both AWS-provisioned tunnels at one physical on-premises device and calling the design highly available — the AWS-side redundancy is real, but the customer-side single point of failure undermines it entirely.

Anti-pattern

Static Routing for Production Failover-Dependent Traffic

Relying on static routes for a connection whose availability matters, without a genuinely fast, tested customer-side mechanism to detect and react to tunnel failure — routing-layer failover speed and correctness end up entirely dependent on customer-side configuration AWS has no part in verifying.

i
What an interviewer may ask

“How would you design VPN connectivity for a workload that needs both high availability and more throughput than a single tunnel provides?” A strong answer combines two independent techniques: multiple VPN connections attached to a Transit Gateway with ECMP for throughput scaling, and at least two physically distinct customer-gateway devices or locations for genuine end-to-end redundancy — recognizing that throughput scaling and true high availability are separate design goals that happen to share some of the same underlying mechanism (multiple connections) but require deliberate attention to both, not just more tunnels.

11Best Practices & Common Mistakes

PracticeWhy It’s Advanced, Not Basic
Terminate both tunnels on genuinely independent customer-side devicesAWS-side dual-AZ redundancy provides no benefit if the customer side has a single point of failure
Use BGP rather than static routing for any production-critical pathStatic routing has no mechanism to detect and route around a customer-side reachability failure
Configure asymmetric BGP attributes deliberately for primary/secondary preference, or matching attributes for genuine ECMP — never assume both happen by defaultThe two goals are in direct tension and require an explicit choice per set of connections
Monitor BGP session state and route counts, not just tunnel stateA tunnel can report healthy at the IPsec layer while carrying zero usable routes
Account for the reduced effective MTU under IPsec encapsulationLarge-payload traffic that ignores this can silently fragment or drop depending on Path MTU Discovery behavior
Rotate pre-shared keys on a defined schedule, or move to certificate-based authentication for long-lived connectionsAn unrotated, long-lived shared secret is an open-ended exposure window if ever leaked
!
Common Mistake

Provisioning a Site-to-Site VPN connection, confirming both tunnels show “UP” in the console, and considering the high-availability requirement satisfied without ever testing an actual failover — a tunnel that has never been deliberately failed over in a controlled test is a redundancy mechanism whose real-world behavior is still unverified, discovered for the first time during an actual incident rather than a planned drill.

Documenting the Actual, Current BGP Preference Design

As a hybrid network accumulates multiple VPN connections, possibly alongside Direct Connect, over time, the intended traffic-preference logic (which path should carry traffic under normal conditions, which is the failover, which combination is meant to provide ECMP scaling) becomes genuinely difficult to reconstruct from router configuration alone months or years later, especially across personnel changes. Advanced teams maintain an explicit, current network diagram and preference-rationale document alongside the actual configuration, specifically so a new engineer troubleshooting a routing anomaly can quickly understand what the intended behavior was supposed to be, rather than having to reverse-engineer it from BGP attributes scattered across multiple device configurations.

12Real-World & Industry Examples

Financial Services Firms — VPN as Direct Connect’s Failover Path

Regulated financial institutions with primary Direct Connect circuits to AWS commonly provision Site-to-Site VPN as an automatic, BGP-preference-based failover path, satisfying regulatory resilience requirements for hybrid connectivity without needing a second, redundant Direct Connect circuit purely for disaster-recovery purposes.

Retailers — Rapid Store-Network Onboarding

Retail chains connecting individual store locations to a central AWS-hosted point-of-sale or inventory system use Site-to-Site VPN specifically because a new store can be online within hours of a router being installed, versus the multi-week lead time a dedicated circuit per location would require at that scale.

Healthcare Organizations — Encrypted Hybrid Connectivity for Compliance

Organizations subject to healthcare data-protection regulations favor Site-to-Site VPN’s built-in IPsec encryption for hybrid links carrying regulated data, satisfying encryption-in-transit requirements for the network path itself without needing to layer a separate encrypted tunnel on top of an otherwise unencrypted dedicated circuit.

Software Companies — ECMP-Scaled VPN During Migration Windows

Companies mid-migration, moving large volumes of data from on-premises to AWS before Direct Connect provisioning completes, have used multiple ECMP-balanced VPN connections through a Transit Gateway as a temporary, higher-throughput bridge specifically to avoid stalling a migration timeline on a slower single-tunnel ceiling.

Managed Service Providers — Shared Transit Gateway for Multi-Tenant Hybrid Access

Managed service providers running infrastructure on behalf of multiple end-customer organizations have used a centralized, shared Transit Gateway with per-customer VPN connections and carefully segmented route tables, letting each customer maintain independent hybrid connectivity to their own on-premises network without provisioning a fully separate networking stack per customer account.

Across these examples, the pattern repeats: the organizations getting the most value from Site-to-Site VPN treat it either as a deliberate, permanent connectivity choice suited to their actual throughput and latency needs, or as an explicitly time-bound bridge — never as an assumed-adequate default applied without checking whether the workload’s real requirements exceed what it can provide.

13FAQ

Q1Why does AWS always provision two tunnels per VPN connection?
To protect against a localized failure or maintenance event at a single AWS endpoint — the two tunnels terminate at two different Availability Zones by design, not as an optional add-on, ensuring the connection’s availability isn’t tied to a single physical AWS endpoint.
Q2Is BGP required for a Site-to-Site VPN connection?
No, static routing is supported, but BGP is strongly recommended for any production path where failover speed and correctness matter — static routing has no mechanism to detect a customer-side reachability failure and reroute around it automatically the way BGP’s route withdrawal does.
Q3How do I get more throughput than a single tunnel’s ~1.25 Gbps ceiling?
Attach multiple VPN connections to a Transit Gateway with genuinely equal-cost BGP attributes and use ECMP to load-balance traffic across them — this is the only native way to scale aggregate throughput beyond a single tunnel’s physical ceiling short of moving to Direct Connect.
Q4Does terminating both tunnels on one customer router still count as highly available?
Only against AWS-side failures, not customer-side ones. True end-to-end high availability requires the customer side to also have redundant, physically independent devices or locations — a single customer-gateway device remains a single point of failure regardless of how many AWS-side tunnels exist.
Q5Why would large file transfers fail over VPN while smaller requests work fine?
IPsec encapsulation reduces the effective MTU available to traffic traversing the tunnel — large packets sent at a full 1500-byte MTU without accounting for this can be fragmented or silently dropped depending on Path MTU Discovery behavior, a common, easily overlooked root cause for this specific symptom.
Q6Can Site-to-Site VPN and Direct Connect be used together?
Yes, and it’s a common, deliberate pattern — VPN frequently serves as a fast-failover backup path for an existing Direct Connect circuit, with BGP preference configured so Direct Connect is preferred under normal conditions and VPN activates automatically if it degrades or fails.
Q7Why can’t traffic reach the on-premises network even though the tunnel is up and BGP shows learned routes?
Route propagation into the relevant VPC route table (or Transit Gateway route table association) must be explicitly enabled — a tunnel and BGP session working correctly doesn’t automatically populate every route table that needs those routes, and this is one of the most common overlooked steps behind an otherwise healthy-looking connection that still can’t pass traffic.
Q8Does a Virtual Private Gateway support routing between multiple VPCs over one VPN connection?
No — a VGW is attached to a single VPC and has no native transitive routing capability to other VPCs. A Transit Gateway supports transitive routing across all its attachments natively, which is why multi-VPC hybrid architectures generally default to Transit Gateway rather than VGW.

14Summary and Key Takeaways

Carry These Forward

  • Every connection is two tunnels by design — but that redundancy only matters if the customer side also avoids a single point of failure.
  • BGP versus static routing is a failure-detection decision, not just a configuration preference — static routing has no mechanism to detect customer-side reachability failures.
  • The ~1.25 Gbps per-tunnel ceiling is a physical constraint — ECMP across multiple connections via Transit Gateway is the only native path past it.
  • IKE Phase 1 mismatches cause the overwhelming majority of stuck-negotiating tunnels — check encryption, hashing, DH group, and pre-shared key agreement first.
  • Reduced effective MTU under IPsec encapsulation silently breaks large-payload traffic that doesn’t account for it.
  • Tunnel state alone is an insufficient health signal — pair it with BGP session state and route counts for a true picture of connectivity health.
  • VPN and Direct Connect are complementary, not exclusive — many production hybrid networks run both, with VPN as either the initial bridge or the resilient failover path.