Multiple outgoing ip amazon

amazon-web-servicesipPROXY

We've recently been trying to migrate our "Proxy service" to Amazon Web Service for more flexibility / maybe better pricing than what we're using at the moment (multiple servers) but I'm still not sure on how to proceed.

We need to get multiple outgoing public IPs (Can be dynamic / static)

Currently when we're launching an EC2 server, attaching a few Elastic IP to it using 2 Networks interfaces, doesn't matter which IP we'll be using to connect TO the server, the server is always answering with the same public IP.

To be a bit more specific here is our current AWS Network Interface setup :

enter image description here

When we're connecting to the instance (SSH tunnel) using 172.31.25.x, the public IP we're getting is the same than if we connected using 172.31.28.x, which is 52.28.58.x.

I'm not sure the issue is coming from the settings we're using or from the fact that EC2 instances are just not the correct Amazon service we should be using from the multitude we've been able to see (Customer Gateway / VPC / …)

Anyway, thanks a lot for any help !

Best Answer

If I understand you correctly you want your outgoing traffic to pass through multiple of your network interfaces in a round robin fashion? If that's the case, and you're in a Linux environment, you should be able to use iproute2 and just change your default route.

Please have a look at this previous question for more information and an example.