Introduction to Azure VNet Peering

Azure Virtual Network (VNet) peering enables you to connect two Azure Virtual Networks privately. The traffic between virtual networks is routed through the Microsoft backbone network. This allows resources in different virtual networks to communicate with each other as if they were on the same network. VNet peering does not require a gateway or encryption to function.

How VNet Peering Works

When you peer two VNets, Azure establishes a direct, low-latency connection between them. This connection leverages Azure's high-speed network infrastructure. Each VNet maintains its own identity, subscription, and administrative boundaries. Peering is a non-transitive relationship. This means if VNet A is peered with VNet B, and VNet B is peered with VNet C, VNet A cannot communicate with VNet C unless A is also directly peered with C.

Benefits of VNet Peering

Key Concepts

Configuration Steps

Configuring VNet peering involves creating a peering connection from each VNet to the other.

  1. Navigate to the Virtual Networks service in the Azure portal.
  2. Select the first virtual network you want to peer.
  3. Under "Settings," select "Peerings."
  4. Click "+ Add" to create a new peering connection.
  5. Configure the peering details:
    • Name of peering: A descriptive name for the connection from the current VNet to the remote VNet.
    • Virtual network deployment model: Select "Resource Manager" or "Classic."
    • Subscription: Select the subscription containing the remote VNet.
    • Virtual network: Select the remote virtual network.
    • Access to the virtual network: Define whether the remote VNet can access resources in this VNet.
    • Allow virtual network access: Whether resources in this VNet can access resources in the remote VNet.
    • Allow forwarded traffic: Whether traffic originating from the remote VNet that is forwarded through the remote VNet to other destinations is allowed.
    • Allow gateway transit: If this VNet has a VPN gateway, specify if peered VNets can use it.
    • Use remote gateways: If the remote VNet has a VPN gateway, specify if this VNet should use it.
  6. Click "Add" to create the peering.
  7. Repeat steps 3-6 for the second virtual network, configuring the peering from it back to the first VNet.
Important: Both VNets must have non-overlapping IP address spaces to create a peering connection.

Common Scenarios

Considerations and Limitations

Next Steps

Explore detailed guides on configuring Global VNet Peering and managing VNet Peering settings. Understand how to utilize Virtual Network Gateway Transit for advanced connectivity.

# Example Azure CLI command to create a VNet peering az network vnet peering create --name MyPeering --resource-group MyResourceGroup --vnet-name VNet1 --remote-vnet VNet2 --allow-vnet-access