Tue. Jun 25th, 2024
parque ribeirinho oriente

Setting up peering in Azure between two virtual networks (VNets) allows them to communicate with each other as if they were on the same network. Here are the steps to set up peering between two VNets in Azure:


  1. You must have an Azure subscription and sufficient permissions to create and configure VNets and peering.

Step 1: Create Two Virtual Networks

If you haven’t already, create the two VNets that you want to peer. You can do this through the Azure Portal or by using Azure CLI, PowerShell, or ARM templates. Ensure that both VNets have unique address spaces and are located in the same Azure region or in regions connected through ExpressRoute or VPN Gateway.

Step 2: Configure VNet Peering

  1. Navigate to the Azure Portal:Go to the Azure Portal (https://portal.azure.com).
  2. Select the First VNet:Select the first VNet from which you want to initiate the peering.
  3. Navigate to Peering:In the left-hand navigation pane, under “Settings,” click on “Peerings.”
  4. Add a Peering:Click the “+ Add” button to add a new peering.
  5. Configure the Peering:
    • Name: Give the peering connection a unique name.
    • Peer details: Choose the second VNet to peer with from the drop-down menu.
    • Allow forwarded traffic from the remote VNet: If you want to allow traffic to be forwarded from the remote VNet to this VNet, enable this option.
    • Allow forwarded traffic from this VNet: If you want to allow traffic to be forwarded from this VNet to the remote VNet, enable this option.
    • Use remote gateways: If the remote VNet has a VPN Gateway or ExpressRoute Gateway, enable this option to use it.
  6. Click OK and Save: Review the settings and click “OK” to create the peering. Then, click “Save” to save the configuration.
  7. Repeat for the Second VNet: Navigate to the second VNet and configure peering in the same way, ensuring that you choose the first VNet as the peer.

Step 3: Verify and Test the Peering

Once the peering is configured, it may take a few minutes for the connection to be established. You can check the status of the peering in the Azure Portal by navigating to the “Peerings” section of each VNet.

To test the peering, you can deploy resources in both VNets and ensure they can communicate with each other using private IP addresses. Make sure to configure network security groups (NSGs) and route tables, if necessary, to control traffic flow between the VNets.

That’s it! You have successfully set up peering between two VNets in Azure, allowing them to communicate securely with each other.

Leave a Reply

Your email address will not be published. Required fields are marked *