In this exercise you will configure a virtual network gateway to connect the Contoso Core Services VNet and Manufacturing VNet.
In this exercise, you will:
On the Azure portal, open the PowerShell session within the Cloud Shell pane.
On the toolbar of the Cloud Shell pane, select the Upload/Download files icon, in the drop-down menu, select Upload and upload the following files azuredeploy.json and azuredeploy.parameters.json into the Cloud Shell home directory one by one from the source folder Allfiles\Exercises\M02
Deploy the following ARM templates to create the virtual network and subnets needed for this exercise:
$RGName = "ContosoResourceGroup"
#create resource group if it doesnt exist
New-AzResourceGroup -Name $RGName -Location "eastus"
New-AzResourceGroupDeployment -ResourceGroupName $RGName -TemplateFile azuredeploy.json -TemplateParameterFile azuredeploy.parameters.json
In Search resources, services, and docs (G+/), enter Virtual network gateway, and then select Virtual network gateways from the results.
In Virtual network gateways, select + Create.
Use the information in the following table to create the virtual network gateway:
Tab | Section | Option | Value |
---|---|---|---|
Basics | Project Details | Subscription | No changes required |
ResourceGroup | ContosoResourceGroup | ||
Instance Details | Name | CoreServicesVnetGateway | |
Region | East US | ||
Gateway type | VPN | ||
VPN type | Route-based | ||
SKU | VpnGw1 | ||
Generation | Generation1 | ||
Virtual network | CoreServicesVnet | ||
Subnet | GatewaySubnet (10.20.0.0/27) | ||
Public IP address type | Standard (default) | ||
Public IP address | Public IP address | Create new | |
Public IP address name | CoreServicesVnetGateway-ip | ||
Enable active-active mode | Disabled | ||
Configure BGP | Disabled | ||
Select Review + create | Review your settings and select Create. |
Note:
It can take up to 45 minutes to create a virtual network gateway.
In Search resources, services, and docs (G+/), enter Virtual network gateway, and then select Virtual network gateways from the results.
In Virtual network gateways, select + Create.
Use the information in the following table to create the virtual network gateway:
Tab | Section | Option | Value |
---|---|---|---|
Basics | Project Details | Subscription | No changes required |
ResourceGroup | ContosoResourceGroup | ||
Instance Details | Name | ManufacturingVnetGateway | |
Region | West Europe | ||
Gateway type | VPN | ||
VPN type | Route-based | ||
SKU | VpnGw1 | ||
Generation | Generation1 | ||
Virtual network | ManufacturingVnet | ||
Subnet | GatewaySubnet (10.30.0.0/27) | ||
Public IP Address Type | Standard (default) | ||
Public IP address | Public IP address | Create new | |
Public IP address name | ManufacturingVnetGateway-ip | ||
Enable active-active mode | Disabled | ||
Configure BGP | Disabled | ||
Select Review + create | Review your settings and select Create. |
Note:
It can take up to 45 minutes to create a virtual network gateway.
On the Azure portal, open the PowerShell session within the Cloud Shell pane.
On the toolbar of the Cloud Shell pane, select the Upload/Download files icon, in the drop-down menu, select Upload and upload the following files CoreServicesVMazuredeploy.json and CoreServicesVMazuredeploy.parameters.json into the Cloud Shell home directory one by one from the source folder Allfiles\Exercises\M02.
Deploy the following ARM templates to create the VMs needed for this exercise:
$RGName = "ContosoResourceGroup"
New-AzResourceGroupDeployment -ResourceGroupName $RGName -TemplateFile CoreServicesVMazuredeploy.json -TemplateParameterFile CoreServicesVMazuredeploy.parameters.json
When the deployment is complete, go to the Azure portal home page, and then select Virtual Machines.
Verify that the virtual machine has been created.
On the Azure portal, open the PowerShell session within the Cloud Shell pane.
On the toolbar of the Cloud Shell pane, select the Upload/Download files icon, in the drop-down menu, select Upload and upload the following files ManufacturingVMazuredeploy.json and ManufacturingVMazuredeploy.parameters.json into the Cloud Shell home directory one by one from the source folder Allfiles\Exercises\M02.
Deploy the following ARM templates to create the VMs needed for this exercise:
$RGName = "ContosoResourceGroup"
New-AzResourceGroupDeployment -ResourceGroupName $RGName -TemplateFile ManufacturingVMazuredeploy.json -TemplateParameterFile ManufacturingVMazuredeploy.parameters.json -asjob
When the deployment is complete, go to the Azure portal home page, and then select Virtual Machines.
Verify that the virtual machine has been created.
On the Azure Portal home page, select Virtual Machines.
Select ManufacturingVM.
On ManufacturingVM, select Connect > RDP.
On **ManufacturingVM | Connect, select **Download RDP file. |
Save the RDP file to your desktop.
Connect to ManufacturingTestVM using the RDP file, and the username TestUser and the password TestPa$$w0rd!. After connecting, minimize the RDP session.
On the Azure Portal home page, select Virtual Machines.
Select CoreServicesVM.
On CoreServicesVM, select Connect > RDP.
On **CoreServicesVM | Connect, select **Download RDP file. |
Save the RDP file to your desktop.
Connect to CoreServicesTestVM using the RDP file, and the username TestUser and the password TestPa$$w0rd!.
On both VMs, in Networks, select Yes.
On CoreServicesTestVM, open a PowerShell prompt.
Use the following command to note the IPv4 address of the machine:
ipconfig
On the ManufacturingVM, open a PowerShell prompt.
Use the following command to verify that there is no connection to CoreServicesVM on CoreServicesVnet. Be sure to use the IPv4 address for CoreServicesVM.
Test-NetConnection 10.20.20.4 -port 3389
The test connection should fail, and you will see a result similar to the following:
In Search resources, services, and docs (G+/), enter Virtual network gateway, and then select Virtual network gateways from the results.
In Virtual network gateways, select CoreServicesVnetGateway.
In CoreServicesGateway, select Connections, and then select + Add.
Note:
You will not be able to complete this configuration until the virtual network gateways are fully deployed.
Use the information in the following table to create the connection:
Option | Value |
---|---|
Name | CoreServicesGW-to-ManufacturingGW |
Connection type | VNet-to-VNet |
First virtual network gateway | CoreServicesVnetGateway |
Second virtual network gateway | ManufacturingVnetGateway |
Shared key (PSK) | abc123 |
Use Azure Private IP Address | Not selected |
Enable BGP | Not selected |
IKE Protocol | IKEv2 |
Subscription | No changes required |
Resource group | No changes required |
Location | East US |
To create the connection, select OK.
In Search resources, services, and docs (G+/), enter Virtual network gateway, and then select Virtual network gateways from the results.
In Virtual network gateways, select ManufacturingVnetGateway.
In CoreServicesGateway, select Connections, and then select + Add.
Use the information in the following table to create the connection:
Option | Value |
---|---|
Name | ManufacturingGW-to-CoreServicesGW |
Connection type | VNet-to-VNet |
First virtual network gateway | ManufacturingVnetGateway |
Second virtual network gateway | CoreServicesVnetGateway |
Shared key (PSK) | abc123 |
Use Azure Private IP Address | Not selected |
Enable BGP | Not selected |
IKE Protocol | IKEv2 |
Subscription | No changes required |
Resource group | No changes required |
Location | West Europe |
To create the connection, select OK.
In Search resources, services, and docs (G+/), enter connections, and then select connections from the results.
Wait until the status of both connections is Connected. You may need to refresh your screen.
Note: This could take a couple of minutes.
On the ManufacturingVM, open PowerShell.
Use the following command to verify that there is now a connection to CoreServicesVM on CoreServicesVnet. Be sure to use the IPv4 address for CoreServicesVM.
Test-NetConnection 10.20.20.4 -port 3389
The test connection should succeed, and you will see a result similar to the following:
Close the Remote Desktop connection windows.
Congratulations! You have configured a VNet-to-VNet connection by using a virtual network gateway.