Lesson 2 of 6 Azure Networking Services

Connecting Virtual Networks with Peering

This lesson explains virtual network peering and global virtual network peering, their characteristics, and how peering differs from VPN Gateway and ExpressRoute.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe the purpose of virtual network peering.
  • Explain the characteristics of peering, including non-transitivity.
  • Distinguish peering from other connectivity options.

What peering does

Resources in one virtual network cannot communicate with resources in another by default. Virtual network peering connects two virtual networks so that, for connectivity purposes, they appear as one: VMs in each network can communicate with each other using private IP addresses. Traffic between peered networks is private and travels over the Microsoft backbone network, never over the public internet, and peering does not need gateways, encryption devices or public IP addresses.

There are two types of peering. Virtual network peering connects virtual networks in the same Azure region, and global virtual network peering connects virtual networks in different regions. Peered networks can be in different subscriptions and even different Microsoft Entra tenants.

The following diagram shows two peered virtual networks in different regions.

Virtual network peering. Two virtual networks are connected so that their resources communicate with private IP addresses, as if they were one network. Traffic stays on the Microsoft backbone, never the public internet, and needs no gateways or public IP addresses. Peering in the same region is virtual network peering; across regions it is global virtual network peering, and peered networks can be in different subscriptions or tenants.
Peered networks communicate as if they were one.

Characteristics to remember

Peering has several characteristics that often appear in scenarios:

  • Low latency, high bandwidth: the connection performs like a single network.
  • Address spaces must not overlap: two virtual networks that both use 10.0.0.0/16 cannot be peered.
  • Peering is not transitive: if network A is peered with B, and B with C, A cannot reach C unless A and C are also peered or traffic is routed through a network virtual appliance or gateway in B.
  • Gateway transit: a peered network can use the VPN gateway in another network to reach on-premises, which supports hub-and-spoke designs where shared services are in a hub.
  • Cost: data transferred across a peering is charged, with higher rates for global peering.
Scenario questions

Peering in practice

Exam skills 2.2.5

Apply the characteristics of virtual network peering.

Log in to try this activity Interactive activities are free with an account.

Peering compared with other connections

Peering connects Azure virtual networks to each other. To connect a virtual network to an on-premises network, use Azure VPN Gateway or ExpressRoute instead. The following comparison shows the differences.

Virtual network peering
ConnectsAzure VNet to Azure VNet
PathMicrosoft backbone
Needs a gatewayNo
VPN Gateway
ConnectsAzure VNet to on-premises or devices
PathEncrypted tunnel over the internet
Needs a gatewayYes
ExpressRoute
ConnectsOn-premises network to Microsoft cloud
PathPrivate provider connection
Needs a gatewayYes
Sort into groups

Peering, VPN or ExpressRoute?

Exam skills 2.2.5

Choose the connection for each requirement.

Log in to try this activity Interactive activities are free with an account.
Worked example

Connecting two virtual networks

A company has a virtual network in West Europe for its web application and another in North Europe for a reporting system. The reporting VMs must query the web application's database over private IP addresses with low latency, and the traffic must not cross the public internet. The address spaces do not overlap. What should the company configure?

Configure global virtual network peering between the two virtual networks. Peering connects networks in different regions, uses private IP addresses, routes traffic over the Microsoft backbone rather than the internet, and does not need a gateway. A VPN gateway between the two networks would also work but adds cost and complexity, and its traffic, although encrypted, uses a gateway tunnel rather than direct private routing.

Check yourself

If VNet A is peered with VNet B, and B with C, can A reach C?

Show answer

Not by default. Peering is not transitive, so A and C need their own peering or routing through B.

Exam Tips

Remember for the exam

  • Peering connects Azure virtual networks over the Microsoft backbone using private IP addresses.
  • Global virtual network peering connects VNets in different regions.
  • Peered address spaces must not overlap, and peering is not transitive.