![](/img/trans.png)
[英]Getting issue while trying to access internet from private-subnet instance via nat intance in aws?
[英]Internet access from Private Subnets through NAT instance in AWS
我正在尝试通过NAT实例从专用子网实例访问Internet。 我已按照以下网址中的步骤进行操作。
http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html
通过上述所有步骤,我可以在NAT实例上访问Internet。 但是无法从私有IP实例访问Internet。
From NAT Instance
$ ping ietf.org
PING ietf.org (4.31.198.44) 56(84) bytes of data.
64 bytes from mail.ietf.org (4.31.198.44): icmp_seq=1 ttl=49 time=23.8 ms
64 bytes from mail.ietf.org (4.31.198.44): icmp_seq=2 ttl=49 time=23.9 ms
64 bytes from mail.ietf.org (4.31.198.44): icmp_seq=3 ttl=49 time=23.9 ms
^C
--- ietf.org ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 23.888/23.940/23.976/0.037 ms
From Private IP Instances
$ ping ietf.org
PING ietf.org (4.31.198.44) 56(84) bytes of data.
^C
--- ietf.org ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 5999ms
我可以从私有IP实例ping NAT实例。
我已经检查了以上URL中提供的所有以下步骤。 一切看起来都很好。
If the ping command fails, check the following information:
Check that your NAT instance's security group rules allow inbound ICMP traffic from your private subnet. If not, your NAT instance cannot receive the ping command from your private instance.
Check that you've configured your route tables correctly. For more information, see Updating the Main Route Table.
Ensure that you've disabled source/destination checking for your NAT instance. For more information, see Disabling Source/Destination Checks.
Ensure that you are pinging a website that has ICMP enabled. If not, you will not receive reply packets. To test this, perform the same ping command from the command line terminal on your own computer.
一些帮助将不胜感激。 谢谢。
根据您提供的信息,架构设置的所有填充似乎都是我在NAT Instant安全组中发现的唯一错误。
根据AWS建议进行NAT即时配置:
入站:
80、443-用于私有子网的私有IP实例/私有IP地址范围
22-家庭网络的公共IP地址范围
出站:
80,443-- 0.0.0.0/0
试试这个会起作用
参考: http : //docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html
请在上述文档中找到NATSG:推荐规则部分。
一切似乎都很好,但您唯一想念的就是子网协会
如果您需要有关子网关联的更多信息,请参考以下URL:
http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.