Boto3如何将公共IP地址附加到网络接口

huangapple go评论59阅读模式
英文:

Boto3 how to attach public IP addresses to network interface

问题

使用Boto3的create_instances()函数创建实例。

根据AWS实例页面,一些网络接口支持多达五十个IPv4地址。

我想要有多个网络接口,每个接口都有多个公共IP地址。

  1. 我需要附加网络接口吗,还是它们随实例一起提供?
  2. 如何将公共IP地址附加到每个接口?

IP地址的值不重要,也不需要匹配任何内容,我只是需要额外的公共IP地址用于出站流量。

英文:

I'm creating instances using Boto3's create_instances() function.

According to the AWS Instances page, some network interfaces support up to fifty IPv4 addresses.

I would like to have multiple network interfaces, each with multiple public IP addresses.

  1. Do I need to attach the network interfaces, or do they come with the instance?
  2. How do I attach the public IP addresses to each interface?

The IP address value doesn't matter/need to match anything, I just need additional public IP addresses for outgoing traffic.

答案1

得分: 1

当您启动一个实例时,您可以选择是否希望将该实例与现有的网络接口关联。

如果是,您指定的网络接口将被分配给该实例。<br>
如果不是,则会创建一个新的接口并分配给该实例。

如果您希望在实例启动后关联现有的网络接口,您可以使用attach_network_interface

网络接口是否具有公共 IP 取决于它所在的子网配置。

英文:

When you launch an instance, you can choose whether or not you wish to associate the instance with existing network interfaces.

If you do, the network interfaces you specified will be assigned to the instance. <br>
If you don't, a new interface will be created and assigned to the instance.

If you wish to associate existing network interfaces after the instance has been launched you can use attach_network_interface.

Whether or not the network interface has a public ip will depend on the configuration of the subnet in which it is created.

huangapple
  • 本文由 发表于 2023年3月15日 21:09:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/75745186.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定