Introduction
To establish the connection between two virtual networks there are several methods. In this demo we will learn how to establish VPN gateway connection between two Virtual Networks.
In the lab scenario, I have already configured Virtual Networks and Virtual Machines
Site-1 Environment
- Site 1 – Resource Group
- VNet Name – Site1VNet
- Address Space – 20.0.0.0/16
- Subnet – 20.0.0.0/24
- Virtual Machine Name – Site1VM
Site-2 Environment
- Site 2 – Resource Group
- VNet Name – Site2VNet
- Address Space – 30.0.0.0/16
- Subnet – 30.0.0.0/24
- Virtual Machine Name – Site2VM
Step 1 - Creating the Gateway Subnet in Site-1
Click the Site-1 Resource Group and then select Virtual Network, in this demo our Virtual Network is "Site1VNet". In the Site1VNet Select "Subnets" under the Settings. In the Subnets Click "Gateway Subnet" and then enter the "Address Range (CIDR Block)" and then Click Ok.
Step 2
Creating the Gateway Subnet in Site-2 (Follow Step 1),
Step 3 - Configuring Virtual Network Gateway
In the Site-1 Resource Group Click “+Add” to enter the Marketplace.
Step 4
Search the Virtual Network Gateway and then click the “Create” button.
Step 5 - Deploying the Virtual Network Gateway in Site 1
Enter the name for Virtual Network Gateway in this demo, our name is "Site1Gw", and then select the Virtual Network (Site1VNet), and create the new Public IP address (Site1-IP) and click "Create+Review"
Step 6
Deploying the Virtual Network Gateway in Site 2 (Follow Step 5).
Step 7
Open the Site-1 Resource group and then click the Virtual Network Gateway “Site1Gw”.
Step 8
In the Virtual Network Gateway, Click “Connections” and then click “Add”.
Step 9
In the Add connection our connection name is “Site1-to-Site2”, Connection type is “VNet-to-VNet”. Now we need to select second Virtual Network Gateway, so click “Choose another virtual network gateway” and then select “Site2Gw”.
After selecting the Gateway, enter the “Shared key” and click “Ok”.
Step 10
Creating the Connection (Follow Step 9),
Name: Site2-to-Site1
Second virtual network gateway: Site1Gw
Shared key: Enter the same key that we entered on Site-1 Connection
Step 11
Verifying the Connection,
Summary
In this demo, we have learned how to deploy a VPN network gateway connection between VNet to VNet Connection. If you have any questions feel free to comment under the article.