VPN and Hybrid Networking
On-prem ↔ cloud, over tunnels or private lines
Hybrid connectivity joins on-prem and cloud: site-to-site VPN over IPsec, Direct Connect/ExpressRoute/Interconnect for dedicated circuits, plus transit gateways to route it all. Latency, bandwidth and SLA drive the choice.
What you will learn
- Compare IPsec VPN vs dedicated circuits (DX/ExpressRoute/Interconnect)
- Explain BGP between on-prem and cloud gateways
- Design a resilient hybrid path
Site-to-site VPNs tunnel over the internet; Direct Connect / ExpressRoute / Interconnect provide private physical circuits with SLAs. BGP exchanges routes between your routers and cloud gateways. Use tunnels for cost-critical redundancy, private lines when latency/SLA matter.
What is this?
Hybrid networking connects your on-premises network(s) to the cloud. Site-to-site VPN (AWS VPN, Azure VPN gateway, GCP Cloud VPN) runs IPsec over the internet — affordable, redundant if you run two tunnels. Dedicated circuits (AWS Direct Connect, Azure ExpressRoute, GCP Cloud Interconnect) traverse carrier-managed private paths with higher bandwidth and SLAs (down/up asymmetrical). Cloud gateways run BGP to exchange routes with on-prem routers; Transit Gateway / hub VNet route hybrid traffic centrally, and route propagation automates discovery.
Why do you need it?
- Hybrid is the reality of every migration: lift-and-shift before cloud-native.
- Latency-critical apps (databases, storage) do better on private circuits than noisy internet.
- BGP gives automatic failover: one tunnel down, routes re-advertise.
- Compliance (data residency) often demands dedicated connectivity with SPI retentions.
Mental model
Paying postal mail vs a dedicated courier line
VPN vs Direct Connect
IPsec VPN is guaranteed-delivery postal mail — works, cheap, can be slow and variable. Direct Connect is your own courier team with a fixed-speed highway: consistent, premium, more setup.
How it works
- IPsec tunnel: on-prem VPN device + cloud VPN gateway encrypt GRE/IPsec over the internet; two tunnels for HA.
- BGP: cloud gateway peers BGP with on-prem router, exchanging prefixes; route propagation feeds VPC route tables.
- Direct Connect: order a port, get LOA, cross-connect at carrier, establish virtual interfaces (private: to VPC; public: to AWS services).
- ExpressRoute/Interconnect: similar physical circuits with provider-managed SFI and BGP VIFs.
- Redundancy: multiple tunnels/circuits with distinct paths and AS path prepepend so failover is deterministic.
Hybrid cloud networking.
In production
- A bank runs critical replication over Direct Connect and keeps the VPN as an emergency path.
- An enterprise uses Azure ExpressRoute with a hub VNet gateway and spokes peered in for hybrid apps.
- A startup uses two AWS Site-to-Site VPN tunnels with BGP to reach its office for a single app.
Best practices
- Always run BGP with active/standby so cloud routes follow tunnel health.
- Prepend AS paths on the backup path to pin failover behavior.
- Size circuits to peak + headroom; provision a second provider path for resilience.
- Keep IP address plans disjoint and document BGP communities/prefix filters.
Common mistakes
- Running only one tunnel and 'hoping' the ISP is reliable.
- Advertising overlapping prefixes from on-prem and cloud.
- Forgetting route propagation so BGP routes never reach VPC subnets.
- Using internet VPN for latency-sensitive DB traffic and then blaming the cloud.
Common issues
DHCP fails to cross the tunnelACL at either end drops the protocol or the tunnel doesn't carry broadcast/multicast
Use routed (L3) connectivity and forward specific prefixes over the tunnel.
Fails over slowly on tunnel lossBGP hold timers + no path pre-preference
Reduce hold timers and configure AS path prepends so the secondary path is preferred only if primary dies.
DX virtual interface error lights but BGP never establishesLOA cross-connect not complete or VLAN/VNI mismatch
Verify carrier cross-connect, VIF state, and BGP authentication match (MD5 or keys).
Debugging tips
- Tunnel down: check IKE/phase states, BGP connectivity, and both ends' ACLs.
- Route flapping: look at BGP sessions, AS-path prepend, and site-to-site tunnel health.
- Bandwidth: monitor DX/ExpressRoute utilization; plane traffic may exhaust QoS.
- Latency: compare tunnel latency vs circuit latency from a representative client.
Interview checkpoint
Quick quiz
Which option uses a dedicated physical circuit with SLAs?
BGP lets cloud gateways automatically discover routes from on-prem.