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 & 2 to each vm by following azure doc. My questions is how this port forwarding works in the below NAT rules
azure network lb inbound-nat-rule create --resource-group nrprg --lb-name ilbset --name NATrule1 --protocol TCP --frontend-port 5432 --backend-port 3389
azure network lb inbound-nat-rule create --resource-group nrprg --lb-name ilbset --name NATrule2 --protocol TCP --frontend-port 5433 --backend-port 3389.
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
azure network lb inbound-nat-rule create --resource-group nrprg --lb-name ilbset --name NATrule1 --protocol TCP --frontend-port 3389 --backend-port 5432
azure network lb inbound-nat-rule create --resource-group nrprg --lb-name ilbset --name NATrule2 --protocol TCP --frontend-port 3389--backend-port 5433.
(I'm doing this through CLI 2.0) Any help will be greatly appreciated. Thanks.