Creating an Azure S2S VPN

Find out how to set up an Azure S2S VPN.

John Savill

February 4, 2015

2 Min Read
vpn router cables

Q: I'm using Windows Server as my local VPN gateway to connect to Azure; is there anything special I need to configure on my local gateway OS instance?

A: It's actually a pretty simple process because the Azure portal will create a PowerShell script to run on your Windows Server 2012 (or later) OS instance that performs all the configuration and even installs RRAS on the box for you. The only requirements are as follows:

  • You need two network connections: one connection to the public Internet, which will connect to Azure (this connection should be configured with the default gateway) and a second connection that will connect to your internal network (this connection doesn't have a default gateway). Note that because the internal NIC doesn't have a default gateway, you'll need to add routes for other local subnets to enable traffic flow.

  • When you create the gateway in Azure, ensure that you select the dynamic gateway type and wait for the gateway to be created before continuing.

  • Once the gateway is created in Azure, use the Download VPN Device Script option and select the RRAS option. Waiting for the gateway to be completed allows all the values in the PowerShell code to be populated, including the Azure IP address and the connection key.

  • Run the downloaded PowerShell code (which might require a reboot after enabling RRAS; this is called out in the script).

  • To check on the connection status, use the Get-VpnS2SInterface PowerShell cmdlet, which should show Connected. Note that the Azure portal might take a few minutes to update.

  • If your Azure on-premises gateway isn't the default gateway for your network, you'll need to update the routing tables on OS instances that need to communicate to Azure via the gateway; for example:

    Route add -p 10.0.19.0 mask 255.255.255.0 10.0.16.25

    where 10.0.19.0/24 is the Azure subnet and 10.0.16.25 is the local IP address of the Azure VPN gateway on your network.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like