# Docker, EC2, and Network Interfaces

**URL:** <https://forums.docker.com/t/docker-ec2-and-network-interfaces/23984>\
**Category:** General\
**Created:** [October 27, 2016, 4:17am UTC](https://forums.docker.com/t/docker-ec2-and-network-interfaces/23984 "2016-10-27T04:17:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![barapapupi](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@barapapupi](https://forums.docker.com/u/barapapupi)\
**Post date:** [October 27, 2016, 4:17am UTC](https://forums.docker.com/t/docker-ec2-and-network-interfaces/23984/1 "2016-10-27T04:17:47Z")

</div>

Hi Guys and Girls,  
I’m breaking my head trying to solve this problem. Hopefully someone here can help me.

I have a docker container running inside an EC2 Instance and its running on port 80.  
The default EC2 has an eth0 network interface with the private IP of the EC2  
I have attached a second Network Interface (ENI) to the EC2, It takes place as eth1 with a different Private IP

When I try to reach the application running on port 80, I am able to do it through the IP of the eth0, but not from the IP of the eth1

How can I make sure that I can reach the application with the IP of eth1.

In Short:  
EC2 has a private IP ( eht0 )  
Network Interface attached to the same EC2 ( eth1 )  
Docker running on EC2 on port 80  
I can reach the container using eth0 IP, but not eth1 IP

Please if anybody has some ideas that would be awesome.

Thanks!

---

<div class="post-metadata">

**Author:** ![stefanmoser](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/stefanmoser/32/41293_2.png) [@stefanmoser](https://forums.docker.com/u/stefanmoser)\
**Post date:** [June 23, 2023, 8:38pm UTC](https://forums.docker.com/t/docker-ec2-and-network-interfaces/23984/2 "2023-06-23T20:38:40Z")

</div>

Any chance someone has figured out how to fix this issue sometime in the last 6 1/2 years? 😁 I’m running into the exact same problem today.

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [June 24, 2023, 9:16am UTC](https://forums.docker.com/t/docker-ec2-and-network-interfaces/23984/3 "2023-06-24T09:16:12Z")

</div>

I am not sure how this could be a problem. Vanilla Docker (=installed from Docker’s own repositories) publishes a container port on 0.0.0.0:hostport.

The only thing that comes to mind that would prevent communication are missing allow rules in the security group assigned to the instance(s).

Though, I can not speak for the Docker Distribution on Amazon Linux - You could always raise a support ticket to the Amazon support and ask for guidance.
