Wednesday, March 9, 2022

Create and connect the VPN gateways

 The hub and on-premises virtual networks are connected via VPN gateways.

Create a VPN gateway for the hub virtual network

Now create the VPN gateway for the hub virtual network. Network-to-network configurations require a RouteBased VpnType. Creating a VPN gateway can often take 45 minutes or more, depending on the selected VPN gateway SKU.

  1. From the Azure portal home page, select Create a resource.
  2. In the search text box, type virtual network gateway.
  3. Select Virtual network gateway, and select Create.
  4. For Name, type GW-hub.
  5. For Region, select the same region that you used previously.
  6. For Gateway type, select VPN.
  7. For VPN type, select Route-based.
  8. For SKU, select Basic.
  9. For Virtual network, select VNet-hub.
  10. For Public IP address, select Create new, and type VNet-hub-GW-pip for the name.
  11. Accept the remaining defaults and then select Review + create.
  12. Review the configuration, then select Create.

Create a VPN gateway for the on-premises virtual network

Now create the VPN gateway for the on-premises virtual network. Network-to-network configurations require a RouteBased VpnType. Creating a VPN gateway can often take 45 minutes or more, depending on the selected VPN gateway SKU.

  1. From the Azure portal home page, select Create a resource.
  2. In the search text box, type virtual network gateway and press Enter.
  3. Select Virtual network gateway, and select Create.
  4. For Name, type GW-Onprem.
  5. For Region, select the same region that you used previously.
  6. For Gateway type, select VPN.
  7. For VPN type, select Route-based.
  8. For SKU, select Basic.
  9. For Virtual network, select VNet-Onprem.
  10. For Public IP address, select Create new, and type VNet-Onprem-GW-pip for the name.
  11. Accept the remaining defaults and then select Review + create.
  12. Review the configuration, then select Create.

Create the VPN connections

Now you can create the VPN connections between the hub and on-premises gateways.

In this step, you create the connection from the hub virtual network to the on-premises virtual network. You'll see a shared key referenced in the examples. You can use your own values for the shared key. The important thing is that the shared key must match for both connections. Creating a connection can take a short while to complete.

  1. Open the FW-Hybrid-Test resource group and select the GW-hub gateway.
  2. Select Connections in the left column.
  3. Select Add.
  4. The the connection name, type Hub-to-Onprem.
  5. Select VNet-to-VNet for Connection type.
  6. For the Second virtual network gateway, select GW-Onprem.
  7. For Shared key (PSK), type AzureA1b2C3.
  8. Select OK.

Create the on-premises to hub virtual network connection. This step is similar to the previous one, except you create the connection from VNet-Onprem to VNet-hub. Make sure the shared keys match. The connection will be established after a few minutes.

  1. Open the FW-Hybrid-Test resource group and select the GW-Onprem gateway.
  2. Select Connections in the left column.
  3. Select Add.
  4. For the connection name, type Onprem-to-Hub.
  5. Select VNet-to-VNet for Connection type.
  6. For the Second virtual network gateway, select GW-hub.
  7. For Shared key (PSK), type AzureA1b2C3.
  8. Select OK.

Verify the connection

After about five minutes or so, the status of both connections should be Connected.

Gateway connections



No comments:

Post a Comment