In the ever changing and improving world of Microsoft Azure, there has officially been a shift to the new Azure portal as the primary tool for interacting with Azure. On December 2, 2015 an official announcement was made that the portal located at portal.azure.comwas officially taken out of “preview” and made generally available (or “GA”).
There is still not complete feature parity between the original (now referred to as “classic” or “v1”) portal and the new portal but changes are being made to provide additional functionality on a very fast paced schedule. There are still features that only work in one portal or the other, but that will be a whole other blog posting because there is a lot of material there.
In this blog I want to talk specifically about one new function that is an important action that has recently changed. In the world of hybrid cloud deployments and extending the corporate datacenter into the cloud, a key piece of that environment is the actual connection between the on-premises data network and the virtual network (VNET) created in Azure. This is often accomplished through the use of a Site to Site (S2S) virtual private network (VPN).
In the process of writing this blog post, I discovered that Keith Mayer created a posting on his site that gives a high level overview of the process that I will be describing here. If you are fairly confident in your Azure skills and are looking for a quick overview, his post can be found here. If you are looking for a more in-depth and detailed description of the process to create this ARM based Site to Site VPN, then by all means please continue reading.
In the classic portal, the GUI provided all the steps needed to set up and configure a Site to Site VPN through the Azure Service Management (ASM) API. The new portal is focused primarily on Azure Resource Manager (ARM) as the new API for Azure management. The primary way to complete this task in the ARM model in the past has been through PowerShell (for which there is a great article here). Up until the past few weeks, there were not sufficient options through the new portal to complete all the required steps to create an S2S VPN through the portal GUI. This has now changed. You now have the option to use the GUI or use PowerShell, whichever you prefer. Since there is already documentation linked above on the PowerShell option, this blog will walk through the GUI option.
To create as S2S VPN to Azure regardless of which method you choose, there are a few prerequisites that need to be seen to first.
1. You need to have an Azure subscription. Everything is Azure is based around a subscription. If you are looking to create a connection between your corporate datacenter and Azure, this subscription should belong to your organization. If you are just wanting to set something up for test, you can use a free one-month trial subscription or, if you have an MSDN subscription, you have access to $150 of Azure credit every monthas part of your benefits. You must have the ability to sign in to the Azure portal with a valid username and password for whatever subscription you are going to be using.
2. You need to have a device in your on-premises network that can negotiate one end of the S2S VPN tunnel. This can be either a VPN gateway device (such as a Cisco ASA) or it can be a Server 2012R2 system with Routing and Remote Access Services (RRAS) installed. For a list of devices that Microsoft has tested and for configuration data from other manufacturers, please check this page.
3. You need to have an available private IP address space that does not overlap with any existing address spaces in your on-premises network. This address space should be large enough to accommodate at least 2 subnets, although the size of the address space is really determined by the number of resources you intend to host in Azure.
Once these prerequisites are appropriately addressed, you can begin the process of creating your S2S VPN connection.
Azure Virtual Network
You begin the process by creating a new Virtual network or VNET in the Azure portal. From the main page of the portal, choose the New button in the top left corner.
On the blade that slides out from there choose Networking and on the next blade choose Virtual network as shown in the graphic below.
A new blade will open describing what a Virtual Network is. At the bottom of the blade you will have an option to choose your deployment model. It will default to Classic. Use the drop down arrow and choose Resource Manager. This choice ensures that you are creating this VNET as an ARM VNET, not a Classic VNET. (It also demonstrates that you do have the ability to control many of the classic portal functions from the new portal as well.) Then click on the blue Create button.
Another blade will slide out and give you a series of options for the creation of this VNET.
The opened blades will close and when the deployment is complete, the notification icon in the toolbar across the top of the screen will turn from black to green.
You can check to confirm the creation of the VNet by clicking the Browse button from the main portal page, scrolling down and clicking on Virtual Networks. This should open a blade that lists the Virtual Network that you just created.
At this point you have created a Virtual Network or VNet in Azure inside of a resource group. You can now use that VNet and Resource Group to create and deploy VM’s in Azure that you will be able to connect to your onsite network once this process is completed.
I have said a couple of times that you need at least two subnets in this VNet. At least one is for the VM resources that will live in Azure. You can of course have more than one subnet to organize your VMs according to your needs, but on top of that there is one more subnet that is required. The VPN gateway that Azure we will create a few steps from now needs its own subnet. So we need to add at least that subnet to the VNet. Just for fun we will create two – one additional subnet for use with VMs and one for the gateway. Since we have just browsed to our VNet, we need to change the settings. There is a Settings button at the top of the blade.
Clicking the Settings button will open a new blade that will list out several objects including Subnets. I initially created a /27 subnet that I labeled “frontend” when we created the VNet. I have since added another /27 that I called “backend” at 192.168.5.32/27 as you can see from this screen shot. To add a subnet, you use the Add button at the top. Simple enough. All you need to do is supply a name and a valid CIDR notated address range that is within the overall VNet address space.
The critical piece to remember when creating the gateway subnet for the VNet is that it needs to be named “GatewaySubnet”. If you do not use this name – Azure will not recognize the subnet. It also must be a /29 or larger CIDR block.
Local Network Gateway
At this point we have defined the VNet in Azure. Now we need to define your local network in Azure as well so that routing can be established between your on-prem network and the VNet. We do this by creating a Local Network Gateway.
Again start by choosing the New button in the top left corner of the screen. Instead of navigating through the menu, you can also choose to type into the search box at the top of the first blade. If you just type the word “local”, you should see an option from a drop down box to pick Local Network Gateway.
If you choose Local Network Gateway, you will see a blade that again gives you a blue Create button (but you already know this part by now J)
Virtual Network Gateway
Alright, we have defined a network and subnets in Azure that we can put resources in and we have defined a gateway subnet for connection to our on-premises network. We have also defined in Azure the local network we want to connect to and the address of the gateway that exists in that on-premises network. So what we need to do now is create the Virtual Network Gateway that will live in our GatewaySubnet. This will be the Azure equivalent of the gateway device in your local DMZ.
A note before we begin the creation process regarding types of VPN tunnels and a recent nomenclature change within Azure. There are two main types of VPN tunnels. In the world of Azure classic they are referred to as Static and Dynamic. The difference between the two is that Static VPN connections support one and only one VPN tunnel. You can create a S2S VPN as a static route, but if you want to have more than one VPN tunnel (eg. with a second carrier for redundancy) or if you want create a Point to Site (P2S) connection as well – Static VPN routing will not work for you. Dynamic routing allows for multiple S2S and P2S connections to connect to the same VPN gateway. In the Azure ARM world, the terminology has changed to better match up with what many of the VPN appliance and gateway manufacturers have been using. Static VPN routing is now referred to as Policy-based VPN. Dynamic VPN routing is now called Route-based VPN. Robert Waggoner has a great posting that explains this in much more detail. Your on-premises VPN device will support one or the other or possibly both types of routing. You need to know the capabilities of your on-prem device before proceeding with the next steps.
Again from the main portal page choose the New button, and in the search box at the top of the blade that slides out, type what you are looking for – Virtual Network Gateway and hit the Enter key. Find and select the Virtual Network Gateway option from the results of your search.
When you select the option from the list, you will get another blade -no surprise there and you should be expecting that by now 😉 where you will get a description of what a VNet Gateway is and at the bottom the now oh so familiar blue Create button.
Please be advised that the process of actually creating this gateway could take anywhere from 5 to 20 minutes. The last one of these I did with a customer took 35 minutes but that was on the ASM (classic) side. So, if it is not done when you think it should be, then in the immortal words of Ace Ventura, “just wait longer”. Part of the reason for this delay is that not only are we creating a software defined VPN gateway, but it is created in an extremely hardened fashion so as to be as secure as possible.
Once the deployment is completed, you need to go and check on the details of the gateway because one of the things we asked the deployment to do was to generate a Public IP address for the gateway. You will need to record this Public IP address so that it can be added to the configuration of your local VPN gateway. If you close all open blades that will take you back to the Azure portal home page. In the left side navigation pane, you will see an option called Recent. Click on it to find a link to the newly created gateway.
What we have created so far can be represented visually as below with one exception.
The piece that we have not created yet, is the lightning bolt connector between the local gateway and the Azure gateway. That is our next item.
We are again back at the New button in the top left corner. Use the search box at the top of the blade to find the Connection object.
Click on it and use the now all too familiar blue button to Create.
We have now defined the VPN connection from the Azure side. Before we can expect a connection to be successfully made, configuration of the on-premises gateway has to also be completed. There are far too many manufacturers and models for me to go into any detail on the configuration of these devices as a part of this blog posting. Several of the different manufacturers have created sample of the configuration scripts for their products for either Policy-based or Route-based VPN tunnels and have placed them here.
Once you have correctly configured your local gateway, you should be able to see the status of your Connection change from connecting – which it will do until it connects – to connected. Once you have a connected status – you have successfully created a VPN tunnel to your Azure VNet. You should now be able to create connections between systems in your on-premises network and VM’s running in Azure. Communication will be routed from your local LAN defined in the Local Network Gateway to the subnet(s) defined in the Azure VNet and you have successfully extended your local LAN out into the cloud.
Hope this helps with your Azure deployments!
Dave “head in the Azure cloud” Newman PFE.