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 年前檢視次數 264 次
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.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南