Reputation: 2527
I'm trying to create two routes for two nat gateways that live in separate subnets. Is there a reason why they can't have a destination cidr block of 0.0.0.0/0?
Upvotes: 6
Views: 2537
Reputation: 269881
I presume that you are wanting to create a Highly Available network that is using multiple NAT Gateways in separate Availability Zones.
This is a common design requirement. Amazon EC2 instances in a private subnet that wish to communicate with the Internet require a route to a NAT Gateway (or a NAT Server). To remain highly available, you will need a NAT Gateway in each Availability Zone and a different route table for each Availability Zone.
Then:
0.0.0.0/0
route that points to NAT Gateway A.0.0.0.0/0
route that points to NAT Gateway B.Each route table can only have one entry for a given CIDR range. The VPC selects the most-restrictive CIDR range that matches, so the 0.0.0.0/0
entry will be the last one referenced.
Upvotes: 8