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
已提问 2 年前261 查看次数
1 回答
1
已接受的回答

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
专家
已回答 2 年前
profile pictureAWS
专家
Chris_G
已审核 2 年前
  • 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.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则