Secure Connect to Azure Vm via VPN and RDP

Benjamin Stehle 21 Reputation points
2021-10-14T13:06:04.997+00:00

Hi there.

I am new to Azure and I need some advice.

I set up an Azure VM with Windows Server 2019 Datacenter. After deploying the VM I have the VM, a public IP, and a virtual network, called VNet1 (for example).
Connecting to this VM via the public IP and with an all-open 3389 works fine. But of cource, I do not want to all-open this port to public internet!

So I want to securely connect to this VM via RDP using an VPN.
I used to "step-by-step-describtion" at https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-point-to-site-resource-manager-portal to set up the point-to-site-VPN

With this tutorial I created a new virtual network called VNet2 and a virtual network gateway VNet2GW with a public IP VNet2GWpip.

Everything worked fine, and now I can connect via VPN to the VNet2GWpip and then I have a local IP in the VNet2.

But now the question: How can I make it work, that I now can connect to VM via RDP and the local IP in VNet1 from the VNet2.

I set an inbound rule in the VM that says, that 3389 is open from VNet2 to local VM IP address in VNet1, but that does not work.
Do I have to set up anything else? Where is the error?

Thank you for any help oder advice

Regards,
Benjamin

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,141 questions
0 comments No comments
{count} votes

Accepted answer
  1. Alan Kinane 16,786 Reputation points MVP
    2021-10-14T13:20:17.29+00:00

    If you deployed the VPN Gateway to a different VNET (not a requirement by the way) then you would need to peer the two VNETs together. Please see guide here: https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-manage-peering

    Once the two VNETs are peered they can talk to each other and you should be able to access your VM by its private IP address.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful