question

BenjaminStehle-8647 avatar image
0 Votes"
BenjaminStehle-8647 asked IanWilliamson-0120 commented

Secure Connect to Azure Vm via VPN and RDP

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://docs.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-vpn-gateway
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AlanKinane avatar image
0 Votes"
AlanKinane answered IanWilliamson-0120 commented

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://docs.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.

· 15
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I was not able to add a Gateway to the first VNET ("VNet1")

I set up 2 Peerins - one from VNet1 to VNet2 und one from VNet2 to VNet1
But anyway I can´t "speak" from the VNet2 to the VNet1 - neither ping nor RDP.

0 Votes 0 ·
AlanKinane avatar image AlanKinane BenjaminStehle-8647 ·

I forgot to mention once you set up the peering you will need to download the VPN configuration file again as this will have been updated with the new routes required - see here: https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-about-point-to-site-routing#multipeered

0 Votes 0 ·

Thank you for your hints and patience. Sadly it does not work. I deleted the VPN-settings from Windows VPN manager, than downloaded the VPN configuration file again, reinstalled it and connected to it. Still got the local IP in VNet2, but can´t "speak" to VNet1 neither via ping nor RDP :-(

0 Votes 0 ·
Show more comments