3

I'm using an elastic IP for one of my EC2 instances. I can reach the instance via the elastic IP from external machines, but from other machines in my EC2 configuration, I can ONLY reach the machine by its private IP.

How can I fix this? I want my other EC2 instances to have a static reference to the machine with an elastic IP, so that if that private IP changes, I don't have to reconfigure all of my instances.

Thanks.

Bill
  • 181
  • 7

1 Answers1

4

Bill you should be using the private IP to reach your instances internally so that you don't get charged for the data transfer between them. In order to do this without having to reconfigure your software, you can setup CNAME references in your DNS to translate a static name under one of your domains to the elastic IP address. By doing this lookup of the elastic IP by CNAME, the amazon DNS system will catch the lookup and return the INTERNAL address instead of the external one that everybody in the external world will get. Viola, best of both worlds! Static dns names in software, and external people get your elastic IP and your internal instances get internal IP routes with no data charges!

Also, your elastic IP is routable from inside EC2, but you have to open up the firewall special for it I think.

Edit: For more reference and howtos on this issue see the writups on Alestic and Apparently So. There is also a question referencing the issue here on ServerFault.

Caleb
  • 11,583
  • 4
  • 35
  • 49