无法从 VPC 内部访问 public 个实例 IP 地址

Cannot access public instance IP address from inside VPC

我刚刚在 VPC 中启动了两个实例。我已将安全组配置为允许来自同一安全组中实例的所有流量。两个实例共享此安全组。我为每个实例分配了一个弹性 IP,这是一个 public IP。这两个实例无法使用此 IP 相互通信,但如果我使用两个实例的私有 IP,则一切正常。如何在此 VPC/安全组中启用 public IPs 的使用?

来自http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html

When you specify a security group as the source or destination for a rule, the rule affects all instances associated with the security group. Incoming traffic is allowed based on the private IP addresses of the instances that are associated with the source security group (and not the public IP or Elastic IP addresses).

Public(是否为弹性 IP)和私有 IP 地址 不可 可互换。 public IP 是 NATed 地址(网络地址转换)。它不会从实例解析为 localhost(除非您编辑了 /etc/hosts)并且它不适用于安全组成员。