How to set IP address of Amazon EC2 instance to its Elastic IP

amazon ec2amazon-elastic-ipamazon-web-services

I have an Amazon EC2 instance running and I am installing a program on it that needs to know what the machine's IP address is. Can I set the Elastic IP address to the IP address within the EC2 instance?

Its okay if it reroutes data packets somewhere 'outside' and then back to itself, but the software NEEDs me to specify an IP address of the machine its on.


I proceeded with the software installation using the "local IP" (10.xx.xx.xx) within the software installation. I don't know if this is the reason why the application is not visible publicly (as I'm trying to determine in the question Allowing web access to an Amazon EC2 Windows Server 2008 instance running Tomcat+application?)

Best Answer

You should always have the instance applications bind to the local address (10.x.x.x) since this is what the machines see as their ethernet connection. The external IP address is an address you can reach externally, then Amazon takes care of routing that to the actual machine.

You other question answers this question more explicitly for your case though.

Related Topic