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 →
- Add secondary EIPs or more NAT gateways
- Spread across AZs
- Reuse connections and reduce churn
Prevent → Alarm on port allocation errors.
More on VPC and Connectivity
`ssh: connect to host 3.250.1.1 port 22: Connection timed out`. Walk the checks.Beginner`ssh: connect to host ... port 22: Connection refused`. How is it different from a timeout?Beginner`Permission denied (publickey)` on a new EC2 instance.IntermediatePrivate instances cannot reach the internet; `curl: (28) Connection timed out after 10000 milliseconds`.IntermediateVPC peering is `active` but ping fails.IntermediateVPC Reachability Analyzer says `BLACKHOLE`. What does it mean?Advanced