By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
For AWS Solutions Architect – Associate (SAA-C03) & Real-World Deployments
You’re a cloud engineer at a company migrating from on-prem to AWS. Your CIO demands low-latency, secure, and reliable connectivity between your data center and AWS. Public internet VPNs are slow and unreliable. Direct Connect (DX) is expensive but fast. You need to choose the right hybrid connectivity for cost, performance, and security.
Why this matters in production:- If you ignore this: Your users complain about slow database queries, failed backups, or VPN dropouts during peak hours. Your boss asks why AWS bills are skyrocketing from data transfer costs.- If you master this: You design high-performance, cost-optimized hybrid architectures that keep users happy and costs predictable. You also ace the SAA exam’s hybrid networking questions.
Real-world scenario:You inherit a legacy ERP system running on-prem. The finance team needs <10ms latency to AWS RDS for real-time reporting. A site-to-site VPN over the internet adds 50ms. Direct Connect is the only option—but how do you deploy it without breaking the bank?
ConnectionBpsEgress
ConnectionBpsIngress
aws ec2 describe-vpn-connections
✅ AWS account with admin IAM permissions✅ On-prem VPN device (or a test EC2 instance with strongSwan for lab) ✅ A VPC with private subnets (e.g., 10.0.0.0/16) ✅ On-prem CIDR (e.g., 192.168.1.0/24)
strongSwan
10.0.0.0/16
192.168.1.0/24
aws ec2 create-vpn-gateway --type ipsec.1 --tag-specifications 'ResourceType=vpn-gateway,Tags=[{Key=Name,Value=MyVGW}]'
Expected output:
{ "VpnGateway": { "VpnGatewayId": "vgw-12345678", "State": "pending", "Type": "ipsec.1" } }
Attach VGW to your VPC:
aws ec2 attach-vpn-gateway --vpn-gateway-id vgw-12345678 --vpc-id vpc-12345678
aws ec2 create-customer-gateway \ --type ipsec.1 \ --public-ip 203.0.113.1 \ # Your on-prem VPN device public IP --bgp-asn 65000 \ # Your on-prem BGP ASN (use 65000 for lab) --tag-specifications 'ResourceType=customer-gateway,Tags=[{Key=Name,Value=MyCGW}]'
{ "CustomerGateway": { "CustomerGatewayId": "cgw-12345678", "State": "available", "Type": "ipsec.1" } }
aws ec2 create-vpn-connection \ --type ipsec.1 \ --customer-gateway-id cgw-12345678 \ --vpn-gateway-id vgw-12345678 \ --options '{"StaticRoutesOnly": false}' \ # Enable BGP --tag-specifications 'ResourceType=vpn-connection,Tags=[{Key=Name,Value=MyVPN}]'
{ "VpnConnection": { "VpnConnectionId": "vpn-12345678", "State": "pending", "CustomerGatewayConfiguration": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><vpn_connection>...</vpn_connection>" } }
Download the config file (contains pre-shared keys, IPs, etc.):
aws ec2 get-vpn-connection-device-sample-configuration \ --vpn-connection-id vpn-12345678 \ --vpn-connection-device-type-id "generic" \ --output text > vpn-config.txt
Example for strongSwan (Linux):
sudo apt install strongswan -y sudo cp vpn-config.txt /etc/ipsec.conf sudo ipsec start sudo ipsec up aws-vpn
Verify the tunnel is up:
sudo ipsec status
Security Associations (1 up, 0 connecting): aws-vpn[1]: ESTABLISHED 10 seconds ago
Option A: Static Routes (if StaticRoutesOnly=true)
StaticRoutesOnly=true
aws ec2 create-vpn-connection-route \ --vpn-connection-id vpn-12345678 \ --destination-cidr-block 192.168.1.0/24
Option B: BGP (if StaticRoutesOnly=false)- Your on-prem router should now advertise routes to AWS.- Verify in AWS:
StaticRoutesOnly=false
aws ec2 describe-vpn-connections --vpn-connection-ids vpn-12345678
Check the Routes section for learned CIDRs.
Routes
From an on-prem server (e.g., 192.168.1.10):
192.168.1.10
ping 10.0.1.10 # A private EC2 instance in AWS
From AWS to on-prem:
ping 192.168.1.10
If it fails:- Check security groups (allow ICMP).- Check NACLs (allow inbound/outbound traffic).- Check route tables (ensure VPC has a route to 192.168.1.0/24 via VGW).
ec2:CreateVpnConnection
bash aws ec2 authorize-client-vpn-ingress \ --client-vpn-endpoint-id cvpn-endpoint-12345678 \ --target-network-cidr 10.0.0.0/16 \ --access-group-id sg-12345678 # Only allow this security group
bash aws ec2 create-tags --resources vgw-12345678 --tags Key=Environment,Value=Prod
TunnelState
TunnelState < 1 for 5 minutes
❌ VPN (too slow for large data transfers).
"Your site-to-site VPN keeps dropping. What’s the most likely cause?"
❌ "The VGW is misconfigured" (less likely if it worked before).
"How do you connect multiple VPCs to a single Direct Connect connection?"
You have a site-to-site VPN between AWS and on-prem. Traffic from AWS to on-prem (192.168.1.0/24) works, but on-prem to AWS (10.0.0.0/16) fails. What’s the issue?
bash aws ec2 describe-route-tables --filters "Name=vpc-id,Values=vpc-12345678"
bash aws ec2 create-route --route-table-id rtb-12345678 --destination-cidr-block 192.168.1.0/24 --gateway-id vgw-12345678
Why it works:- AWS doesn’t automatically add routes for on-prem CIDRs. You must manually add them to the VPC route table.
aws ec2 create-vpn-gateway
attach-vpn-gateway
aws ec2 create-customer-gateway
aws ec2 create-vpn-connection
get-vpn-connection-device-sample-configuration
Always test failover!- For Direct Connect, simulate a failure by disabling one DX port.- For VPN, unplug the on-prem router and verify traffic fails over to the second tunnel.
Now go build something resilient! ?
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.