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?

alx
已提問 7 個月前檢視次數 266 次
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
專家
已回答 7 個月前
profile picture
專家
已審閱 1 個月前
  • Thanks Karthikiran, I could test and it works perfectly!

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南