Is it possible to have the Elastic IP (attached to the interface in the AWS console) available as the interface IP withing virtualized machine - currently eth0's IP is the private IP and the routing from EIP to the machine is done via some kind of NAT henceforth it's not possible for the running application to bind to the defined Elastic IP.
-
1Why do you need to bind to the public IP? Given 1:1 NAT, why wouldn't binding to the private IP work just fine? – Skyhawk Nov 16 '12 at 16:09
-
yeah, it kinda works but... while I get traffic just fine I also need to announce those particular EIPs. Bottomline - it will probably require some tweaking in the application to bind locally while correctly announce/serve public IPs – Wojtek Nov 17 '12 at 20:07
-
Good idea. This might help: http://stackoverflow.com/questions/7525702/how-to-find-the-ip-address-of-an-amazon-ec2-instance-on-reboot – Skyhawk Nov 17 '12 at 20:12
1 Answers
No, it is not possible. Elastic IPs are tied to your account, not to individual instances, so the instance's interface IP will always be private.
EC2 Private IP Address: The internal RFC 1918 address of an instance that is only routable within the EC2 Cloud. Network traffic originating outside the EC2 network cannot route to this IP, and must use the Public IP or Elastic IP Address mapped to the instance.
EC2 Public IP Address: Internet routable IP address assigned by the system for all instances. Traffic routed to the Public IP is translated via 1:1 Network Address Translation (NAT) and forwarded to the Private IP address of an instance. The mapping of a Public IP to Private IP of an instance is the default launch configuration for all instance types. Public IP Addresses are no longer usable upon instance termination.
EC2 Elastic IP Address: Internet routable IP address allocated to an AWS EC2 account. Similar to EC2 Public Address, 1:1 NAT is used to map Elastic IP Addresses with their associated Private IP addresses. Unlike a standard EC2 Public IP Address, Elastic IP Addresses are allocated to accounts and can be remapped to other instances when desired.
Source: this article on elastic IPs.
If this really is a deal-breaking feature, Rackspace next gen cloud servers gives you a public IP on eth0 by default.

- 505
- 4
- 18
-
Thanks. That would be nice, unfortunately it's not my decision which cloud provider to use... – Wojtek Nov 17 '12 at 20:08