15

Can someone explain to me what actually happens in the back-end to the load balancer (v2) for the two scenarios:

  1. Applying Inbound NAT rules.

  2. Applying Load Balancing Rules.

Ajov Crowe
  • 459
  • 3
  • 8
  • 17
  • 3
    Load balancing rule maps a given front end IP and port combination to a set of back end IP addresses and port combination whereas NAT rules define the inbound traffic flowing through the front end IP and distributed to the back end IP. For e.g. You use a NAT rule to translate all incoming traffic on port a to port b and you use LB rule to balance all incoming traffic on port 80 of public ip to port 80 on the set of addresses in the back end pool – Gandhali Samant Apr 01 '16 at 06:59
  • Is there any change in the firewall level for the LB in both the cases, as we do not have control on this? – Ajov Crowe Apr 01 '16 at 07:12
  • i dont think so, but would confirm and get back – Gandhali Samant Apr 01 '16 at 07:36

4 Answers4

12

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.

Ratish
  • 136
  • 1
  • 3
4

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.

Puja
  • 41
  • 3
  • 1
    Thanks for your answer, but it is still not clear. When would I need to user load balancing rules and when to use inbound NAT rule? – user2931442 Sep 20 '17 at 21:03
  • @user2931442 - When your software running on multiple VMs with different custom ports choose Inbound NAT rules if not chose LB rules – Uday Kiran May 06 '21 at 06:26
2

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

Anavi N
  • 116
  • 2
2

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

myeongkil kim
  • 2,465
  • 4
  • 16
  • 22