Connect Azure Virtual Networks - Step-by-Step Guide

Connect VNet1 to VNet2

Question

You have two subscriptions named Subscription1 and Subscription2. Each subscription is associated to a different Azure AD tenant.

Subscription1 contains a virtual network named VNet1. VNet1 contains an Azure virtual machine named VM1 and has an IP address space of 10.0.0.0/16.

Subscription2 contains a virtual network named VNet2. Vnet2 contains an Azure virtual machine named VM2 and has an IP address space of 10.10.0.0/24.

You need to connect VNet1 to VNet2.

What should you do first?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C

We require a virtual network gateway for VNet-to-VNet connectivity.

Incorrect Answers:

A: There is no need to modify the address space. If you update the address space for one VNet, the other VNet automatically knows to route to the updated address space.

https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-vnet-vnet-cli

To connect VNet1 to VNet2, you need to establish a virtual network peering between the two VNets. This will allow the virtual machines in each VNet to communicate with each other over a private, secure connection.

To establish a virtual network peering, you need to perform the following steps:

  1. Ensure that both subscriptions are associated with the same Azure AD tenant. If they are associated with different tenants, you will not be able to establish a peering.

  2. Create a virtual network gateway in each VNet. A virtual network gateway is a type of virtual network appliance that provides connectivity between two or more VNets. You can create a virtual network gateway by using the Azure portal or Azure PowerShell.

  3. Configure the virtual network gateways to use the correct IP address ranges. For example, you will need to ensure that the IP address space of VNet1 does not overlap with the IP address space of VNet2.

  4. Establish a virtual network peering between VNet1 and VNet2. This can be done by using the Azure portal or Azure PowerShell.

  5. Verify that the virtual network peering is working correctly by testing connectivity between the virtual machines in each VNet.

Option A, Modify the IP address space of VNet2, is not the correct answer as modifying the IP address space of VNet2 will not establish the virtual network peering between VNet1 and VNet2.

Option B, Move VM1 to Subscription2, is also not the correct answer as moving VM1 to Subscription2 will not establish the virtual network peering between VNet1 and VNet2. In fact, it is not necessary to move any virtual machines between the two subscriptions to establish the virtual network peering.

Option D, Move VNet1 to Subscription2, is also not the correct answer as moving VNet1 to Subscription2 will not establish the virtual network peering between VNet1 and VNet2. In fact, it is not necessary to move any VNets between the two subscriptions to establish the virtual network peering.