Connecting vnet to vnet in Azure.

for a note to self:

 

  1. Create two vnet resource group call it vnet01 and vnet02. Vnet
  2.  On vnet01 create a new virtual network, device the IP range as 10.1.0.0/16
  3. Create a default subnet in it mark it like 10.1.0.0/24
  4. Create a GatewaySubnet and mark it 10.1.2.0/29 it can only reside between /16 and /29. It is important to keep in mind that the IP ranges of default subnet and GatewaySubnet must not be overlapping.
  5. Create a public IP resource in vnet01.
  6. Create a Virtual network gateway in vnet01, point it to the public IP resource you created in step 5.
  7. Do the same process for vnet02.
  8. Create a virtual network and give it an IP 192.168.0.0/16 and give default subnet an IP of 192.168.1.0/24 and GatewaySubnet 192.168.2.0/29
  9. create a public IP resource.
  10. create a virtual network gateway.
  11. we now need to create the connection, search in marketplace "Connection" Make sure it is set to vnet to vnet, in the PSK- called as ore shared key type the key that will be shared by the machine click on create and make sure you have checked bidirectional connectivity checkbox on.