skip to Main Content

I have an AWS EC2 instance(Amazon Linux – t2.small) created by Terraform with Nginx installed assigned with 3 Elastic IPs, each of them is attached to an Network Interface that have Security Group allow all Inbound/Outbound traffic, and it also inside an subnet route to internet gateway.

The thing is when accessing these EIPs, it’s supposed to work but only the main ENI is working. Sometime 2 of them work but it really rare. When I check inside the instance with ip a it shown that these ENI are online. So now I really wonder what I’m missing here?

I tried running networkctl to see the status of the ENIs but all of them are online, one thing I see is that with the ENI that is working it’s log show Link Up.
About running command ip a the working ENIs have altname.

2

Answers


  1. I wonder if you are having a DNS assignment issue instead of an EIP issue.

    For example, your NGNINX configuration could be

    server {
        listen 127.0.0.1:80;
        # Additional server configuration
    }
    

    and therefore not responding to external IP addresses, where the fix would be

    server {
        listen 0.0.0.0:80;
        # Additional server configuration
    }
    

    The above code tells Nginx to listen on all IP addresses.

    Or, perhaps your nginx configuration is a domain name like:

    server {
        listen      80;
        server_name example.org www.example.org;
        #...
    }
    

    and your DNS records point to only one IP address instead of a list of IP addresses?

    Login or Signup to reply.
  2. So what is not working?

    ENIs are up. Are you maybe having issues with traffic being routed to the correct ENI?

    Look at fixing your routing on the instance and also Source/Destination checks which need to be disabled when you have multiple NICs on an instance.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search