Skip to content

Connecting an on-premises network to a VPC

Six ways to join an on-premises or branch network to a VPC. They differ in how quickly they can be stood up, whether traffic crosses the public internet, and how much of the operation you take on.

An AWS-managed IPsec VPN over your existing internet connection.

WhatAWS-managed IPsec VPN over your existing internet connection
WhenYou need a secure tunnel to a VPC quickly, or a backup path for Direct Connect
ProsFast to set up; supports static routes or BGP; two tunnels per connection for redundancy; AWS monitoring built in
ConsPerformance follows your internet connection, which AWS does not control
  1. Choose the device that will act as the customer gateway — usually your on-premises router or firewall — and note its public IP address and BGP ASN.
  2. Create a virtual private gateway (or a transit gateway) in AWS, a customer gateway resource, and the VPN connection between them.
  3. Download the generated configuration file. AWS produces vendor-specific configurations for common routers, including Cisco, Juniper and Palo Alto.
  4. Apply the configuration to the on-premises device.
  5. Send traffic from your side to bring the tunnels up — the tunnels are idle until traffic or BGP keepalives start them.
  6. Configure BGP if you want dynamic routing and automatic failover.

Rather than adding on-premises prefixes to VPC route tables by hand, enable route propagation on the route table associated with the virtual private gateway. The gateway then installs the routes it learns automatically, and withdraws them when the tunnel drops.

Each VPN connection provides two tunnels to two separate endpoints on the AWS side. Configuring both is what makes the connection redundant; configuring one is a single point of failure that looks like a working VPN until AWS performs maintenance on that endpoint.

A dedicated private circuit into the AWS backbone, not crossing the public internet.

WhatA dedicated connection over private lines straight into the AWS backbone
WhenYou need consistent throughput and latency, or move enough data that internet transfer costs dominate
ProsPredictable performance; lower data transfer rates; port speeds up to 400 Gbps on dedicated connections; BGP routing
ConsNeeds a telecom or hosting provider relationship, and lead times measured in weeks

You order through your network provider or an AWS Direct Connect Partner, then create virtual interfaces on the connection: a private VIF to reach VPCs, a public VIF to reach AWS public service endpoints such as Amazon S3, or a transit VIF to reach a transit gateway.

See Direct Connect.

An IPsec VPN running over the Direct Connect circuit.

WhatIPsec VPN over the private Direct Connect lines
WhenYou want encryption in transit on top of a private circuit
ProsEncrypted as well as private; satisfies compliance rules that require encryption end to end
ConsAdditional complexity, and the VPN’s own throughput ceiling

Also used where several companies share one Direct Connect circuit and each needs its own encrypted, separately routed path.

Several sites, each with its own VPN connection to the same virtual private gateway, using AWS as the hub between them.

WhatConnect sites in a hub-and-spoke arrangement through a virtual private gateway
WhenBranch offices need to reach AWS and each other, as a primary or backup WAN
ProsReuses existing internet connections; BGP routing lets you prefer MPLS and fall back to CloudHub
ConsDepends on internet quality; no inherent redundancy beyond the two tunnels per connection
HowAttach multiple customer gateways to one virtual private gateway, each with its own BGP ASN and non-overlapping address range

Traffic between sites is encrypted end to end and routed through AWS. It is inexpensive and easy to manage, and it makes a reasonable backup for an MPLS network. For anything larger, a transit gateway with VPN attachments gives the same topology with proper route tables.

Your own VPN software on an EC2 instance — OpenVPN, strongSwan, or a Marketplace appliance.

WhatYou provide the VPN endpoint and the software
WhenYou must control both ends for compliance, or need a VPN option AWS does not offer
ProsComplete flexibility over protocol, ciphers and client behaviour
ConsYou design and operate the redundancy across the whole chain, and patch the instances

A central VPC running third-party routing appliances that connects VPCs across Regions and on-premises sites.

WhatA central VPC of virtual routers acting as a global transit centre
WhenVPCs and locations across several Regions must reach each other
ProsVendor features and routing policies a managed service may not offer
ConsYou run the appliances; bandwidth follows the instance type; you design the redundancy

For most designs a transit gateway does this with less to operate. Keep a transit VPC where a specific appliance capability is genuinely required.

Start with a managed VPN if you need connectivity this week. Order Direct Connect if throughput or latency consistency matters, and keep a VPN as the backup path — that pairing is the standard hybrid design. Add a transit gateway once more than a couple of VPCs are involved.