Search code examples
azureazure-virtual-machineazure-virtual-networkazure-devtest-labs

Fix Port Range on Public IP for Azure DevTest Lab


Azure DevTest Labs now enable you to use a single public IP to access all your VMs via RDP (see here). It appears to work using NAT, whereby the load balancer will assign a different port number for each VM's RDP port.

Is it possible to define the range of port numbers that the load balancer is allowed to assign to each VM, so I have some idea of the port numbers it will be using?, e.g., 33890-33899


Solution

  • Is it possible to define the range of port numbers that the load balancer is allowed to assign to each VM

    For now, we can't define the range of port numbers that the load balancer is allowed to assign to the each VM.
    We can create devtest VM to use a private IP address and adds a NAT route to enable Internet connection via SSH/RDP (IP address configuration is shared). enter image description here In this way, we can via RDP or SSH to connect this VM with the port, but we can't modify the port, the VM under a internet load balancer, and the NAT rule was created automatically, the load balancer is managed by azure, we can not change any settings. enter image description here

    Also, we can create a devtest VM to use a public IP address (IP address configuration is Public). In this way, we can connect the VM with the public IP address direct, for example, RDP the public IP address with port 3389, then we can connect to this VM. We can't use load balancer NAT rules to do this, because we can't add the VM to an available set.