1

I have setup an AWS EC2 instance with a Elastic IP.

Static IP and Elastic IP both works fine (shows default NGINX page).

However when I STOP the instance and START back up, there is only a domain for public IP field

http://ec2-xx-xx-xx-xxx.compute-1.amazonaws.com/

and above domain resolve to instance's public IP.

The problem is instance cannot make any outgoing requests (WGET, CURL, update, install packages ).

The reason is there is no public IP associated to the instance private IP. ( below image )

enter image description here

As you can see first 172.31.X.X does not have a public IP ( had before STOP/START ).

This happens from the first STOP/START instance.

However if I STOP/START without setting up an Elastic IP, AWS automatically associate a new public IP.

Any idea why this is happening?

Navi Gamage
  • 113
  • 3

1 Answers1

4

This is by design. You will need to re-associate the EIP when starting your instance.

EEAA
  • 109,363
  • 18
  • 175
  • 245