- Newest
- Most votes
- Most comments
Based on your description, there are several potential issues that could be causing your Network Load Balancer (NLB) to be unreachable:
- Security Group Configuration: The most common cause of connectivity issues is security group settings. Check that:
- The security group for your EC2 instance allows inbound traffic on ports 8080 and 8000 from the NLB
- If you're using security groups with your NLB, ensure they allow the necessary traffic
-
Network ACLs: Even if your security groups are configured correctly, network ACLs associated with your subnets might be blocking traffic. Verify that the network ACLs for your subnets allow both inbound and outbound traffic on the required ports.
-
Client IP Preservation: If your NLB target group has the
preserve_client_ipattribute enabled and your targets include AWS PrivateLink ENIs or another NLB's ENI, this can cause communication loss. Try disabling this attribute if applicable. -
Subnet Configuration: For an internet-facing NLB, ensure it's attached to public subnets that have a route to an internet gateway. If your NLB is attached to private subnets but needs to be internet-facing, this would cause connectivity issues.
-
Routing: Verify that the route tables associated with your subnets are correctly configured to allow traffic between the NLB and your EC2 instance.
-
Health Check Configuration: While you mentioned your targets are showing as healthy, double-check that the health check configuration is appropriate for your application.
-
Ping Limitations: Note that NLBs don't respond to ICMP (ping) requests, so your ping test isn't a valid way to check NLB connectivity. The curl test is more appropriate.
To further troubleshoot:
- Try using tcpdump on your EC2 instance to see if traffic from the NLB is reaching your instance:
tcpdump port 8080 - Check if your application is actually listening on the specified ports using
netstat -tulpn | grep 8080 - Review the NLB access logs (if enabled) to see if requests are reaching the NLB
Since your targets are showing as healthy but connections are timing out, this suggests that traffic might be getting blocked somewhere between the NLB and your EC2 instance, most likely due to security group or network ACL configurations.
Sources
Troubleshoot a Classic Load Balancer: Client connectivity - Elastic Load Balancing
NLB Timeout Despite Healthy Targets & Verified Network Path (No VPC Flow Logs for NLB Traffic) | AWS re:Post
Troubleshoot a Classic Load Balancer: Health checks - ELB
ALB Connections Accepted but No Requests Processed – HTTPS Hangs (RequestCount = 0) | AWS re:Post
Relevant content
asked 3 years ago
asked 5 years ago
- AWS OFFICIALUpdated 2 months ago
