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年前293ビュー
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.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ