
To set up a site-to-site VPN to Azure, you'll need to create a Virtual Network Gateway. This is a crucial step, as it enables secure communication between your on-premises network and Azure.
A Virtual Network Gateway is a type of VPN gateway that allows you to connect your on-premises network to Azure. It's essentially a virtual device that handles the encryption and decryption of data.
To create a Virtual Network Gateway, you'll need to specify the VPN type, which can be either Route-Based or Policy-Based. This decision will impact the configuration of your VPN.
The VPN type will also determine the type of routing you'll use, which can be either BGP or static routing.
Readers also liked: Azure Virtual
Configuration
To configure a site-to-site VPN to Azure, you'll need to set up a VPN device. This device requires a shared key, which is the same key you specify when creating your site-to-site VPN connection. We recommend generating a more complex key for security.
A different take: Wix Website - Site Page to Different Webpage on Site
You'll also need to obtain the public IP addresses of your virtual network gateway instances. If your gateway is in active-active mode, you'll have two IP addresses, one for each active gateway VM instance. Be sure to configure your device with both IP addresses.
Depending on your VPN device, you might be able to download a VPN device configuration script. For more information, see Download VPN device configuration scripts.
To find the public IP address of your virtual network gateway, use the az network public-ip list command. The output will display the list of public IPs in table format.
Here are some additional resources to help with your configuration:
- For information about compatible VPN devices, see About VPN devices.
- For links to device configuration settings, see Validated VPN devices.
- For basic information about VPN device configuration, see Overview of partner VPN device configurations.
Remember to check with your device manufacturer for the latest configuration information, as the list of tested versions may not include your OS version.
Azure Setup
To set up Azure for site-to-site VPN, you'll need to create a virtual network gateway. This is where Azure's VPN gateway will be located. In the Azure portal, search for 'Virtual Network Gateway' and select the entry.
Consider reading: Azure Vpn Gateway Skus
You'll need to specify the values for your virtual network gateway, which includes the name, location, and VPN type. Note that Cisco Meraki Security Appliances and Teleworker Gateways use policy-based routing, which has specific restrictions. For example, policy-based routing only supports IKEv1, while route-based routing only supports IKEv2.
To deploy the virtual network gateway, click the Create button at the bottom of the page. This will create the local network gateway, which will be used to connect your on-premises network to Azure.
To create a local network gateway, you'll need to specify the site name, on-premises VPN device IP address, and IP address prefixes that will be routed through the VPN gateway. If your on-premises network changes, you can easily update these values later.
If you're using Active/Active mode, you'll need to select an existing unused public IP address or create a new one and provide a name for it. You'll also need to select Zone-redundant in the Availability zone.
Here's a summary of the Azure setup options:
In both VPN modes, static or dynamic routing with BGP is supported between MacStadium and Azure. Be sure to enable the TCP State Bypass feature in your ASA firewall if you're using Active/Active mode.
Network Configuration
Network configuration is a crucial step in setting up a site-to-site VPN to Azure. You'll need a VPN device to establish a connection to your on-premises network.
To configure your VPN device, you'll need the shared key, which is the same key you specify when creating your site-to-site VPN connection. You'll also need the public IP addresses of your virtual network gateway instances.
For active-active mode VPN gateways, ensure tunnels are established to each gateway VM instance. If you establish a tunnel to only one gateway VM instance, the connection will go down during maintenance.
Here are some key values to note when configuring your VPN device:
- Shared key: This shared key is the same one that you specify when you create your site-to-site VPN connection.
- Public IP addresses of your virtual network gateway instances: Obtain the IP address for each VM instance.
- Active-active mode gateways: Ensure tunnels are established to each gateway VM instance.
You can customize site-to-site configurations in various ways, including BGP, forced tunneling, and highly available active-active connections.
Virtual
Virtual networks are a fundamental component of Azure's network configuration. They allow you to create a virtualized network environment that can be used to connect on-premises resources with Azure services.
To create a virtual network, you need to specify the resource group, name, region, IPv4 address space, and subnet settings. It's essential to coordinate with your on-premises network administrator to carve out an IP address range specifically for the virtual network.
Here are some key settings to consider when creating a virtual network:
You can create a virtual network by using the Azure portal, PowerShell, or Azure CLI. The process involves specifying the virtual network settings and then creating the virtual network.
Once you've created a virtual network, you can optionally configure Azure DDoS Protection. This is a simple process that requires no application or resource changes.
In the Azure portal, you can create a virtual network by searching for "Virtual network" and selecting the result. You can then follow the prompts to create the virtual network.
Make sure to review the IP addresses page and remove any address spaces or subnets that you don't need. This will help ensure that your virtual network is configured correctly.
After you've created your virtual network, you can move on to configuring the virtual network gateway. This is a critical component of your network configuration, as it allows you to connect your on-premises resources with Azure services.
For your interest: Azure Site Recovery Provides for Virtual Machines
Subnet
Subnet configuration is a crucial part of setting up a virtual network gateway. You'll need to create a gateway subnet, which is a specific subnet named GatewaySubnet that contains the IP addresses used by the virtual network gateway resources and services.
To create a gateway subnet, navigate to your virtual network's Subnets page and select + Gateway subnet. The name is automatically entered as GatewaySubnet, but you can adjust the IP address range value if necessary. An example is 10.1.255.0/27.
The number of IP addresses needed for the gateway subnet depends on the VPN gateway configuration you want to create. It's best to specify /27 or larger (/26, /25, etc.) for your gateway subnet.
Network security groups (NSGs) on the gateway subnet are not supported. Associating a network security group to this subnet might cause your virtual network gateway to stop functioning as expected.
Here are some key facts to keep in mind when creating a gateway subnet:
- The name of the subnet is automatically entered as GatewaySubnet.
- Adjust the IP address range value if necessary.
- Specify /27 or larger (/26, /25, etc.) for your gateway subnet.
- Do not adjust other values on the page.
- Save the subnet by selecting Save at the bottom of the page.
Modify IP Prefixes
To modify local network gateway IP address prefixes, you can use the az network local-gateway create command. This is useful when your gateway doesn't have a connection yet, and you want to add or remove IP address prefixes.
You must specify the entire list of prefixes each time you make a change, not just the ones you want to modify. In the example, 10.0.0.0/24 and 10.3.0.0/16 are specified as the prefixes to keep.
If you have a gateway connection and want to add or remove IP address prefixes, you can use the az network local-gateway update command. This will result in some downtime for your VPN connection.
You should specify all the prefixes, including the new ones you want to add, when updating the local gateway. For instance, in one example, 10.0.0.0/24 and 10.3.0.0/16 are already present, and the prefixes 10.5.0.0/16 and 10.6.0.0/16 are added when updating.
Suggestion: Azure Virtual Network Gateway
To Modify 'IpAddress'
To modify 'IpAddress', you'll need to update the local network gateway with the new IP address. This is necessary when you change the public IP address for your VPN device.
You can use the az network local-gateway update command to modify the gateway IP address. Replace the values 'Site2' and 'TestRG1' with your own.
The command requires you to specify the existing name of your local network gateway, so be sure to use the same name to avoid creating a new gateway instead of updating the existing one.
You'll need to verify that the IP address is correct in the output.
Device Configuration
Device configuration is a crucial step in setting up a site-to-site VPN to Azure. You'll need to configure your VPN device with the shared key, which is the same one you specified when creating your site-to-site VPN connection.
To find the public IP address of your virtual network gateway, use the az network public-ip list command. This will display the list of public IPs in table format, making it easy to read.
For S2S connections with an active-active mode VPN gateway, ensure tunnels are established to each gateway VM instance. If you establish a tunnel to only one gateway VM instance, the connection will go down during maintenance.
You might be able to download a VPN device configuration script from Azure, but be sure to check the device manufacturer's website for the latest configuration information.
Here are some key parameters you'll need to complete your configuration:
- IKE version
- DH group
- Authentication method
- Encryption and hashing algorithms
- SA lifetime
- PFS
- DPD
Configure MX Security Appliance
To configure your MX Security Appliance, you'll need to specify a shared key. This key should match the one you used when creating your Site-to-Site VPN connection.
You can find the Public IP address of your virtual network gateway in the Azure portal. To do this, navigate to Virtual network gateways, then click the name of your gateway.
In the Meraki dashboard, you'll need to specify the vnet subnets under the private subnet field on the site to site vpn page.
Here's a quick rundown of the information you'll need to provide:
- Shared key: match the one used for Site-to-Site VPN connection
- Public IP address: viewable in Azure portal under Virtual network gateways
- vnet subnets: specify under private subnet field in Meraki dashboard
Configure Your Device
To configure your device for a site-to-site VPN connection, you'll need to specify the shared key, which is the same key used when creating the VPN connection. This shared key should be a complex one, not just a simple key.
You'll also need to obtain the public IP addresses of your virtual network gateway instances. If your gateway is in active-active mode, you'll have two IP addresses, one for each active gateway VM. Make sure to configure your device with both IP addresses.
Intriguing read: Google Fi Vpn vs Google One Vpn
Depending on your VPN device, you might be able to download a configuration script from Azure. Check the Azure website for more information on compatible VPN devices and configuration settings.
If you're using an ASA/ASAv firewall, make sure to use a configuration template to avoid any issues with the VPN connection. The template will guide you through the configuration process.
To find the public IP address of your virtual network gateway, use the az network public-ip list command. The output will display the list of public IPs in a table format.
Here are the steps to configure your VPN device:
- Specify the shared key
- Obtain the public IP addresses of your virtual network gateway instances
- Download a configuration script from Azure (if applicable)
- Use a configuration template for ASA/ASAv firewalls
- Find the public IP address of your virtual network gateway using the az network public-ip list command
Creating a
Creating a Site-to-Site VPN requires a few key steps. You'll need to create a Virtual Network Gateway in Azure, which involves specifying the public IP address of your virtual network gateway.
To create a Virtual Network Gateway, you'll need to log in to Azure and click New, then search for Virtual Network Gateway and click it to open the Virtual Network Gateway pane. You'll need to enter the settings for your virtual network gateway, including the public IP address, which you can view by using the Azure portal, PowerShell, or CLI.

The public IP address is used to connect to your virtual network gateway. You can also create a Public IP address in the Azure portal, which is required for the virtual network gateway. Creating the virtual network gateway might take some time, and you'll receive a notification when it's done.
To create a Local Network Gateway, you'll need to click All resources, then click Add and then click See all, and search for Local network gateway and then click Create local network gateway. You'll need to enter the local network gateway IP address, which is the FortiGate's external IP address.
A Site-to-Site VPN connection can be created by logging in to the Azure portal, locating and selecting your virtual network gateway, and then clicking Connections and then clicking Add. You'll need to enter the settings for your connection, including the Shared Key (PSK), which must match the Pre-shared Key for the FortiGate tunnel.
Here's a summary of the steps to create a Site-to-Site VPN:
- Create a Virtual Network Gateway in Azure.
- Create a Local Network Gateway in Azure.
- Create a Site-to-Site VPN Connection in Azure.
Verification
To verify your site-to-site VPN connection to Azure, you can check the connection status in the Azure portal. You can do this by navigating to your virtual network gateway, clicking Connections, and looking for the status of each connection.
The connection status should show 'Succeeded' and 'Connected' when you have made a successful connection. You can also access the VPN Status page by navigating to Organization > Monitor > VPN Status tab, or by navigating to Security & SD-WAN > Monitor > VPN Status tab.
To verify your connection, you can use the az network vpn-connection show command, which will display the connection status. The status will show 'Connecting' while the connection is being established, and will change to 'Connected' once the connection is established.
Worth a look: Azure App Insights vs Azure Monitor
Verify Shared Key Values
To verify the shared key values, you need to check if the shared key value is the same as the one used for your VPN device configuration.

If the shared key values don't match, you'll need to run the connection again using the correct value or update the device with the correct value from the return.
You can view the shared key using the az network vpn-connection-list command.
Here are the steps to follow:
- Check if the shared key values match.
- Run the connection again if they don't match.
- Update the device if necessary.
Verify the
Verifying your VPN connection is a crucial step to ensure it's working correctly. You can view the connection status of a Resource Manager VPN Gateway in the Azure portal by navigating to the connection.
To do this, select All resources from the Azure portal menu, then select your virtual network gateway. On the blade for your virtual network gateway, click Connections to see the status of each connection.
Click the name of the connection you want to verify to open Essentials, where you can view more information about your connection. The Status will be 'Succeeded' and 'Connected' when you have made a successful connection.

Alternatively, you can access the VPN Status page by navigating to the Organization > Monitor > VPN Status tab, or by navigating to the Security & SD-WAN > Monitor > VPN Status tab.
Here's what you can find on the non-Meraki peers tab:
- Status - whether the peer is currently reachable or not.
- Name - Name of the non-Meraki peer configured on the Security & SD-WAN > Configure > Site-to-Site VPN page.
- Public IP - Pubic IP configured for the non-Meraki VPN peer.
- Subnets - All subnets configured under the "Remote Subnets" field on the Security & SD-WAN > Configure > Site-to-Site VPN page.
You can also verify your VPN connection by using the az network vpn-connection show command in the Azure CLI. This will show you the connection status, which will be 'Connecting' while the connection is being established and 'Connected' once it's established.
The shared key value is another important thing to verify. Make sure it matches the value you used for your VPN device configuration. If it doesn't, you may need to update the device or re-run the connection.
To view the shared key, use the az network vpn-connection-list command. This will display a list of all your VPN connections, including the shared key values.
Public IP
To view the public IP address of your virtual network gateway, you'll need to navigate to its Properties page. This can be found by expanding the Settings section on the Overview page.
You might only see one IP address if your gateway is in active-passive mode, but if it's in active-active mode, you'll see two public IP addresses listed, one for each gateway VM instance.
To view more information about the IP address object, simply click the associated IP address link.
The public IP address of your virtual network gateway can also be found using the az network public-ip list command. This will display a list of public IPs in table format, making it easy to read and understand.
Here's a breakdown of what you can expect to see when using this command:
Connection
Creating a site-to-site VPN connection to Azure involves several steps. You'll need to create and configure the VPN connection between Azure and the MacStadium private cloud.
To start, you'll need to create a virtual network gateway and a local network gateway in Azure. Then, you can create the VPN connection by following the steps outlined in the Azure portal.
The connection type should be set to Site-to-Site (IPsec), and you'll need to select the correct region and virtual network gateway. You'll also need to provide an IPSec pre-shared key, which should be kept confidential.
Here are the key settings to configure for the VPN connection:
- IKE Protocol: IKEv2
- Enable BGP
- Enable Custom BGP Addresses
- Primary Custom BGP Address: APIPA address created earlier
- IKE Phase 1 and IKE Phase 2: set according to the requirements
Once you've configured the VPN connection, you'll need to download the configuration template from Azure. This will provide you with the necessary settings to configure the Cisco firewall in the MacStadium private cloud.
Deployment
To establish a site-to-site VPN to Azure, you'll need to configure both the Azure Portal and the Meraki Dashboard. Configurations must be made on both platforms to establish the IPSec tunnel.
You'll need to create a new tunnel on both the Azure Portal and the Meraki Dashboard. After creating a new tunnel, send traffic from a client in a VPN-enabled VLAN behind the MX to a subnet behind the Azure gateway to bring the tunnel up.
In the Azure portal, you'll need to deploy a Virtual Network Gateway if one isn't already created. This involves searching for 'Virtual Network Gateway', selecting the entry, and clicking the Create button to open the Create virtual network gateway page.
To configure the Azure VPN, you'll need to specify the values for your virtual network gateway, including the Azure VPN type. Note that Azure VPN type can be either route-based or policy-based, but this will affect the supported protocols: route-based only supports IKEv2, while policy-based only supports IKEv1.
Here are the steps to deploy a Virtual Network Gateway:
- Search for 'Virtual Network Gateway' in the Azure portal
- Select the entry and click the Create button
- On the Create virtual network gateway page, specify the values for your virtual network gateway
You'll also need to deploy an Azure Local Network Gateway. This involves specifying the IP address of the on-premises VPN device to which you'll create a connection, as well as the IP address prefixes that will be routed through the VPN gateway to the VPN device.
Troubleshooting
Troubleshooting issues with your site-to-site VPN to Azure can be frustrating, but there are some common problems to look out for.
Check your VPN gateway configuration, as incorrect or incomplete settings can cause connectivity issues. Refer to the "Configuring the VPN Gateway" section for more information.
If you're experiencing issues with VPN tunnel establishment, ensure that the Azure VPN gateway is correctly provisioned and the on-premises VPN device is configured to use the correct public IP address.
Verify that the Azure VPN gateway is enabled and the correct VPN protocol is selected in the Azure portal. This can be found in the "Creating a VPN Gateway" section.
Check your network configuration, as issues with routing or firewalls can prevent VPN connectivity. The "Network Configuration for Azure VPN" section provides more details on this.
If you're still experiencing issues, try restarting the VPN gateway or checking for any firmware updates on your on-premises VPN device.
Frequently Asked Questions
What is the difference between point to site and site-to-site VPN in Azure?
Point-to-site VPNs don't require an on-premises public-facing IP address or a VPN device, whereas site-to-site VPNs do. This makes point-to-site VPNs a more flexible option for remote access, but requires compatible configurations with site-to-site connections
How to check site-to-site VPN status in Azure?
To check the status of your site-to-site VPN in Azure, navigate to your virtual network gateway and select the "Connections" option. Here, you can view the status of each connection.
Can Azure ExpressRoute and site-to-site VPN coexist?
Yes, Azure ExpressRoute and site-to-site VPN can coexist, but they require specific configuration steps to set up and manage together. To do this, you'll need to delete and recreate certain gateway settings.
What is the lifetime of Azure site-to-site VPN?
The lifetime of Azure site-to-site VPN is fixed at 28,800 seconds (8 hours). This non-configurable value determines how long the connection remains active before needing to be re-established.
Featured Images: pexels.com


