跳至內容

Using a Regional NAT gateway for centralised IPv4 egress

0

I want to centralised internet access via a VPC containing a Regional NAT Gateway. The Regional NAT gateway is created within a VPC attached to a Transit Gateway, with other workload VPCs attached to the same Transit Gateway. I can route internet traffic from my workload VPCs to the NAT VPC. But the Regional NAT Gateway automatically creates an 'Edge Association' route table with a default route (0.0.0.0/0) to the VPC's Internet Gateway and a 'local' route for the VPC CIDR. I cannot create a route in this route table to route my workload VPC CIDR ranges across the Transit Gateway. I have created routes to my workload CIDRs within the subnets hosting the NAT Gateway VPC Transit Gateway attachment interfaces, directing workload traffic to the Transit Gateway, but this appears to have no effect - i.e. I am unable to route return traffic from the Regional NAT Gateway to my workload VPCs via the Transit Gateway.

Is this a limitation of Regional NAT Gateways, or is there something in my configuration that may be incorrect?

已提問 8 個月前檢視次數 645 次

4 個答案
1
已接受的答案

This has been resolved as of May 2026 so it's now possible to add your Transit Gateway to the Regional NAT Gateway's route table.

已回答 4 個月前

1

Thank you Agent for your reply!

If this is indeed a current limitation of Regional NAT Gateways, I think it would be useful to highlight this constraint within the documentation pages.

已回答 8 個月前

0

Based on the current capabilities of Regional NAT Gateways, what you're experiencing appears to be a limitation rather than a configuration issue. The Regional NAT Gateway's edge association route table is AWS-managed and contains a default route pointing directly to the VPC's Internet Gateway, along with local routes for the VPC CIDR. This route table cannot be modified to add custom routes for your workload VPC CIDR ranges.

For centralized IPv4 egress using Transit Gateway with multiple spoke VPCs, the traditional approach uses standard (per-AZ) NAT Gateways rather than Regional NAT Gateways. With standard NAT Gateways, you have full control over the subnet route tables where the Transit Gateway elastic network interfaces (ENIs) are located. This allows you to add the necessary routes pointing spoke VPC traffic back to the Transit Gateway as the next hop, which is essential for return traffic flow.

The typical centralized egress architecture works as follows: you add a static route in the Transit Gateway route table pointing all internet traffic to the egress VPC. Once traffic reaches the egress VPC through the Transit Gateway ENIs, it follows routes in the subnet route tables that direct traffic to the NAT gateway. Critically, for return traffic, you must add route table entries in the NAT gateway subnet pointing spoke VPC-bound traffic back to the Transit Gateway.

Since the Regional NAT Gateway's routing table is not customizable and automatically routes traffic directly to the Internet Gateway without the ability to redirect return traffic through the Transit Gateway, it appears that Regional NAT Gateways are not currently designed to support centralized egress architectures with Transit Gateway. For your use case, standard NAT Gateways deployed in the egress VPC would be the appropriate solution, as they provide the routing flexibility needed for this architecture.
Sources
Using the NAT gateway for centralized IPv4 egress - Building a Scalable and Secure Multi-VPC AWS Network Infrastructure
Introducing Amazon VPC Regional NAT Gateway | Networking & Content Delivery

已回答 8 個月前

AWS
專家

已審閱 7 個月前

專家

已審閱 8 個月前

0

Hello.

The following is a Japanese blog, which explains that if you specify the Transit Gateway ENI in the edge route table, it will be routed to the Transit Gateway.
However, as mentioned in the blog, if you specify the ENI of the Transit Gateway directly, if a failure occurs in the availability zone, routing to the Transit Gateway will not be possible, resulting in a loss of communication.
Therefore, for now, I recommend using a NAT Gateway deployed in an Availability Zone rather than a Regional NAT Gateway to aggregate outbound communications to the Internet.
https://dev.classmethod.jp/articles/regional-nat-gateway-centralized-egress/

專家

已回答 8 個月前

AWS
專家

已審閱 7 個月前

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

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