question

JasonHarding-6075 avatar image
0 Votes"
JasonHarding-6075 asked msrini-MSFT answered

Auto Update HostFile

Hi there,

We have a scenario:
1. On-Prem Server
2. Azure VM

We have an Azure PtS VPN between the two above servers.
There is a piece of software on the VM that relies on communicating with the On-Prem.

The issue is, the IP that gets assigned to the VPN 'adapter' on the On-Prem when the VPN gets connected, changes between 6 values and I cannot reduce the subnet from /29 to /30 in the Azure VPN PtS config as /29 is the lowest value one can use.

In essence, is there a way to query an IP address assigned to the VPN adapter on the On-Prem and then updates the hostfile on the VM?
Or is there another way one can have multiple IP's for a single hostname in the hostfile and it rotates? Overall, need to find a way that keeps the HostFile on the VM updated with the IP from the VPN adapter on the physical.

Kind Regards,
Jason

azure-vpn-gatewayazure-dedicated-host
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

msrini-MSFT avatar image
0 Votes"
msrini-MSFT answered

@JasonHarding-6075,

In On-Premises, write a script which performs "ipconfig/all" and parse the PPP adapter IP and store it in a location. Run this script every 30 mins or and keep updating the file in a Storage Account in Azure.

From Azure, try to read the file in Storage Account and update the host name with this IP.

Let me know if you have any questions.

Regards,
Karthik Srinivas

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.