0

I am a beginner with azure vnet peering, so please indulge me if this is such an obvious question. I would like to vnet peer one vnet to multiple vnets. All those vnets however uses the same address space. Let me explain more with examples. Let's say vnet_source is the one that will peer with some existing vnets.

vnet_source > 192.168.0.0/16 for example
vnet1> 10.0.0.0/16
vnet2> 10.0.0.0/16
vnet3> 10.0.0.0/16

Would this be possible? For one vnet (vnet_source) to peer with other vnets that are using the same address space, in this case (vnet 1,2, and 3)? and if so is there a routing trick that can identify, that in this case 10.0.1.81 for example ip address belongs to vnet1 and not. Any help would be highly appreciated! Thank you so much.

I am still in the planning phase, so have not tested yet.

Random.x
  • 13
  • 3
  • I mean technically you could probably do it. However, I would strongly advise against it given the potential for address assignment, i.e. if a VM gets assigned 10.0.1.81 like in your example, there is no way to know which VNet it comes from if the VNet have same address spaces. Unless you had route tables to manage the traffic it can get very messy very quickly. – johubb Nov 08 '22 at 11:23
  • Thank you very much for your answer @johubb . Yeah you are right, the routing will be a nightmare to manage – Random.x Nov 08 '22 at 14:03

1 Answers1

1

Unfortunately it is not possible to implement vnet peering between vnets with same address space.

enter image description here

There are likely to be address conflicts (same IP address used in both locations) and Azure Route tables won't be able to decide where to send the traffic.(VM with IP 10.0.0.10 from vnet1, vnet2 or vnet3?)

https://community.cisco.com/t5/other-collaboration-subjects/the-best-way-to-connect-2-lan-s-with-the-same-ip-addresses/td-p/2724403

It is important to use unique IP address spaces for each virtual network used in Azure so that routing can occur between virtual networks. If virtual networks have the same IP address space it would not be possible to route traffic between resources from different vnets.

https://superuser.com/questions/1661852/can-two-networks-connected-to-a-router-both-have-a-host-with-the-same-ip-address

L2 forwarding can solve this problem but Azure does not support it for peering. enter image description here https://blog.ipspace.net/2019/11/stretched-layer-2-subnets-in-azure.html

Andriy Bilous
  • 2,337
  • 1
  • 5
  • 16