Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

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.

share|improve this answer
are you sure about that? i remember that it was once necessary for me to add the external (elastic) address as listening address to proftpd so one could connect from external. internal from another amazon instance worked. – The Shurrican Jan 5 '11 at 18:56
Flashman is right, you need not specify external IP address, ec2 takes care of the routing. As your app is not publicly visible, have you looked at the ec2 security group and allowed appropriate ports on it? – Tutul Apr 23 '12 at 21:07

Can I set the Elastic IP address to the IP address within the EC2 instance?

To my knowledge with EC2: no

Your instance can retrieve its assigned ip address by calling a site like from within. A simple python or perl script can be used for that. But I am not sure if that helps.

On the other hand, I have no problems with email servers setups etc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.