how do I connect VM to VPN Gateway

TCS Master 0 Reputation points
2024-08-22T17:10:26.4233333+00:00

I have a windows 10 VM with default address space 10.0.0.0/16. It's default private ip address is 10.0.0.5/10.0.0.1. Have created a site to site VPN Gateway with Public IP 52.175.207.142 using address space 10.1.0.0. Have created a local network gateway with Public IP of the local device address and an private address space of 192.168.1.0/24. The VPN Gateway has a connection to the local device. Then peered the VPN Gateway virtual Network with the VM virtual network. Tryng to ping from the Windows VM to a device on the on site premises at 192.168.1.101. This does not work.

The goal is to have the application running in the VM control a device located at the on premises site.

Is this to correct approach to establishing the connection from the VM to the remote site?

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
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,472 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Silvia Wibowo 3,906 Reputation points Microsoft Employee
    2024-08-23T06:04:13.6033333+00:00

    Hi @TCS Master , I understand that you have a Windows 10 VM and a VPN Gateway. You tried to ping from Windows VM to on-premises IP address 192.168.1.101, but it failed.

    First, vnet peering configuration need to follow Gateway Transit vnet peering:

    • Peering of VM vnet to VPN vnet:
      • Allow 'VM-vnet to access 'VPN-vnet': tick
      • Allow 'VM-vnet ' to receive forwarded traffic from 'VPN-vnet': tick
      • Allow gateway or route server in 'VM-vnet' to forward traffic to 'VPN-vnet': untick
      • Enable 'VM-vnet ' to use 'VPN-vnet's' remote gateway or route server: tick
    • Peering of VPN vnet to VM vnet:
      • Allow 'VPN-vnet to access 'VM-vnet': tick
      • Allow 'VPN-vnet ' to receive forwarded traffic from 'VM-vnet': tick
      • Allow gateway or route server in 'VPN-vnet' to forward traffic to 'VM-vnet': tick
      • Enable 'VPN-vnet ' to use 'VM-vnet's' remote gateway or route server: untick

    Then, you need to configure route table on Windows 10 VM subnet, to tell the traffic where to go. If there's no existing route table applied on the subnet, create one with the following entry:

    192.168.1.0/24 -> virtual network gateway

    Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

    0 comments No comments

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.