- Newest
- Most votes
- Most comments
Based on your description, there are several potential issues that could be causing your outbound traffic failure from the private subnet:
-
NAT Gateway Configuration: While your NAT instances appear to be properly configured with IP forwarding enabled and the appropriate iptables rules, there might be issues with how traffic is being processed through the GWLB. The NAT instances need to properly handle the GENEVE encapsulated traffic from the GWLB.
-
Route Table Configuration: Although you've set up routes that appear correct, there might be subtle issues with the return traffic path. For symmetric routing with a GWLB, you need to ensure that:
- The private subnet route table correctly sends traffic to the GWLB endpoint
- The public subnet route table has both the default route to the IGW and a specific route for your private subnet CIDR back to the GWLB endpoint
- Security Group and NACL Configuration: Even though you're using default NACLs that allow all traffic, verify that:
- Security groups for the NAT instances allow both inbound and outbound traffic
- Security groups for the private instances allow outbound traffic
- The GWLB endpoint security group allows traffic from your private subnet
-
GWLB Endpoint Configuration: Ensure the GWLB endpoint is properly configured in the correct subnet and is in an "Available" state.
-
TCP Connection Handling: If you're specifically having issues with TCP connections, check if there are any TCP connection handling issues on your NAT instances, such as fragmented TCP packets.
Troubleshooting steps:
-
Enable VPC Flow Logs: This will help you see where traffic might be getting dropped or if it's reaching the intended destinations.
-
Test with Different Protocols: Try both ICMP (ping) and TCP (curl) to see if the behavior differs, which might indicate protocol-specific issues.
-
Check GWLB Health Checks: Verify that the health checks are properly configured to test the actual NAT functionality, not just instance reachability.
-
Verify Source/Destination Check: Ensure that source/destination check is disabled on your NAT instances.
-
Test Direct Routing: As a diagnostic step, try setting up a direct route from your private subnet to one of your NAT instances (bypassing the GWLB) to see if that works, which would help isolate whether the issue is with the NAT instances themselves or with the GWLB configuration.
-
Check for MTU Issues: GWLB uses GENEVE encapsulation which can cause MTU issues. Ensure your NAT instances are properly handling the MTU for encapsulated traffic.
If all these checks pass, consider reviewing your Terraform code for any subtle configuration issues in how the GWLB, endpoints, and route tables are being created and associated.
Sources
Instances within the private subnet are unable to access the internet using NAT gateway. | AWS re:Post
Troubleshoot NAT gateways - Amazon Virtual Private Cloud
NLB Timeout Despite Healthy Targets & Verified Network Path (No VPC Flow Logs for NLB Traffic) | AWS re:Post
Troubleshoot EC2 instance internet access with a NAT gateway | AWS re:Post
answered a year ago
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 2 years ago
