VNet Peering

Virtual Network (VNet) Peering consistently stands out as one of the most efficient ways to connect Azure networks. In this article, I’ll cover everything you need to know about VNet Peering, from basic concepts to advanced implementation strategies.

VNet Peering

  • Virtual network peering in Azure is an excellent concept that helps you to connect multiple virtual networks in Azure seamlessly.
  • VNet peering helps you to route traffic between the virtual networks privately.

What is Azure VNet Peering

Virtual network peering enables you to connect two or more virtual networks seamlessly in Azure. Once peered, these networks appear as one for connectivity purposes, allowing resources in different VNets to communicate as if they were in the same network.

This results in:

  • Low-latency, high-bandwidth connections
  • Private IP communication between resources
  • Seamless integration between services

Why Should You Use VNet Peering?

Below are the reasons to implement VNet peering:

  1. Isolation with Communication: Maintain separate VNets for different departments (like Finance and Marketing) while still allowing necessary communication between them
  2. Cross-Region Connectivity: Connect resources deployed in different geographic regions
  3. Simplified Multi-Team Environments: Allow DevOps and Production teams to manage separate networks while maintaining connectivity
  4. Enhanced Security: Keep traffic on Microsoft’s private network rather than traversing the public internet

Types of VNet Peering

There are two primary types of VNet peering:

TypeDescription
Regional VNet PeeringConnects VNets within the same Azure region
Global VNet PeeringConnects VNets across different Azure regions

How VNet Peering Works

When you establish a VNet peering connection, Azure creates two connections – one from VNet A to VNet B and another from VNet B to VNet A. This connection enables traffic to flow using private IP addresses through Microsoft’s backbone network.

The key technical aspects of VNet peering include:

  • Traffic routing through Microsoft’s backbone infrastructure
  • Support for both IPv4 and IPv6 addresses
  • No encryption of traffic between the virtual networks
  • No transitive relationships (more on this later)

How to configure VNet peering in Azure

Let me guide you to create VNet peering in your Azure environment. I’ll assume you already have two VNets created that you want to connect. If not, you can create the VNet now.

Prerequisites

Before we begin, ensure you have:

  • Two or more Azure Virtual Networks
  • Non-overlapping IP address spaces in the VNets
  • Appropriate permissions (Network Contributor or Administrator)

Setting Up Regional VNet Peering

Here’s how to configure VNet to VNet peering:

  1. Navigate to your Virtual Network:
    • Log in to the Azure portal
    • Search for “Virtual Networks” and select the service
what is vnet peering
  • Select the first VNet you want to peer

2. Access Peering Configuration:

  • In the left navigation panel, select “Peerings” under the Settings node as shown in the screenshot below.
vnet peering
  • Click “+ Add” to create a new peering connection
azure vnet peering

3. Configure Peering from First VNet:

  • Name your peering connection (e.g., “Peer-VNet1-to-VNet2”)
  • Choose “Virtual network” for the connection type
  • Select the subscription and virtual network to peer with
  • Name the reverse peering connection (e.g., “Peer-VNet2-to-VNet1”)
  • Configure optional settings (more on these below)
  • Click “Add” as shown in the screenshot below.
global vnet peering