VNet peering is a way we can connect two virtual networks in the same region through azure network backbone. When we connect the VNets it works as one network but manage as two different resources. When we do the peering VMs in both network can communicate each other.
Advantage of using VNet Peering
- Low letency high bandwith connection between two VNets.
- The ability to use resources such as network appliances and VPN gateways as transit points in a peered VNet.
- Can connect a virtual network that uses the Azure Resource Manager model to a virtual network that uses the classic deployment model and enable full connectivity between resources in these virtual networks.
Requirements for creating a VNet Peering
- Virtual networks must be in the same region
- They can be in the same or different subscriptions
- They must not use overlapping IP ranges
- Peering is not transitive. If virtual network 1 is connected to virtual network 2 and virtual network 2 is connected to virtual network 3 then virtual network 1 has no connectivity to virtual network 3 and a direct peer between virtual network 1 and virtual network 3 is required
- ASM virtual networks cannot be peered to each other but can be peered to an ARM virtual network. ARM virtual networks can be peered with each other.
How it’s Done?
First decide the VNets you wish to peering then navigate to VNet and in the VNet blade click Peering, click ADD
When click add it will open a another blade as follows. Following example both VNets are grayed because I used it to create a peering, select the VNet you wish to peering and click OK.
You have to perform the same above task to other VNet ,to establish the connection between two VNets. If the connection is succeeded it shows as connected.
Other VNet connected through VNet Peering
Next I deploy two VMs in those two networks and test the connection
As above I ping the VMs private IP address and it responses to ping.
Find More about Peering