How do I use a vpn inside a azure vm?

Mohammed aaqib 0 Reputation points
2024-07-12T13:25:44.3166667+00:00

I Had created a windows server virtual machine on Azure, I want to know How do I use a vpn inside the virtual machine as It disconnects the remote desktop, the vpn I am using does not have split tunneling feature, I tried using azure bastion but that didn't help either, Could you please suggest any way to use a vpn inside the azure virtual machine without the rdp getting disconnected.

Azure VPN Gateway
Azure VPN Gateway
An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
1,543 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,134 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KapilAnanth-MSFT 46,016 Reputation points Microsoft Employee
    2024-07-15T08:33:32.9566667+00:00

    @Mohammed aaqib ,

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.

    It appears you are using a 3rd party VPN inside an Azure VM

    • Is that correct?
    • Or are you using Azure P2S VPN and not a 3rd party?

    If the RDP is getting dropped, even with a Bastion

    • This could only mean that the VPN Client you are connecting to is routing all the traffic including traffic within the VNET.
    • In that case, you have to check the configuration of your VPN Client only, and understand what are the routes that are learnt/advertised to your OS once you connect.

    You can try using Azure Serial Console (for Windows)

    • Enable it by following the document
    • Then RDP to the VM and try to connect to the VPN
    • Once the RDP drops, try to access the VM using Serial Console
      • Run route PRINT
      • This should tell us where the traffic is headed.

    NOTE : The above is just for troubleshooting.

    You must work on the VPN Client to not advertise every traffic to route via the VPN Tunnel

    Hope this helps.

    Cheers,

    Kapil


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.