0

I have two Virtual Machines, which due to some historical reasons are under two different subscriptions. I am trying to find a way to connect them through internal IPs.

Normally for public virtual IP, I open the relevant port on Azure portal and than add an iptable rule like

iptables -I INPUT -p tcp -m tcp -s 198.1.1.1/32 --dport 11211 -j ACCEPT

And then I can connect with the public IP. I do the same by replacing the public ip as above to the internal ip but it didn't work.

After some search it seems the normal way is to create a virtual network and add the two machines in it. But I got two questions:

  1. Is there a way like the iptables rule like can achieve what I want without the need to setup virtual network?

  2. Can one add non-azure machine, like an VPS, in the virtual network?

1 Answer 1

1

Q1:

Is there a way like the iptables rule like can achieve what I want without the need to setup virtual network?

No. Not really. A possible workaround would be to still create an InputEndpoint (Endpoint from the Portal) for both the virtual machines. Then change your iptables rules for both public and private Addresses. But no guarantees it will work. Moreover, when not part of a Virtual Network, the internal IP Address of a VM is very likely to change sooner or later, especially on restart.

Q2:

Can one add non-azure machine, like an VPS, in the virtual network?

Technically yes. You have to use either Site-to-Site VPN (GA) or a Point-to-Site VPN (Preview). You can read more on Site-to-Site VPN here and Point to Site VPN here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.