How to communicate two VM’s in Azure
To establish peering between two VM’s do follow the link below.
Virtual machines communication in Azure?
Vnet peering (Virtual Network peering) in Azure is used for connecting two or virtual networks for resource sharing in one region to another region.
VNet peering Architecture.
For testing the Virtual machines to communicating with each other we need virtual network peering from vnet1 to vnet2 and vnet2 to vnet1, and also, we required two private IP addresses.
1st virtual machine1(vm1) and 2nd virtual machine(vm2) to test.
Step-1: Search for virtual machines.
Step-2: In this tab go to Virtual machines which is already created vm1 and vm2 by using vnet1 and vnet2 subnet IP addresses and public IP addresses.
Step-3: Click on the first virtual machine vm1, it will go to overview, in that you will see public IP address and scroll down in the networking below you will see private IP address. Copy that public IP address of first virtual machine vm1.
Step-4: Open the mobaXterm application, mobaXterm is a toolbox for remote computing in a single window application, once it has opened, click on SSH, and in the remote host enter the public IP address of first virtual machine vm1 from the overview.
Enable specify name and enter the username of virtual machine name (vm1).
Click on advanced SSH setting and upload the .pem key in that.
Step-5: Now it opens the terminal window, it will ask for password, enter the password. It will launch Linux virtual machine.
If you uploaded the .pem key, then no need to enter the password.
Step-6: Click on the first virtual machine vm1, it will go to overview, in that you will see public IP address and scroll down in the networking below you will see private IP address. Copy the private IP address of first virtual machine vm1.
Step-7: Enter the ping and private IP address of first VM1 you will see the ping status of VM1 which was continuously ping.
Step-8: Go to 2nd Virtual machine vm2, in the overview tab scroll down and copy the private IP address of vm2.
Step-9: Enter the ping and private IP address of vm2 you will see the ping status of vm2 continuously from vm1 to vm2.
Now you can see the communication is made from vm1 to vm2 and then from vm2 to vm1.
Step-10: You can also check the communication status through Azure Bastion also, click on First virtual machine vm1 and then click on connect tab, and you will see the options below go to Bastion.
Step-11: Click on the Bastion it will ask to enter the username and password and click on connect.
Step-12: Now you can ping in the same manner like you did before.
Now the communication is made from vm1 to vm2 through Azure Bastion.
Author : Chandra Shekar