Use Public NAT for VPN connection

0

Hi,

I'm following the answer on https://repost.aws/questions/QUXOVWxXXrTDquDf54D27yrQ/use-nat-gateway-behind-a-transit-gateway

I have created a public NAT IP accordingly, and added a route in my relevant subnets to access the client target subnet using the NAT gateway.

However, the traffic doesn't go through the VPN.

Basically:

  • We need to access subnet #2 from subnet #1, using "Public NAT IP Geteway".

My configuration goes as suggested: Subnet #1 with routing to subnet #2 via "Public NAT IP Gateway" -> Transit gateway -> Client subnet

However, it doesn't look like the subnet #1 is actually reaching the client subnet, as my routing goes through a NAT Gateway instead of the Transit gateway.

Do I need to take extra steps to ensure AWS understands my traffic needs to go through the Transit gateway?

1개 답변
0
수락된 답변

Hello Alx,

Referring https://repost.aws/questions/QUXOVWxXXrTDquDf54D27yrQ/use-nat-gateway-behind-a-transit-gateway , I understand you can already reach from EU VPC to the Client Subnet via NAT Gateway IP (this would be the Private IP of the NAT Gateway in the /27 subnet , which the Client will see from their end. Public/Elastic IP is not used unless traffic goes through Internet Gateway, so I would like to correct the answer posted on previous question)

Now coming to: APAC VPC -> APAC Transit gateway -- TGW Peering -- EU Transit Gateway -> EU VPC -> Route via NAT Gateway of the /27 subnet -> Transit gateway -> Client subnet

  1. Make sure APAC VPC subnets have Route: Client subnet --> APAC Transit Gateway
  2. On APAC Transit Gateway the APAC VPC attachment Route table: Client subnet --> EU Transit Gateway via TGW Peering
  3. On EU Transit Gateway Peering attachment Route table: Client subnet --> EU VPC attachment

Next, EU Transit Gateway would be sending traffic to 'associated' subnets of EU VPC. Traffic would be checked against the associated subnet's route table. The associated subnet should NOT be the /27 subnet as this would mess up routing and skip the NAT Gateway. Associated subnet should be the other subnets in EU VPC, which already have the following Route: Client subnet --> Nat Gateway.

If the above is taken care of, you can reach from APAC VPC to Client Subnet. Make sure the routes are also in place for return traffic to reach the APAC VPC from the Client Subnet.

Feel free to ask any additional clarifying questions and we'd be happy to answer.

profile pictureAWS
전문가
답변함 8달 전
profile picture
전문가
검토됨 2달 전
  • Thanks Karthikiran, I could test and it works perfectly!

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인