1 個回答
- 最新
- 最多得票
- 最多評論
1
Hello.
If a VPC does not have access to an Internet gateway, that VPC will not have an entrance/exit for communicating with the public network, so communication will not be possible even if a NAT Gateway is created.
NAT Gateway connects to the public network through the Internet gateway, so even if you create a NAT Gateway in a subnet that does not have a route to the Internet gateway, you will not be able to communicate to the public network.
Communication takes place as shown in the diagram in the document below.
https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-scenarios.html
相關內容
- 已提問 2 個月前
So in our case , when they are in same subnet , how should we create the route to internet gateway?
Does that mean EC2 and NAT Gateway are in the same subnet? I think that communication will probably not be possible even if the route to the Internet gateway and the route for the public access NAT Gateway are set in the same route table. Therefore, if you want to go through NAT Gateway, you will need to start EC2 in a private subnet and set a route to NAT Gateway in the route table.
Can u explain me why NAT should go through Internet gateway, why can’t this route the traffic alone
An internet gateway is linked to a VPC, but a NAT gateway is created within a subnet. The Internet gateway is your VPC's only gateway to the public network. If there is no Internet gateway, the VPC will lose the gateway to communicate with the public network, so even if there is a NAT Gateway, it will not be possible to communicate with the public network. https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html