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 want to assign a reserved IP for an instance on EC2 so that I can use it in my configuration files. I associated an elastic IP with that instance but it changed when I stopped the instance. I have to setup application which depends on IP of instance, if IP changes, my application will fail to work. Please suggest a way so that the IP remains associated with instance permanently.

share|improve this question
up vote 3 down vote accepted

Deploy inside of a VPC. When you do this, you get many additional benefits, one of which are EIP mappings that persist through reboots.

VPC usage is free, they're quite simple to set up, so there's no good reason to not use them.

share|improve this answer
I'd +1 this a dozen times if I could. VPC is absolutely the way to go. – ceejayoz Mar 25 '13 at 13:48

An Elastic IP address is the correct answer. It will be deallocated when you stop the instance, but you can allocate it back to the instance after you have restarted it. If necessary, you can write a startup script on the instance that will automatically allocate the Elastic IP address.

share|improve this answer
I am using Windows 2008 Server R2. Where and how should I write a startup script ? – Ashutosh Narayan Mar 25 '13 at 7:19
there is an option to associate elastic IP every time the instance is rebooted. Will the startup script take care of this,as there is only one network interface through which communication happens ? – Ashutosh Narayan Mar 25 '13 at 8:41

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.