In this post, I will show you how to use the Azure Load Balancer to easily setup port forwarding to Azure Resource Manager (ARM) Virtual Machines (VM).
This blog post is part of a two-part series on the topic of “Port forwarding in Azure Resource Manager Virtual Machines with Azure Load Balancer”:
I really hope you enjoy this two-part series and feel free to post your comments.
I can think of at least two reasons why you want to use port forwarding to ARM Virtual Machines:
The trick is to use the Azure Load Balancer as part of the following setup:
The diagram below shows an overview of a setup where an external Microsoft Remote Desktop (RDP) client connects to a VM on port 8088 and 8089, but the receiving VMs wants to stay compatible with the standard RDP port (3389) internally:
Based on the port number (8088) requested by the client the corresponding NAT rule is selected.
This NAT rule then redirects the traffic into the VM0s internal IP (10.0.1.1) on port 3389. The NAT rule is configured specifically to redirect to VM0 and Custom Port Mapping ensures that port 8088 is translated into port 3389.
VM0 receives RDP traffic on port 3389 (the standard port for RDP) and never needs to do any tricks to support the non-standard port 8088; hence staying compatible with other clients that rely on port 3389 for RDP access.
Step , and :
These steps are basically the same is step 1-4, but in this case, the client requests port 8089. The NAT rule (in step 6) is now redirecting to VM1 because port 8089 activates the NAT rule which redirects traffic to VM1 (IP 10.0.1.2) on port 3389.
Do you want to see a real-life example of how you can implement this yourself using the Azure Portal?
If the answer is yes then follow on to Part 2!14
AZURE NEWS: “Creating Azure Functions using .NET 5” (preview)
Big rise in Azure SQL’s popularity
“Build REST APIs in three steps with API Management and Azure Functions”
Two new Azure Key Vault features (October 2020)
Azure API Management updates – October 2020