An Azure administrator deploys three virtual networks in the East US region:
* `VNet-Hub` () contains a subnet named `Subnet-Hub` with a virtual machine named `VM-Hub`.
* `VNet-Spoke1` () contains a subnet named `Subnet-Spoke1` with a virtual machine named `VM-1`.
* `VNet-Spoke2` () contains a subnet named `Subnet-Spoke2` with a virtual machine named `VM-2`.
You configure virtual network peering between `VNet-Hub` and `VNet-Spoke1`, and between `VNet-Hub` and `VNet-Spoke2`. `VM-Hub` can communicate with both `VM-1` and `VM-2`. However, `VM-1` and `VM-2` are unable to communicate with each other.
Which of the following configuration changes must you perform to enable direct network connectivity between `VM-1` and `VM-2`?
- AEnable the Allow gateway transit setting on the peering connections for VNet-Hub, and the Use remote gateways setting on the peering connections for VNet-Spoke1 and VNet-Spoke2.
- BConfigure a User-Defined Route (UDR) in VNet-Spoke1 and VNet-Spoke2 with the next hop type set to Virtual Network Gateway pointing to VNet-Hub.
- Configure a virtual network peering connection directly between VNet-Spoke1 and VNet-Spoke2.Answer
- DEnable the Allow forwarded traffic setting on the virtual network peering connections between VNet-Hub and both spoke virtual networks.
Answer
Configure a virtual network peering connection directly between VNet-Spoke1 and VNet-Spoke2.
Virtual network peering is non-transitive. Traffic cannot transit a middle virtual network (hub) to reach another peered virtual network (spoke) unless a Network Virtual Appliance (NVA) is deployed in the hub. To enable direct communication between the two spoke virtual networks without an NVA, a direct peering link must be created between them.
Step-by-Step Solution
Key Concept
Virtual network peering is non-transitive by default. To route traffic between two spokes, you must either peer them directly or route traffic through a Network Virtual Appliance (NVA) in the hub using User-Defined Routes.