How to bind containers to specific network interfaces on AWS?

Hey,

What I want to do is be able to launch containers that would be bound on a specific IP address and furthermore, requests made from the container should appear to be originating from that IP address.

I have an EC2 instance on AWS that has two network interfaces attached, each interface with multiple secondary IP addresses attached as such:
eth0
main_private_ip -> main_public_ip
secondary_private_ip -> secondary_public_ip

eth1
main_private_ip -> main_public_ip
secondary_private_ip -> secondary_public_ip

If I start a container using -p with eth0_main_private_ip:port:port all works fine.

If I start a container using eth0_secondary_private_ip:port:port I can access the container on eth0_secondary_public_ip but requests appear to be originating from eth0_main_public_ip

If I start a container using eth1_main_private_ip then eth1_main_public_ip returns a timeout.

I am guessing that this is related to the default bridge configuration but am not sure how to fix it.

Thanks

Hi

Did you get a solution for this?

Regards

No, we didn’t find a solution for this and had to change our architecture.

Thank you. We will continue to insist that we find a solution. If so, I’ll put it here.