Cloudify my lab with Windows Azure

· 7 min read

As I got an unlimited access to Windows Azure I wanted to check out how I could extend my lab into it and use it to store VMs workload (at first). Here what you need :

  • Citrix NetScaler VPX (tested with NS10.1: Build 122.17.nc & NS10.1: Build 123.9.nc)
  • Windows Azure Access
  • Homelab (running on vSphere 5.5)
  • Of course, you need licence for everything…

2014-01-19_16-23-08

 

Considerations :

Before configuring a CloudBridge tunnel between a CloudBridge appliance in datacenter and  Microsoft Azure, consider the following points:

  1. The CloudBridge appliance must have a public facing IPv4 address (type SNIP) to use as a tunnel end-point address for the CloudBridge tunnel. Also, the CloudBridge appliance should not be behind a NAT device. (or you’ll have to setup a route for your LAN computers, I’m explaining how to at the end of this blog)
  2. Azure supports the following IPSec settings for a CloudBridge tunnel. Therefore, you must specify the same IPSec settings while configuring the CloudBridge appliance for the CloudBridge tunnel.
    • IKE version = v1
    • Encryption algorithm = AES
    • Hash algorithm = HMAC SHA1
  3.  You must configure the firewall in the datacenter edge to allow the following.
    • Any UDP packets for port 500
    • Any UDP packets for port 4500
    • Any ESP (IP protocol number 50) packets
  4. IKE re-keying, which is renegotiation of new cryptographic keys between the CloudBridge tunnel end points to establish new SAs, is not supported. When the Security Associations  (SAs) expire, the tunnel goes into the DOWN state. Therefore, you must set a very large value for the lifetimes of SAs.
  5. You must configure Microsoft Azure before specifying the tunnel configuration on the CloudBridge appliance, because the public IP address of the Azure end (gateway) of the tunnel, and the PSK, are automatically generated when you set up the tunnel configuration in Azure. You need this information for specifying the tunnel configuration on the CloudBridge appliance.

First thing first, you need to use your Windows Azure account and follow the next step to begin to configure the IPSec tunnel by creating a local network

  1. In the left pane, click NETWORKS.
  2. In the lower left-hand corner of the screen, click + NEW.

2014-01-19_18-45-08

  1. In the NEW navigation pane, click NETWORK, then click VIRTUAL NETWORK, and then click ADD LOCAL NETWORK.

2014-01-19_18-42-13

  1. In the ADD A LOCAL NETWORK wizard, in the specify your local network details screen, set the following parameters:
    • NAME 
    • VPN DEVICE IP ADDRESS

2014-01-12_13-25-55

  1. In the lower right corner of the screen, click -> (forward arrow mark).
  2. On the Specify the address space screen, set the following parameter:
    • ADDRESS SPACE
      2014-01-12_13-27-21
  3. In the lower right corner of the screen, click the check mark.
  4. The local network entity is created in Windows Azure. You can verify it on the portal’s LOCAL NETWORK tab.

2014-01-19_18-50-00

Next, to create a virtual network in Azure by using the Microsoft Windows Azure Management Portal 

  1. In the left pane, click NETWORKS.
  2. In the lower left-hand corner of the screen, click + New.
  3. In the NEW navigation pane, click NETWORK, then click VIRTUAL NETWORK, and then click CUSTOM CREATE.
    2014-01-12_13-28-52
  4. In the CREATE A VIRTUAL NETWORK wizard, in the Virtual Network Details screen, set the following parameters:
    • NAME 
    • AFFINITY GROUP 
    • REGION 
    • AFFINITY GROUP NAME
      2014-01-12_13-29-56
  5. Click -> (forward arrow mark) in the lower right-hand corner of the screen.
  6. In the DNS Servers and VPN Connectivity screen, in SITE-TO-SITE CONNECTIVITY, select Configure Site-To-Site VPN and set the following parameter:
    • LOCAL NETWORK
      2014-01-12_13-31-46
  7. In the Address Space and Subnets screen, set the following parameters:
    • ADDRESS SPACE
    • SUBNETS
    • Gateway
      2014-01-19_19-06-40
  8. Click the check mark in the lower right-hand corner of the screen.
  9. The virtual network is created in Windows Azure and is listed on the VIRTUAL NETWORK tab.

To create a gateway by using the Microsoft Windows Azure Management Portal

  1. In the left pane, click NETWORKS.
  2. On the Virtual Network tab, in the Name column, click the virtual network entity for which you want to create a gateway.
  3. On the DASHBOARD page of the virtual network, at the bottom of the page, click + Create Gateway.
    2014-01-12_13-37-44
  4. When prompted to confirm you want the gateway created, chose STATIC and then click YES. Creating the gateway can take up to 15 minutes.
  5. When the gateway is created, the DASHBOARD page displays the gateway IP address, which is a public IP address.

 

To gather public IP address of the gateway and the pre-shared key information by using the Microsoft Windows Azure Management Portal 

1. In the left pane, click NETWORKS.

2. On the Virtual Network tab, in the Name column, click the virtual network entity.

3. On the DASHBOARD page of the virtual network, copy the Gateway IP Address.
2014-01-12_13-48-37

4. For the Pre Shared Key (PSK), at the bottom of the page, click MANAGE KEY.

5. In the MANAGE SHARED KEY dialog box, copy the SHARED KEY.

Configuring the CloudBridge appliance (NetScaler) – Homelab side

  1. Access the configuration utility by using a web browser to connect to the IP address of the CloudBridge appliance (NetScaler) in the datacenter.
  2. On the Configuration tab, in the navigation pane, click CloudBridge.
  3. In the right pane, under Getting Started, click Create/Monitor CloudBridge.
  4. Click Get Started.
    2014-01-12_13-50-53
    Note: If you already have any network bridge configured on the CloudBridge appliance, this screen does not appear, and you are taken to the CloudBridge Setup pane.
  5. In the CloudBridge Setup pane, click Microsoft Windows Azure.
    2014-01-12_13-51-05
  6. In the Azure Settings pane, in the Gateway IP Address* field, type the IP address of the Azure gateway. The CloudBridge tunnel is then set up between the CloudBridge appliance and the gateway. In the Subnet (IP Range)* text boxes, specify a subnet range (in Azure cloud), the traffic of which is to traverse the CloudBridge tunnel. Click Continue.
  7. In the NetScaler Settings pane, from the Local Subnet IP*drop-down list, select a publicly accessible SNIP address configured on the CloudBridge appliance. In Subnet (IP Range)* text boxes, specify a local subnet range, the traffic of which is to traverse the CloudBridge tunnel. Click Continue.
  8. In the CloudBridge Setting pane, in the CloudBridge Name text box, type a name for the CloudBridge that you want to create.
    2014-01-12_13-55-16
  9. From the Encryption Algorithm and Hash Algorithm drop-down lists, select the AES and HMAC_SHA1 algorithms, respectively. In the Pre Shared Security Key text box, type the security key.
  10. Click Done.

Now it’s done on both side and the tunnel became up few seconds after I finished the setup. You can still use the connect button on your Windows Azure Management Portal.

2014-01-19_20-26-32

I had some issue at first and have redo everything several time, no worry, you can erase everything on the Azure side, as well on the Netscaler. If everything is setup correctly and the tunnel doesn’t become up, check the file /tmp/iked.debug on the Netscaler.

Once everything has been setup and CloudBridge tunnel establish, I had to add a route (quick and dirty) to make allow machine from my network (home lab) to communicate with machines hosted in Windows Azure, for the Windows based machines, simply add a route with the following command :

route add 10.20.20.0 mask 255.255.255.0 192.168.0.250
          ^Azure Sub      ^Azure Mask   ^NetScaler SubnetIP

To add a route on my Mac I had to run this command :

route -n add 10.20.20.0/24 192.168.0.250
             ^Azure Sub    ^NetScaler SubnetIP

2014-01-19_20-39-54

Finally here are few links I gather along my installation and problems I had :

Windows Azure website : [here]

Citrix – CloudBridge for Microsoft Azure : [here] myCitrix account required

Microsoft – About VPN Devices for Virtual Network : [here]

Microsoft – Configure a Site-to-Site VPN in the Management Portal : [here]