3

My scenario: I deploy a application in AWS on e2 instance on some port: I create a network loadbalancer (application use a tcp protocol) with target group. Also this instance is in autoscalling group with a proper security group:

  • inbound: APP_PORT
  • oubound: 1 - 65534

From other ec2 instance I can reach application via LOAD BALANCER DNS name, and is responding also all health check are passing. But on ec2 instance where this instance exist:

  • I can reach application via localhost/ec2 ip
  • But I couldn't do this via Load balancer dns, I got a timeout

AWS ALB doesn't allow a traffic loop on load balancer or I had something wrong? Maybe I'm missing something...

2

AWS ALB indeed permits access from inside the VPC. I guess you'll have one of these problems:

  • The ALB doesn't permit access to the outside app port (say 80) from the EC2 IP, or
  • The EC2's security group or NACL doesn't permit access to the ALB external IP / port, or
  • The EC2 doesn't have internet access through NAT or using Public IP and therefore can't reach the ALB's public IP.

Very likely it will be one of these three issues.

Hope that helps :)

  • Well my LB and ec2 instance are private and closed in private subnet in my vpc. * I checked security groups and looks fine * I can resolve private dns address for this Load Balancer, and in strace i see that dns resolved and connection is initialized to LB, but hanging – pkruk Nov 28 '18 at 11:00
  • @pkruk are EC2 and ALB in the same subnet? Does the ALB SG permit traffic from the EC2 IP or EC2 SG? On the correct port? Maybe send some screenshots of the relevant services. – MLu Nov 28 '18 at 11:05
  • I find the answer, well it's quite tricky ;) Kernel treat a packet as a 'Martian Packets ', because they are returning to Virtual Machine with the same serial, source etc by with different MAC address, so they are was dropped via kernel. Changing load balancer from network could help with that :) – pkruk Nov 28 '18 at 20:03
  • 1
    @pkruk I didn’t notice you were using NLB, I thought it was ALB! Well done figuring this one out :) – MLu Nov 28 '18 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.