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
preguntada hace un año643 visualizaciones
1 Respuesta
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
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas