cloud
networking
ai_generated
true
Connection drops after 350s idle — NAT Gateway idle timeout
ID: cloud/aws-nat-gateway-idle-timeout
85%Fix Rate
88%Confidence
4Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
AWS NAT Gateway silently drops idle TCP connections after 350 seconds.
genericWorkarounds
-
92% success Enable TCP keepalive with interval under 350 seconds
sysctl -w net.ipv4.tcp_keepalive_time=120
Sources: https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-troubleshooting.html
-
88% success Use VPC endpoints to bypass NAT Gateway entirely
VPC endpoints route traffic internally; no NAT Gateway involvement
Sources: https://docs.aws.amazon.com/vpc/latest/privatelink/what-is-privatelink.html
Dead Ends
Common approaches that don't work:
-
Increase OS TCP timeout beyond 350s
90% fail
NAT Gateway drops the mapping regardless of OS settings
-
Use longer connection pool idle timeout
80% fail
Application-level idle timeout does not prevent NAT Gateway from dropping the mapping