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:
Is there a way like the iptables rule like can achieve what I want without the need to setup virtual network?
Can one add non-azure machine, like an VPS, in the virtual network?