Azure NAT Gateway - when to use Public IP vs IP Prefix

MVP

When configuring outbound IP addressing, what is downside to using Public IP vs IP Prefix when associating to a subnet that has 2 more VMs? The are not load balanced together.

1 Reply

Basically, one public IP will give you 64k ephemeral ports for outbound connections. If you exhaust all these ports then you will see SNAT port exhaustion and your outbound connections will fail randomly. If you are expecting more than 64k simultaneous connections then you can use an IP prefix to get more ports for outbound connections.

You can read more about this scenario here: https://learn.microsoft.com/en-us/azure/virtual-network/nat-gateway/nat-gateway-resource#scalability