Interview Prep/Networking/Cloud networking: VPC, firewalls, NAT, VPN and proxies

A Site-to-Site VPN tunnel goes down every few hours and comes back only when on-prem sends traffic.

AdvancedTroubleshootingCloud networking: VPC, firewalls, NAT, VPN and proxies
Answer

Likely causes → Rekey or DPD mismatches. AWS's side waits for the customer gateway to initiate by default; if the tunnel idles and DPD times out (or a rekey fails because of lifetime/proposal mismatch), the tunnel drops and nobody re-initiates until on-prem traffic appears.

Diagnose →

aws ec2 describe-vpn-connections --vpn-connection-ids <vpn> \
  --query 'VpnConnections[0].Options.TunnelOptions[].[DpdTimeoutAction,StartupAction,Phase1LifetimeSeconds,Phase2LifetimeSeconds]'
# CloudWatch tunnel logs: look for DPD timeout or rekey failures before each drop

Fix → Set DpdTimeoutAction=restart and StartupAction=start on the AWS side so AWS re-initiates, match phase 1/2 lifetimes with on-prem, and enable DPD on the customer gateway.

Prevent → Alarm on TunnelState per tunnel, run both tunnels active with BGP, and keep a lightweight keepalive (e.g. a monitoring ping across the tunnel).

All Networking questions Roadmap: Networking for DevOps

More on Cloud networking: VPC, firewalls, NAT, VPN and proxies