You can't have two CIDR ranges and two private IPs with a NAT Gateway, right?

0

I assume the answer is "no" based on the following documentation, but just wanted to make sure:

You can pick the private IP address to assign to the NAT gateway or have it automatically assigned from the IP address range of the subnet. The assigned private IP address persists until you delete the private NAT gateway. You cannot detach the private IP address and you cannot attach additional private IP addresses.

Source: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-basics

AWS
已提问 1 年前703 查看次数
1 回答
1

Short Answer is: No Long Answer is: VPCs can have multiple CIDR ranges but a Subnet can only have a single IPv4 and IPv6 range assigned. As NAT devices have endpoints in the Subnet they can only be allocated a single IP per Subnet. Alternate Solution is: You could create multiple public subnets. The first set of subnets could be out of the primary CIDR and the second set of subnets with IPs out of the secondary CIDR(s). Then when creating the NAT have endpoints created in all subnets.

The question is why would you want a NAT Gateway to have 2 IPs? As both IPs would be considered "VPC Local" you would route to both IPs the same. The would be no real reason to want 2 IPs on the NAT device.

profile picture
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则