John Morehouse shows how to force a particular IP address when building an Azure point-to-site VPN:
Recently, I got to work with a client on something interesting. We implemented transactional replication to send data to an Azure virtual machine. This was being done to perform some testing for a project.
Given that the two machines were NOT within the same Active Directory domain, we wanted to make sure our client’s data was protected, so we utilized a Point-to-Site VPN to facilitate this. With the client using a VPN connection, this helps to ensure that any data transmitted to the virtual machine is encrypted and secured. Note, the process on how to configure and implement the VPN connection is for another blog post.
SQL Server replication requires the use of a server name rather than just the IP addresses. This meant that the virtual machine in Azure had to use an entry in the local host file that was pointed back to the client’s machine.
The down side? When the VPN connection drops (it happens), the client machine obtains a new IP address upon reconnecting. Potentially now the host file would have the incorrect IP address and needs to be updated.
Read on to see how John was able to solve this.