Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
I understand that you would like to know more about NAT Gateway.
The main and notable difference between a Load Balancer SNAT and NAT Gateway is that,
- NAT Gateway uses dynamic ports for new connections based on demand of each VM
- where as, Azure LB has already pre allocated the ports to a backend VM and will only use the ports from this pre allocated pool of ports.
NAT gateway can scale up to over 1 million SNAT ports, supporting upto 16 Public IP Addresses.
A single public IP address provides 64,512 SNAT ports to make outbound connections.
Also, the NAT Gateway can resuse a SNAT port in case new connections are being made to a different IP. So, even after 64,512 SNAT connections, there will still be newer connections using a single IP.
As you can see, with NAT Gateway, there is no concept of manually allocating ports to individual VMs. Every thins is automatically taken care of by Azure Platform.
P.S :
- NAT gateway takes precedence over other outbound scenarios (including Load balancer and instance-level public IP addresses) and replaces the default Internet destination of a subnet
- This is by design and you cannot distribute traffic between LB and NAT Gateway
References:
- https://learn.microsoft.com/en-us/azure/virtual-network/nat-gateway/nat-overview
- https://learn.microsoft.com/en-us/azure/virtual-network/nat-gateway/nat-gateway-resource
Kindly let us know if this helps or you need further assistance on this issue.
Thanks,
Kapil
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.