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 年前檢視次數 702 次
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 年前

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

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

回答問題指南