Skip to Content

Azure vnet Peering

A brief about vnet: vnet stands for Virtual Network. It is the building block for the Azure network and enables Azure resources to communicate with each other or with the on-prem network via VPNs.

  • Create the virtual network with the address range for example 10.0.0.0/16
  • Create a subnet from the above range for example 10.0.0.0/24 so the IP range is 10.0.0.0-10.0.0.255
  • Azure reserves the first 4 addresses and the last address


Virtual Network

If the resources are on different virtual networks then it will need vnet peering to communicate with each other. There are 2 types of peering:-

  1. Virtual network Peering - works within the same Azure regions
  2. Global Virtual network peering - Works across Azure regions

The communication happens on the MS backbone and it does not need the internet connection.

How to create the vnet peering?

1. Prerequisites

  • Two VNets: Ensure you have two virtual networks in the same or different Azure regions.
  • Non-overlapping address spaces: The IP address ranges of the two VNets should not overlap.

2. Navigate to the Azure Portal

  1. Sign in to the Azure Portal.
  2. Go to the Virtual networks service.

3. Configure VNet Peering for the First VNet

  1. Select the first VNet (e.g., VNet-A) from the list.
  2. Under the Settings section, click on Peerings.
  3. Click on + Add to create a new peering.

4. Fill in the Peering Settings

  1. Name: Provide a meaningful name for the peering (e.g., VNetA-to-VNetB).
  2. Peer Virtual Network: Choose the second VNet (e.g., VNet-B) from the dropdown.
  3. Peering Settings: Configure as needed:
    • Allow virtual network access: Enable if resources in both VNets should communicate.
    • Allow forwarded traffic: Enable if required for specific scenarios.
    • Allow gateway transit: Enable if using a shared gateway for on-premises connectivity.
  4. Click Add to create the peering.

5. Configure VNet Peering for the Second VNet

  1. Go to the second VNet (e.g., VNet-B) and repeat steps 3 and 4.
  2. Ensure the peering name reflects the reverse direction (e.g., VNetB-to-VNetA).

6. Verify Peering

  1. Go to the Peerings section of both VNets and ensure the status is Connected.
  2. Use network tools (e.g., ping or tracert) to confirm connectivity between resources in the two VNets.

Share this post
Tags
Archive
Manage Azure Cost