Azure Networking(3) : Peering
Peering is the best way to open a connection between two virtual networks, so the virtual machines inside those virtual networks that are peered can talk to each other using one of the protocols.
Scenario :
I will have two VMs each connected to a vnet, then I will try to send ping request to VM1 from VM2 before configuring the peering and after configuring it and see what is the result.
Virtual networks :
These are the two networks that I need to connect them to each other.
First of all, I will connect to VM2 from my local due to its public IP address via SSH, then I will send ping request to VM1 and see what will be the response if there is any.
But before send the ping request to VM1, I should make sure that the network security group (NSG) include the rule that allows VM1 to receive ping request. And because it is not enabled by default, I will create that rule in VM1 NSG, that can be done just by adding inbound security rule for ICMP protocol.
Now once I made sure that VM1 has that rule that enables inbound for ICMP protocol, I will connect to VM2 and send ping request to VM1.
As you can see I send ping request before adding the inbound rule for ICMP and after adding it, and the result is always the same. What I need to do now, it is the peering.
And now by pressing Add, the peering between the two virtual networks will be created and we will be able to communicate the VMs inside them.
Now if I resend ping request to the VM1 from VM2 I am sure that I will get response because the peering is created and the rule of inbound is enabled in VM1. And here is the response when I sent ping request from VM2 to VM1.
I hope you've enjoyed the reading of this article, any question or comment, I will answer .