Saturday 24 November 2012

Creating VPN and Hosting Web application on Azure - Part 1

In previous post, I had walkthrough about publishing a Web Application on multiple VMs and load balance all of them together. I also created a database server under the same cloud service where the web servers created. In this way, all the servers under a cloud service are connected together and the web application accessing the database server without any VPN connectivity. I also shown to scale up and scale down web servers VMs as per our requirement.

In this series, I am planning to take the same requirement and implement it by creating a VPN on Azure, having multiple database server with mirroring implemented, creating multiple VMs with load balanced together. In this way, we can achieve a standalone, highly available (more then 99.9), scalable web application on Azure.

To understand the goal in this series, following are the points of interest –
  1. Create a VPN on Azure. Here the VPN is a standalone network and not configured connecting on-premise network.
  2. Create three SQL Server 2012 VMs for database servers from the SQL Server 2012 platform image. Install application database (Ex: Northwind) in two database server and configure the mirroring between the two and use the third database server as witness server.
  3. Create VM with Windows Server 2012 platform image and install all necessary software such as IIS, .NET runtime etc.,
  4. Install targeted web application on it by connecting the database servers.
  5. Create image from the VM created for Web Server application.
  6. Create a Cloud Service and add required number of VMs from the image created in Step 5.
  7. Add/Remove the instances from the Cloud Services and make them to be load balanced across all front end VMs.
In this post, I am planning a walkthrough on creating VPN on Azure.

CIDR notation and calculator

Before creating Virtual Network on Azure, we need to understand the CIDR notation and the CIDR calculator. I am not planning to explain in detail about CIDR, Below are the urls to know more –
http://en.wikipedia.org/wiki/CIDR_notation
http://doc.m0n0.ch/quickstartpc/intro-CIDR.html

CIDR notation is an IP standard that is used for specifying the range of IP Address in a standard way. For Example, when configuring a subnet on a Virtual Network, we need to specify the range of IP address for which we are using CIDR notation here. The value after the / refers to the subnet map in this notation.

There are lots of tools available on the net to calculate the CIDR notation. The one which I am referring is below –
http://www.subnet-calculator.com/cidr.php

There is considerable information required to know more about how this calculator works. But for those who are not used this calculator before, I wish to provide a simple way to calculate the CIDR notation.
  • The IP Address in the calculator tells the starting range of the IP address in the CIDR notation.
  • The Maximum Addresses value tells how many IP address required in this range.
By selecting at least these two values, we can get a CIDR notation which starts from the IP address specified and the range ends by calculating with the maximum number of IP address required from the Maximum Addresses dropdown.

If we know the subnet, we can select the same in the Mast Bits. So we can come to know the range of IP address it provides. Azure allows the subnets from 8 to 29.

Azure VPN allows the following address space ranges in the VPN.
  1. 10.0.0.0/8 – Which provides the range 10.0.0.0 - 10.255.255.255
  2. 172.16.0.0/12 – Which provides the range 172.16.0.0 - 172.31.255.255
  3. 192.168.0.0/16 – Which provides the range 192.166.0.0 - 192.166.255.255

Creating Virtual Network

In this example, I am planning to create a VPN which has the address space of 10.79.0.0/16 (so I can create many VMs in the range 10.79.0.0 - 10.79.255.255). I also wanted to categorize the VMs using three subnets. The subnet would be

VPN CIDR Notation: 10.79.0.0/16 (Range 10.79.0.0 - 10.79.255.255)
  • Subnet Name: DNS Subnet
    CIDR Notation: 10.79.1.0/24
    Range: 10.79.1.0 - 10.79.1.255
  • Subnet Name: FE Subnet
    CIDR Notation: 10.79.2.0/24
    Range: 10.79.2.0 - 10.79.2.255
  • Subnet Name: BE Subnet
    CIDR Notation: 10.79.3.0/24
    Range: 10.79.3.0 - 10.79.3.255
Step 1: Open the management portal and press NEW to create a new VPN. Select NETWORKS --> VIRTUAL NETWORK --> CUSTOM CREATE. The portal will open a popup window.


Step 2: Provide the name of the Virtual Network. Create or select the Affinity Group.


Press Next.

Step 3: In the address space, enter the CIDR notation which specified address range of this VPN. As mentioned above I am considering the address range 10.79.0.0/16. Provide the Subnet details also as mentioned above.


Press Next.

Step 4: The next screen shows configuration to connect to the on-premise server. This allows us to extend the on-premise network to cloud.

It is important to know that, currently Azure allows us to connectivity only with the physical network and not another cloud network. So we are not allows to connect two VPN located on cloud.

As I don’t have a on-premise network which can be extended to cloud and it is not a goal in this POC, I don’t required any configuration here.
So press OK to create the VPN.


Once the VPN created, that will be added in the network list as below.


In this post, we had created the VPN on Azure. We will be adding VMs and configuring for our POC from next post.


0 Responses to “Creating VPN and Hosting Web application on Azure - Part 1”

Post a Comment