Configure Site-to-Site IPsec Tunnel between Windows Azure Cloud and D-Link DFL-210
- Tutorial
Greetings!
In this article, I will describe in stages the entire process of setting up a Site-to-Site tunnel between the Windows Azure cloud and the D-Link DFL-210 firewall (relevant for the DFL device line: 210 \ 260E \ 800 \ 860E)
Attention! All configuration steps are accompanied by a large number of pictures!
First, create a new Windows Azure virtual network using the wizard.
Name: Habratest
New Territorial Group: Habragroup
Region: Western Europe
Then enter the name and address of the local DNS (if necessary). Otherwise, we use DNS from Windows Azure, or any public one.
We put a daw “Configure VPN connection of the“ network-to-network ” type”
In the next step, enter the settings of our DFL:
Name: Mydfl
IP-address of the VPN device: 78.153.146.110 - this is the allocated static IPv4 address of our DFL ( This is important. If the DFL is behind NAT, then we won’t succeed )
Address space: 192.168 .22.0 / 24 - the local subnet that we will connect to Windows Azure
In the last step, we enter the settings of the subnet to which we will connect (it will be used for services created in Windows Azure)
In our case, the settings will be as follows:
Total virtual network address space: 172.16.80.0/24
Subnet:
AzureSubnet 172.16.80.0/27
Gateway 172.16.80.32/29
Virtual subnet created!
Go to the " Settings " of the newly created virtual network and verify that we did everything right
On the tab " Dashboard " we see the following picture
Click the " Create a gateway " button at the bottom of the page and select the " Static Routing " mode . Confirm your intentions with the OK button .
We wait 10-15 minutes for Windows Azure to create a gateway for us
So, the gateway is created. We look what Windows Azure provided to us: the
IP address of the gateway: 23.97.132.122
Next, click the " Key Management " button at the bottom of the page and get our personal pre-shared key:
R9GrgLgZPosdZ7isMdt8MkrDQnfBwUbO
General requirements for the gateway can be found here:
http://msdn.microsoft.com/en-us/library/windowsazure/jj156075.aspx#BKMK_VPNGateway
Now let's add all the cloud's IP addresses to the directory (" Objects-> Address book-> InterfaceAddresses ):
Name: Habratest_cloud_gateway
Value: 23.97.132.122
Name: Habratest_cloud_subnet
Value: 172.16.80.0/24
Then go to " Objects-> Authentication Objects " and add a new object of the " Pre-shared key " type:
Name: Habratest_cloud_key
Passphrase: R9GrgLgZPosdZ7isMdt8MkrDQnfBwUbO
Next, go to the item “ Objects-> VPN Objects-> IKE Algorithms ” and create a new IKE algorithm:
Name: Habratest_cloud_stage1
Put the daws: 3DES and AES (128 128 256), as well as the daw SHA1
After creating the IKE algorithm, we proceed to creating the IPsec algorithm ( "Objects-> VPN Objects-> IPsec Algorithms" ):
Name: Habratest_cloud_stage2 Jackdaws
: the same as IKE
Now we proceed directly to creating the rule for the IPsec tunnel ( “Interfaces-> IPsec” ): General
tab Name: Habratest_cloud_IPsec Local Network: lannet Remote Network: Habratest_cloud_subnet Remote Endpoint: Habratest_cloud_gateway Encapsulation mode: Tunnel ( important setting! ) IKE Config Mode Pool: None IKE Algorithms: Habratest_cloud_stage1 IKE Lifetime: 28800 IPsec Algorithms: Habratest_cloud_stage2 IPsec Lifetime: 3600 sec IPsec Lifetime: 102400000 Kb
“Authentication” tab
Put the “ Pre-shared key ” point and select our “ Habratest_cloud_key >”
Tab « the IKE the Settings »
the IKE:
the Main - the DH Group is 2
the PFS - to None
Security Association: Net Per
the NAT Traversal of: the On the if supported NATed and
Dead Peer Detection's: the Use
Then we create two IP Rules (“ Rules-> IP Rules ”):
Rule1 :
Name: lan_to_cloud
Action: Allow
Service: All_service
Schedule: None
Source interface: lan
Source Network: lannet
Destination Interface: Habratest_cloud_IPsec
Destination Network: Habratest_cloud_subnet
Rule 2 :
Name: cloud_to_lan
Action: Allow
Service: All_service
Schedule: None
Source interface: Habratest_cloud_IPsec
Source Network: Habratest_cloud_subnet
Destination Interface: lan
Destination Network: lannet
So we created the basic settings for the tunnel. Now save and apply the changes made to the DFL.
That's all! We observe beautiful pictures of the raised tunnel
Next, you can create the necessary services in Windows Azure (virtual machines, databases, etc)
A little bit about possible errors in the DFL logs:
1. statusmsg = “No proposal chosen” - the encryption methods are not correctly selected
2. reason = “Invalid proposal” is the same as item 1
3. reason = “IKE_INVALID_COOKIE” - the tunnel is already was raised, but after that changes were made to its settings. We go to the DFL "Status-> IPsec-> Habratest_cloud_IPsec-> at the top right of the List all active IKE SAs" page and delete the outdated IKE SA. Reboot DFL
That's all. Do not forget to change the test data from the article (IP addresses, subnets, regions, pre-shared keys) to your own
Thank you for your attention!
PS Please pay attention to the comment of the Habrauser DikSoft , which reports that such a scenario is officially unsupported and there may be problems
In this article, I will describe in stages the entire process of setting up a Site-to-Site tunnel between the Windows Azure cloud and the D-Link DFL-210 firewall (relevant for the DFL device line: 210 \ 260E \ 800 \ 860E)
Attention! All configuration steps are accompanied by a large number of pictures!
Step 1: Configure Windows Azure
First, create a new Windows Azure virtual network using the wizard.
Picture![](https://habrastorage.org/getpro/habr/post_images/1c0/158/15a/1c015815a32ffa1a6dc74be577f53165.png)
![](https://habrastorage.org/getpro/habr/post_images/1c0/158/15a/1c015815a32ffa1a6dc74be577f53165.png)
Name: Habratest
New Territorial Group: Habragroup
Region: Western Europe
Picture![](https://habrastorage.org/getpro/habr/post_images/034/b4f/10e/034b4f10e74ca23a4a9bdeb085e7c2ff.png)
![](https://habrastorage.org/getpro/habr/post_images/034/b4f/10e/034b4f10e74ca23a4a9bdeb085e7c2ff.png)
Then enter the name and address of the local DNS (if necessary). Otherwise, we use DNS from Windows Azure, or any public one.
We put a daw “Configure VPN connection of the“ network-to-network ” type”
Picture![](https://habrastorage.org/getpro/habr/post_images/883/be8/fb6/883be8fb64e2f554486b2afbfc17f2a8.png)
![](https://habrastorage.org/getpro/habr/post_images/883/be8/fb6/883be8fb64e2f554486b2afbfc17f2a8.png)
In the next step, enter the settings of our DFL:
Name: Mydfl
IP-address of the VPN device: 78.153.146.110 - this is the allocated static IPv4 address of our DFL ( This is important. If the DFL is behind NAT, then we won’t succeed )
Address space: 192.168 .22.0 / 24 - the local subnet that we will connect to Windows Azure
Picture![](https://habrastorage.org/getpro/habr/post_images/854/121/a00/854121a0064727f59e5fbe27fb246667.png)
![](https://habrastorage.org/getpro/habr/post_images/854/121/a00/854121a0064727f59e5fbe27fb246667.png)
In the last step, we enter the settings of the subnet to which we will connect (it will be used for services created in Windows Azure)
In our case, the settings will be as follows:
Total virtual network address space: 172.16.80.0/24
Subnet:
AzureSubnet 172.16.80.0/27
Gateway 172.16.80.32/29
Picture![](https://habrastorage.org/getpro/habr/post_images/a27/6f1/694/a276f16945229213533329763f50fd13.png)
![](https://habrastorage.org/getpro/habr/post_images/a27/6f1/694/a276f16945229213533329763f50fd13.png)
Virtual subnet created!
Go to the " Settings " of the newly created virtual network and verify that we did everything right
Picture![](https://habrastorage.org/getpro/habr/post_images/f35/2f6/fcf/f352f6fcfa94745690f7e8e1f80691ff.png)
![](https://habrastorage.org/getpro/habr/post_images/f35/2f6/fcf/f352f6fcfa94745690f7e8e1f80691ff.png)
On the tab " Dashboard " we see the following picture
Picture![](https://habrastorage.org/getpro/habr/post_images/3da/54b/83d/3da54b83dadffd778070b2a22f4ef626.png)
![](https://habrastorage.org/getpro/habr/post_images/3da/54b/83d/3da54b83dadffd778070b2a22f4ef626.png)
Click the " Create a gateway " button at the bottom of the page and select the " Static Routing " mode . Confirm your intentions with the OK button .
Picture![](https://habrastorage.org/getpro/habr/post_images/d9a/89b/a8c/d9a89ba8c40053ae2f4d1bba5a847cb7.png)
![](https://habrastorage.org/getpro/habr/post_images/d9a/89b/a8c/d9a89ba8c40053ae2f4d1bba5a847cb7.png)
We wait 10-15 minutes for Windows Azure to create a gateway for us
... It took 10 to 15 minutes ...
So, the gateway is created. We look what Windows Azure provided to us: the
IP address of the gateway: 23.97.132.122
Picture![](https://habrastorage.org/getpro/habr/post_images/00c/5fd/b9e/00c5fdb9e7c6f8a7dc45dd3c17423cc4.png)
![](https://habrastorage.org/getpro/habr/post_images/00c/5fd/b9e/00c5fdb9e7c6f8a7dc45dd3c17423cc4.png)
Next, click the " Key Management " button at the bottom of the page and get our personal pre-shared key:
R9GrgLgZPosdZ7isMdt8MkrDQnfBwUbO
Picture![](https://habrastorage.org/getpro/habr/post_images/ed5/2f7/5ad/ed52f75ade0fff7f4e442efd5199231d.png)
![](https://habrastorage.org/getpro/habr/post_images/ed5/2f7/5ad/ed52f75ade0fff7f4e442efd5199231d.png)
Stage 2. Configuring DFL
General requirements for the gateway can be found here:
http://msdn.microsoft.com/en-us/library/windowsazure/jj156075.aspx#BKMK_VPNGateway
One very important point to make here.
In the Russian DFL firmware (installed by default), such wonderful encryption methods as AES, which Windows Azure uses (and not only), are not available. We will leave discussions on this topic outside the scope of this article and use the following trick:
Follow the link http://tsd.dlink.com.tw/
Select your DFL model from the list and download the latest WorldWide firmware for our device (indicated as “For WW” )
Download the firmware to our DFL and wait for the operation to complete. The
firmware is loaded and we can continue
Now let's add all the cloud's IP addresses to the directory (" Objects-> Address book-> InterfaceAddresses ):
Name: Habratest_cloud_gateway
Value: 23.97.132.122
Name: Habratest_cloud_subnet
Value: 172.16.80.0/24
Picture![](https://habrastorage.org/getpro/habr/post_images/fb7/b32/f6f/fb7b32f6f3e6a7ae9fd222a9ad6a6a48.png)
![](https://habrastorage.org/getpro/habr/post_images/fb7/b32/f6f/fb7b32f6f3e6a7ae9fd222a9ad6a6a48.png)
Then go to " Objects-> Authentication Objects " and add a new object of the " Pre-shared key " type:
Name: Habratest_cloud_key
Passphrase: R9GrgLgZPosdZ7isMdt8MkrDQnfBwUbO
Picture![](https://habrastorage.org/getpro/habr/post_images/a3c/ad0/97f/a3cad097f81bd4d8a1ab56fc145bff2d.png)
![](https://habrastorage.org/getpro/habr/post_images/a3c/ad0/97f/a3cad097f81bd4d8a1ab56fc145bff2d.png)
Next, go to the item “ Objects-> VPN Objects-> IKE Algorithms ” and create a new IKE algorithm:
Name: Habratest_cloud_stage1
Put the daws: 3DES and AES (128 128 256), as well as the daw SHA1
Picture![](https://habrastorage.org/getpro/habr/post_images/3f0/8f4/76b/3f08f476bcb0f10bcc0dde2cf0b5103c.png)
![](https://habrastorage.org/getpro/habr/post_images/3f0/8f4/76b/3f08f476bcb0f10bcc0dde2cf0b5103c.png)
After creating the IKE algorithm, we proceed to creating the IPsec algorithm ( "Objects-> VPN Objects-> IPsec Algorithms" ):
Name: Habratest_cloud_stage2 Jackdaws
: the same as IKE
Picture![](https://habrastorage.org/getpro/habr/post_images/102/53d/998/10253d9988bf7a15dd61aaebe5dfa10d.png)
![](https://habrastorage.org/getpro/habr/post_images/102/53d/998/10253d9988bf7a15dd61aaebe5dfa10d.png)
Now we proceed directly to creating the rule for the IPsec tunnel ( “Interfaces-> IPsec” ): General
tab Name: Habratest_cloud_IPsec Local Network: lannet Remote Network: Habratest_cloud_subnet Remote Endpoint: Habratest_cloud_gateway Encapsulation mode: Tunnel ( important setting! ) IKE Config Mode Pool: None IKE Algorithms: Habratest_cloud_stage1 IKE Lifetime: 28800 IPsec Algorithms: Habratest_cloud_stage2 IPsec Lifetime: 3600 sec IPsec Lifetime: 102400000 Kb
Picture![](https://habrastorage.org/getpro/habr/post_images/f23/99f/fa8/f2399ffa8b4067844dd3661aec1f6aca.png)
![](https://habrastorage.org/getpro/habr/post_images/f23/99f/fa8/f2399ffa8b4067844dd3661aec1f6aca.png)
“Authentication” tab
Put the “ Pre-shared key ” point and select our “ Habratest_cloud_key >”
Picture![](https://habrastorage.org/getpro/habr/post_images/a9d/84b/aff/a9d84baff88d5a99f47182642b1d6f65.png)
![](https://habrastorage.org/getpro/habr/post_images/a9d/84b/aff/a9d84baff88d5a99f47182642b1d6f65.png)
Tab « the IKE the Settings »
the IKE:
the Main - the DH Group is 2
the PFS - to None
Security Association: Net Per
the NAT Traversal of: the On the if supported NATed and
Dead Peer Detection's: the Use
Picture![](https://habrastorage.org/getpro/habr/post_images/aad/566/9dc/aad5669dc9f9a64470ef7e34e612371b.png)
![](https://habrastorage.org/getpro/habr/post_images/aad/566/9dc/aad5669dc9f9a64470ef7e34e612371b.png)
Then we create two IP Rules (“ Rules-> IP Rules ”):
Rule1 :
Name: lan_to_cloud
Action: Allow
Service: All_service
Schedule: None
Source interface: lan
Source Network: lannet
Destination Interface: Habratest_cloud_IPsec
Destination Network: Habratest_cloud_subnet
Picture![](https://habrastorage.org/getpro/habr/post_images/a62/105/224/a6210522465f02e630072a289bcb4ef0.png)
![](https://habrastorage.org/getpro/habr/post_images/a62/105/224/a6210522465f02e630072a289bcb4ef0.png)
Rule 2 :
Name: cloud_to_lan
Action: Allow
Service: All_service
Schedule: None
Source interface: Habratest_cloud_IPsec
Source Network: Habratest_cloud_subnet
Destination Interface: lan
Destination Network: lannet
Picture![](https://habrastorage.org/getpro/habr/post_images/edf/650/b68/edf650b68c3e6795b1e2567975fdaf66.png)
![](https://habrastorage.org/getpro/habr/post_images/edf/650/b68/edf650b68c3e6795b1e2567975fdaf66.png)
So we created the basic settings for the tunnel. Now save and apply the changes made to the DFL.
That's all! We observe beautiful pictures of the raised tunnel
Picture![](https://habrastorage.org/getpro/habr/post_images/c23/42a/692/c2342a692370fbd26fd3113bc0512fc3.png)
![](https://habrastorage.org/getpro/habr/post_images/d09/995/f58/d09995f588c9f6ff92b6ed6f17c76082.png)
![](https://habrastorage.org/getpro/habr/post_images/c23/42a/692/c2342a692370fbd26fd3113bc0512fc3.png)
![](https://habrastorage.org/getpro/habr/post_images/d09/995/f58/d09995f588c9f6ff92b6ed6f17c76082.png)
Next, you can create the necessary services in Windows Azure (virtual machines, databases, etc)
A little bit about possible errors in the DFL logs:
1. statusmsg = “No proposal chosen” - the encryption methods are not correctly selected
2. reason = “Invalid proposal” is the same as item 1
3. reason = “IKE_INVALID_COOKIE” - the tunnel is already was raised, but after that changes were made to its settings. We go to the DFL "Status-> IPsec-> Habratest_cloud_IPsec-> at the top right of the List all active IKE SAs" page and delete the outdated IKE SA. Reboot DFL
Picture![](https://habrastorage.org/getpro/habr/post_images/e58/7c5/2fa/e587c52fa43e117e600359de6114b252.png)
![](https://habrastorage.org/getpro/habr/post_images/e58/7c5/2fa/e587c52fa43e117e600359de6114b252.png)
That's all. Do not forget to change the test data from the article (IP addresses, subnets, regions, pre-shared keys) to your own
Thank you for your attention!
PS Please pay attention to the comment of the Habrauser DikSoft , which reports that such a scenario is officially unsupported and there may be problems