重新启动后更改EC2实例的IP地址 [英] An IP address of EC2 instance gets changed after the restart

查看:479
本文介绍了重新启动后更改EC2实例的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行EC2 Linux实例。为了进行一些维护,我关闭了实例,然后再次启动它。但是,EC2 IP现在已经更改。

I am running an EC2 Linux instance. For some maintenance purposes I shutdown the instance and started it again. However, EC2 IP has changed now.

如何在停止后保持Amazon EC2实例的IP地址不变并重新启动?

How to keep an IP address of Amazon EC2 instance unchanged after stop and start it again?

推荐答案

实际上,当您停止/启动实例时,IP地址将更改。如果重新启动实例,它将保留相同的IP地址。不幸的是,我们无法将地址重新分配给您的实例,因为该地址将被释放回其他EC2实例使用的池中。

Actually, When you stop/start your instance, the IP address will change. If you reboot the instance, it will keep the same IP addresses. Unfortunately, it is not possible for us to reassign the address to your instance as that address would have been released back into the pool used by other EC2 instances.

如果您希望将来避免出现此问题,请根据您的需要:

If you want to avoid this issue in the future, depending on your needs:


  • 如果仅需要固定的公共IP地址,则可以为实例分配弹性IP地址。

  • 如果需要公共IP地址和私有IP地址在整个过程中保持不变。实例的生命周期内,您可以在VPC中启动实例。在VPC中分配给实例的私有IP地址一直保留到实例直到终止。

要了解更多信息,请参见aws文档< a href = https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html rel = noreferrer>分配弹性ip 。

To learn more, see the aws documentation to assign elastic ip.

这篇关于重新启动后更改EC2实例的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆