Interview Prep/AWS/VPC and Connectivity

NAT gateway shows `ErrorPortAllocation` in CloudWatch and connections drop.

IntermediateTroubleshootingVPC and Connectivity
Answer

Likely causes → Too many concurrent connections to the same destination from one NAT IP.

Diagnose →

aws cloudwatch get-metric-statistics --namespace AWS/NATGateway --metric-name ErrorPortAllocation --dimensions Name=NatGatewayId,Value=nat-0abc --start-time 2026-11-08T00:00:00Z --end-time 2026-11-09T00:00:00Z --period 300 --statistics Sum
aws ec2 describe-nat-gateways

Fix →

  1. Add secondary EIPs or more NAT gateways
  2. Spread across AZs
  3. Reuse connections and reduce churn

Prevent → Alarm on port allocation errors.

aws All AWS questions Roadmap: AWS core services

More on VPC and Connectivity