0

I have a VM in Azure that has a public IP and a DNS entry like my-db.westeurope.cloudapp.azure.com. I have another server at another hosting provider and configured the firewall to only allow access from the other ip address.

Now I wanted to create another VM in the same virtual network in Azure and access my-db.westeurope.cloudapp.azure.com (which dns resolved to the public ip address). But the firewall now thinks the access is through the internet and not from the virtual network.

What can I do?

3 Answers 3

1

If they are on the same virtual network and subnet you should be able to access the Azure VM using the private IP listed.

My preferred way of seeing what is listed is to go to your virtual machine and click the "Virtual network/subnet" entry. This will show you the associated private IP for your current virtual machine, as well as the private IP for any other virtual machines that are on the same subnet that should be able to communicate.

You can make a custom DNS entry to point to your private IP for this if desired but not strictly necessary.

From there you might also have other issues (such as firewalls running on your virtual machines) to deal with.

0

If i understand correctly you want 1 IP for VMs in Azure.

If you want both VM in Azure to have the same Public IP you must have both of them behind a Load balance which makes use of Source NAT (SNAT).

Then you will only have to configure 1 Public IP on the other hosting providers firewall.

If you do not want to use a SNAT, then you will have to add a public IP to other VM and add that IP also to the other hosting providers fireall.

0

I solved my problem by using a custom dns server.

So I set up dnsmasq on one of the servers and changed my-db.westeurope.cloudapp.azure.com to point to the internal ip instead of the public ip. That way the traffic stays in the network and everything works as expected.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .