Why it isn’t re-assigned a public IP address and public IP DNS for a Instance in a public subnet after stopped and started in case of attached 2 eni.

0

Problem Description: It isn’t re-assigned a public IP address and public IP DNS for a Instance in a public subnet after stopped and started in case of attached 2 eni.

Symptom with screenshot

Step 1. Initialized Instance

Initialized Instance - EC2 Dashboard

Initialized Instance -Instance Summary

Successful SSH connection

Step 2. Stopped Instance

Stopped Instance - EC2 Dashboard

Stopped Instance - Instance Summary

Step 3. Re-Started Instance

Re-Started Instance : Not shown Public IP address and DNS - EC2 Dashboard

Re-Started Instance : Not shown Public IP address and DNS -Instance Summary

Step 4. Rebooted Instance

Rebooted Instance : Still not shown Public IP address and DNS - EC2 Dashboard

Rebooted Instance : Still not shown Public IP address and DNS - Instance Summary

Question #1. Is that normal?

Question #2. Why it isn’t re-assigned a public IP address and public IP DNS with this case

Question #3. How I can prevent with re-assigned public IP address and public IP DNS with this this case

Felix
demandé il y a 2 ans293 vues
1 réponse
1
Réponse acceptée

See below 2 points from the documentation; what you are seeing is expected behavior. You can use Elastic IP instead of Public IP if you want persistent behavior.

  • We release your instance's public IP address when it is stopped, hibernated, or terminated. Your stopped or hibernated instance receives a new public IP address when it is started.

  • You cannot auto-assign a public IP address if you specify more than one network interface. Additionally, you cannot override the subnet setting using the auto-assign public IP feature if you specify an existing network interface for eth0.

profile pictureAWS
EXPERT
répondu il y a 2 ans
profile pictureAWS
EXPERT
Chris_G
vérifié il y a 2 ans
  • Thank you for your answers. Can I ask 2 more questions from your answers?

    1. Why it can't be auto-assigned a public IP address in case of 2 more eni on an instance

    2. Do you mean it will keep the elastic IP on the primary eni although it has 2 more eni?

  • Think of Public IP as ephemeral entity (temp) if you want persistent IP use Elastic IP which you can attach/detach to any of the ENI on-demand.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions