Connecting two Azure Virtual Networks using global virtual network peering

Lab scenario

In this lab, you will configure connectivity between the CoreServicesVnet and the ManufacturingVnet by adding peerings to allow traffic flow.

In this unit, you will:

  • Task 1: Create a Virtual Machine to test the configuration
  • Task 2: Connect to the Test VMs using RDP
  • Task 3: Test the connection between the VMs
  • Task 4: Create VNet peerings between CoreServicesVnet and ManufacturingVnet
  • Task 5: Test the connection between the VMs

Prerequisites for this labs : Azure Account 

Task 1: Create a Virtual Machine to test the configuration

In this section, you will create a test VM on the Manufacturing VNet to test if you can access resources inside another Azure virtual network from your ManufacturingVnet.

Create ManufacturingVM

  • On the Azure home page, using the global search type Virtual Machines and select virtual machines under services.
  • In Virtual Machines, select + Create; + Virtual machine.
  • Use the information in the following table to create your VM.
TabOptionValue
BasicsResource groupExceedlabsResourceGroup
 Virtual machine nameManufacturingVM
 RegionWest Europe
 Availability optionsNo infrastructure redundancy required
 ImageWindows Server 2022 Datacenter- Gen1
 Azure Spot instanceNot selected
 SizeStandard_D2s_v3 – 2vcpus, 8GiB memory
 UsernameTestUser
 PasswordTestPa$$w0rd!
 Public inbound portsAllow selected ports
 Select inbound portsRDP (3389)
DisksNo changes required 
NetworkingVirtual networkManufacturingVnet
 SubnetManufacturingSystemSubnet (10.30.10.0/24)
 Public IP(new) ManufacturingVM-ip
 NIC network security groupBasic
 Public inbound portsAllow selected ports
 Select inbound portsRDP (3389)
 Load balancingNot selected
ManagementNo changes required 
AdvancedNo changes required 
TagsNo changes required 
Review + createReview your settings and select Create 
  • When the deployment is complete, select Go to resource.

Task 2: Connect to the Test VMs using RDP

  • On the Azure Portal home page, select Virtual Machines.
  • Select ManufacturingVM.
  • In ManufacturingVM, select Connect > RDP.
In ManufacturingVMConnect, select Download RDP file.
  • Save the RDP file to your desktop.
  • Connect to ManufacturingVM using the RDP file, and the username TestUser and the password TestPa$$w0rd!.
  • On the Azure Portal home page, select Virtual Machines.
  • Select TestVM1.
  • In TestVM1, select Connect > RDP.
In TestVM1Connect, select Download RDP file.
  • Save the RDP file to your desktop.
  • Connect to TestVM1 using the RDP file, and the username TestUser and the password TestPa$$w0rd!.
  • On both VMs, in Choose privacy settings for your device, select Accept.
  • On both VMs, in Networks, select Yes.
  • On TestVM1, open a PowerShell prompt, and run the following command: ipconfig
  • Note the IPv4 address.

Task 3: Test the connection between the VMs

  • On the ManufacturingVM, open a PowerShell prompt.
  • Use the following command to verify that there is no connection to TestVM1 on CoreServicesVnet. Be sure to use the IPv4 address for TestVM1.

code

Test-NetConnection 10.20.20.4 -port 3389
  • The test connection should fail, and you will see a result similar to the following:

Task 4: Create VNet peerings between CoreServicesVnet and ManufacturingVnet

  • On the Azure home page, select Virtual Networks, and then select CoreServicesVnet.
  • In CoreServicesVnet, under Settings, select Peerings.
On CoreServicesVnetPeerings, select + Add.
  • Use the information in the following table to create the peering.
SectionOptionValue
This virtual network  
 Peering link nameCoreServicesVnet-to-ManufacturingVnet
 Traffic to remote virtual networkAllow (default)
 Traffic forwarded from remote virtual networkAllow (default)
 Virtual network gateway or Route ServerNone (default)
Remote virtual network  
 Peering link nameManufacturingVnet-to-CoreServicesVnet
 Virtual network deployment modelResource manager
 I know my resource IDNot selected
 SubscriptionYour Subscription-xxxxxxxx
 Virtual networkManufacturingVnet
 Traffic to remote virtual networkAllow (default)
 Traffic forwarded from remote virtual networkAllow (default)
 Virtual network gateway or Route ServerNone (default)
Review your settings and select Add.  
In CoreServicesVnetPeerings, verify that the CoreServicesVnet-to-ManufacturingVnet peering is listed.

Under Virtual networks, select ManufacturingVnet, and verify the ManufacturingVnet-to-CoreServicesVnet peering is listed.

Task 5: Test the connection between the VMs

  • On the ManufacturingVM, open a PowerShell prompt.
  • Use the following command to verify that there is now a connection to TestVM1 on CoreServicesVnet.

code

Test-NetConnection 10.20.20.4 -port 3389

The test connection should succeed, and you will see a result similar to the following:

Congratulations! You have successful configured connectivity between VNets by adding peerings.

Reminder: Don’t forget to delete or shutdown all unused Azure resources after your labs for cost saving

Leave a Reply

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