title: How NAT port forwarding works in Internal Load Balancer in azure?
body: <p>I'm trying to create a internal load balancer in azure to manage the traffic. I have two VM's attached to the Backend pool and assigned a private ip for FE Load Balancer and attached NATrule1 &amp; 2 to each vm by following azure doc. My questions is how this port forwarding works in the below NAT rules</p>
  <blockquote>
  <p>azure network lb inbound-nat-rule create --resource-group nrprg --lb-name ilbset --name NATrule1 --protocol TCP --frontend-port 5432 --backend-port 3389</p>
  <p>azure network lb inbound-nat-rule create --resource-group nrprg --lb-name ilbset --name NATrule2 --protocol TCP --frontend-port 5433 --backend-port 3389.</p>
  </blockquote>
  <p>Frontend is having different port number and backend is having same port number. When the traffic comes through two ports in front end, how backend port will decide to which vm traffic should be sent ? Isn't that port numbers should be reverse like</p>
  <blockquote>
  <p>azure network lb inbound-nat-rule create --resource-group nrprg --lb-name ilbset --name NATrule1 --protocol TCP --frontend-port 3389 --backend-port 5432</p>
  <p>azure network lb inbound-nat-rule create --resource-group nrprg --lb-name ilbset --name NATrule2 --protocol TCP --frontend-port 3389--backend-port 5433.</p>
  </blockquote>
  <p>(I'm doing this through CLI 2.0)
  Any help will be greatly appreciated.
  Thanks.</p>