NAT gateway not working

0

I am trying to set up a subnet and route that has a single outgoing IP. I set up a route to a NAT gateway but it does not appear to work. If I swap the NAT for an IGW then the instances on that subnet have internet access. If I change it to a NAT they do not.

質問済み 10ヶ月前297ビュー
2回答
0

Are the instances in a private or public subnets? Do they have a public IP address or only a private IP address? If the instances are in a private subnet, then you route the traffic of that subnet to the NATGW and then to the IGW. https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html

profile pictureAWS
Matt_E
回答済み 10ヶ月前
profile pictureAWS
エキスパート
iBehr
レビュー済み 10ヶ月前
0

The instances need to be in a private subnet where the route table attached to the private subnet has a route for your destination IP and a target of the NAT Gateway. The NAT Gateway needs to be in a public subnet where the route table attached to the public subnet has a route of all non-local destinations (0.0.0.0/0) has a target of the internet gateway.

ref: NAT gateway use cases

profile pictureAWS
エキスパート
kentrad
回答済み 10ヶ月前
profile picture
エキスパート
レビュー済み 10ヶ月前
profile picture
エキスパート
レビュー済み 10ヶ月前
  • To add, any instances that need direct internet access NOT via a NAT Gateway need to be in a Public Subnet with a Public IP Address with a route to an IGW

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ