只有一个 public 子网连接到 VPC,并向该 public 子网实例添加了 NAT 网关,但我无法使用 NAT ip 地址访问该实例

Had only one public subnet to VPC, and added NAT gateway to that public subnet instance, but i'm not able access the instance using NAT ip address

我只有一个 public 子网连接到 VPC,并向该 public 子网添加了 NAT 网关,但我无法使用 NAT ip 地址访问该实例。

@1)I'm able to ping the instance, with public Ip address(added icmp to security group), but by using NAT elastic IP address i'm not able to ping.

@2)Does NAT is applicable for single public subnet or not. My goal is to translate the ip address attached to public subnet instance.

我认为您使用了错误的服务来完成您想要做的事情。

AWS 服务 NAT Gateway 用于将出站流量从私有子网路由到互联网。它不路由入站请求。

确保你有:

  1. Internet 网关 用于您的 VPC (docs)。
  2. A public IPv4 用于您的实例。

NAT 网关 (docs) 用于服务在私有子网(在 VPC 内)内从子网内部向互联网发送请求。源地址为弹性 IP。

Internet 网关 用于所有 VPC 以建立基本级别的 Internet 连接。它负责路由到具有 public IP 的 EC2 实例。

我对此有解决方案,将 NAT 网关私有 IP 提供给私有服务器@DNS 位置,然后您就可以访问互联网了。 如果你想测试你需要有一个 IP 地址为 public 的服务器,然后使用第二个(私有服务器)的远程服务器并测试它是否可以工作。 任何其他信息 https://www.youtube.com/channel/UCEYPy7Dt4UJa_UvUrsRmjoQ https://www.linkedin.com/in/mohan-reddy-79a57014b/