为EC2实例保留相同的IP地址 [英] Keep same IP address for EC2 Instance

查看:259
本文介绍了为EC2实例保留相同的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次停止/启动实例时,EC2实例是否更改您实例的IP地址吗?有没有办法保持IP地址不变?

Do EC2 instances change the IP address for your instance each time you stop/start the instance? Is there a way to keep the IP address constant?

推荐答案

,有一种方法:

Yes, there is a way: Elastic IP Addressing.

默认情况下,AWS实例使用动态IP地址启动,这意味着每次服务器停止和重新启动时,IP地址都会更改.在许多情况下,这是不希望的,因此,用户还可以选择为服务器分配静态IP地址(也称为弹性IP").

AWS instances are launched with a dynamic IP address by default, which means that the IP address changes every time the server is stopped and restarted. In many cases, this is not desired and so, users also have the option to assign the server a static IP address (also known as an "elastic IP").3

根据Amazon 1 2 :

According to Amazon 1, 2:

弹性IP地址是为动态云计算设计的静态IPv4地址.弹性IP地址与您的AWS账户关联.使用弹性IP地址,可以通过将地址快速重新映射到帐户中的另一个实例来掩盖实例或软件的故障.

An Elastic IP address is a static IPv4 address designed for dynamic cloud computing. An Elastic IP address is associated with your AWS account. With an Elastic IP address, you can mask the failure of an instance or software by rapidly remapping the address to another instance in your account.

并且:

您可以免费拥有一个与正在运行的实例关联的弹性IP(EIP)地址.如果您将其他EIP与该实例相关联,则将按小时按每小时与该实例相关联的每个其他EIP收费.其他EIP仅在Amazon VPC中可用.

You can have one Elastic IP (EIP) address associated with a running instance at no charge. If you associate additional EIPs with that instance, you will be charged for each additional EIP associated with that instance per hour on a pro rata basis. Additional EIPs are only available in Amazon VPC.


要配置静态IP地址:

  • 登录到AWS EC2仪表板.如果需要,请使用区域选择器在右上角切换到启动实例的区域.
  • 在仪表板中选择实例.
  • 在左侧导航栏中,选择网络和安全->弹性IP"菜单项.
  • 单击分配新地址"按钮.

有关设置的更多详细信息,请参见配置静态IP地址.

For more details on setting it up, see Allocating an Elastic IP Address and Configure a static IP address.

如果弹性IP地址未与运行中的实例相关联,或者与已停止的实例或未连接的网络接口相关联,则按小时收取小笔费用.费用按比例分配,并取决于地区;有关详细信息,请访问 Amazon EC2定价.

There is a charge a small hourly charge if an Elastic IP address is not associated with a running instance, or if it is associated with a stopped instance or an unattached network interface. The charge is prorated and depends on the region; details can be found on Amazon EC2 Pricing.

这篇关于为EC2实例保留相同的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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