Can someone explain to me what actually happens in the back-end to the load balancer (v2) for the two scenarios:
Applying Inbound NAT rules.
Applying Load Balancing Rules.
Can someone explain to me what actually happens in the back-end to the load balancer (v2) for the two scenarios:
Applying Inbound NAT rules.
Applying Load Balancing Rules.
You would use NAT rule when you have 1 backend server or you know which backend server to get to and loadbalancing rule when you want to loadbalance to multiple backend servers.
NAT rule must be explicitly attached to a VM (or network interface) to complete the path to the target; whereas Load Balancing rule need not be. In the latter case, a VM is selected (from the back-end address pool or VMs) to complete the path to the target.
this documentation link will help: https://learn.microsoft.com/en-us/azure/load-balancer/components#inbound-nat-rules
We added examples to help clarify. You can think of inbound NAT rules as a special type of Load Balancing rules to reference specific VMs.
-- Anavi N Senior PM load, Azure Load Balancer
Please note that "Load balancing rule" used to distribute the traffic to available backend VMs while "Inbound nat rule" used to forward the traffic to a specific VM.
For example, assume your front end IP is 10.10.10.4 while you have three VMs in the backend pool which is having IP's of 10.10.10.5, 10.10.10.6, 10.10.10.7 respectively.
If you want to distribute the traffic which hits your frontend IP to all the three backend VMs, you will use "load balancing rule" option.
If you want to forward the traffic which hits your frontend IP to a specific VM 10.10.10.5 then you will use "inbound nat rule" option.
So in simple words,
Load balancing rule - Distributes,
Inbound nat rule - Forwards