{"id":1253,"date":"2016-04-10T10:46:02","date_gmt":"2016-04-10T08:46:02","guid":{"rendered":"https:\/\/www.vioreliftode.com\/?p=1253"},"modified":"2016-04-17T05:54:00","modified_gmt":"2016-04-17T03:54:00","slug":"on-premises-site-2-site-vpn-with-azure-using-tomato-shibby-mod-entware-ng-and-strongswan-setup-part-1","status":"publish","type":"post","link":"https:\/\/www.vioreliftode.com\/index.php\/on-premises-site-2-site-vpn-with-azure-using-tomato-shibby-mod-entware-ng-and-strongswan-setup-part-1\/","title":{"rendered":"On-Premises Site 2 Site VPN with Azure using Tomato Shibby Mod (Entware-ng and Strongswan setup) &#8211; part 1"},"content":{"rendered":"<input class=\"fooboxshare_post_id\" type=\"hidden\" value=\"1253\"\/><p>Through the <a href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_router_firmware_projects\" target=\"_blank\">multitude of router firmware projects<\/a> I found <a href=\"http:\/\/tomato.groov.pl\/\" target=\"_blank\">Tomato Firmware (Shibby Mod)<\/a> as being the best one for my case (I am using it for OpenVPN server, PPTP server, Dynamic DNS, port forwarding, Quality Of Service \u2026 ). This article will describe step by step how you can configure a VPN site 2 site between on-premise and Microsoft Azure using your consumer based wireless router. The step by step details will be based on the Tomato Shibby Mod, but almost the same steps can be performed on <a href=\"http:\/\/tomatousb.org\/\" target=\"_blank\">TomatoUSB Mod (Teddy Bear)<\/a>, <a href=\"https:\/\/advancedtomato.com\/\" target=\"_blank\">AdvancedTomato GUI Mod<\/a>, <a href=\"http:\/\/www.dd-wrt.com\" target=\"_blank\">DD-WRT<\/a>, <a href=\"https:\/\/openwrt.org\/\" target=\"_blank\">OpenWrt<\/a> \u2026 &#8211; all are Linux-based and the main requirements are:<\/p>\n<ul>\n<li>your router to support one of these firmware&#8217;s<\/li>\n<li>be able to install <a href=\"https:\/\/strongswan.org\/\" target=\"_blank\">strongSwan<\/a> on top of it<\/li>\n<\/ul>\n<p><em>Just for understanding &#8211; according with <a href=\"http:\/\/anon.groov.pl\/index.php\" target=\"_blank\">TomatoAnon<\/a> (who covers only a tiny part of the available Tomato based routers) there are +35.000 such devices in use. Most likely combined with all the other DD-WRT, OpenWrt routers we probably get to couple of millions devices who with a bit of adjustments are capable to establish site 2 site VPN with Azure.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>Microsoft doesn\u2019t has <a href=\"https:\/\/strongswan.org\/\" target=\"_blank\">strongSwan<\/a> on its list of validated VPN devices. <a href=\"https:\/\/www.openswan.org\/\" target=\"_blank\">Openswan<\/a> and <a href=\"https:\/\/strongswan.org\/\" target=\"_blank\">strongSwan<\/a> are <a href=\"http:\/\/www.freeswan.org\/\" target=\"_blank\">FreeS\/WAN<\/a> forks. At the moment of writing this article, <a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/vpn-gateway-about-vpn-devices\/#validated-vpn-devices\" target=\"_blank\">Openswan is marked on the Microsoft validated VPN device list as &#8220;coming soon&#8221;<\/a>. Even if stongSwan is not yet on the official list of validated VPN devices, the fact Microsoft is taking in consideration Openswan is an indication the strongSwan will also be there at some point. More than that <a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/vpn-gateway-about-vpn-devices\/#non-validated-vpn-devices\" target=\"_blank\">Microsoft is providing the VPN specifications<\/a> for the VPN site 2 site tunnel to work also with &#8220;not yet validated VPN devices&#8221; (the discontinued <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microsoft_Forefront_Threat_Management_Gateway\" target=\"_blank\">Microsoft Thread Management Gateway<\/a> is also in this category). Your connection will be OK as long as those specifications are meet, but you will not be able to benefit from the Microsoft support in such setup.<\/p>\n<p>&nbsp;<\/p>\n<p>The good thing for the IT PROs who want to configure a site 2 site VPN between on-premises and Microsoft Azure is such setup is possible using the consumer based wireless routers. In fact this type of setup (<a href=\"http:\/\/tomato.groov.pl\/\" target=\"_blank\">Tomato Shibby Mod<\/a> + <a href=\"https:\/\/github.com\/Entware-ng\/Entware-ng\/wiki\" target=\"_blank\">Entware-ng<\/a> + <a href=\"https:\/\/strongswan.org\/\" target=\"_blank\">strongSwan<\/a>) is supporting both types of VPN Azure Gateways (<a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/vpn-gateway-about-vpngateways\/#vpntype\" target=\"_blank\">static and dynamic<\/a>) &#8211; which is really appreciable taking in consideration some top end devices like Cisco ASA, Palo Altos, Watchguard, F5 are not capable to handle the Azure dynamic gateway. This article will not mention the differences between the Azure static and dynamic gateways, but always try to use a dynamic gateway because it gives you extra functionality and flexibility (read more about Azure static vs dynamic gateways <a href=\"https:\/\/blogs.technet.microsoft.com\/uspartner_ts2team\/2015\/08\/12\/static-vs-dynamic-gateways-in-azure\/\" target=\"_blank\">here<\/a> and <a href=\"https:\/\/www.swc.com\/blog\/cloud\/azure-static-vs-dynamic-routing-gateways\" target=\"_blank\">here<\/a>).<\/p>\n<p>&nbsp;<\/p>\n<p>This article is split in four parts:<\/p>\n<ol>\n<li>Install and configure Entware-ng + strongSwan on your router<\/li>\n<li><a href=\"\/index.php\/on-premises-site-2-site-vpn-with-azure-using-tomato-shibby-mod-entware-ng-and-strongswan-setup-part-2\" target=\"_blank\">Configure and perform the site-2-site VPN using Azure dynamic gateway<\/a><\/li>\n<li><a href=\"\/index.php\/on-premises-site-2-site-vpn-with-azure-using-tomato-shibby-mod-entware-ng-and-strongswan-setup-part-3\" target=\"_blank\">Configure and perform the site-2-site VPN using Azure static gateway<\/a><\/li>\n<li><a href=\"\/index.php\/on-premises-site-2-site-vpn-with-azure-using-tomato-shibby-mod-entware-ng-and-strongswan-setup-part-4\" target=\"_blank\">Troubleshooting Azure site-2-site VPN and strongSwan<\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2>Install Entware-ng on your router<\/h2>\n<p>The main target is to install <a href=\"https:\/\/strongswan.org\/\" target=\"_blank\">strongSwan<\/a> on the router, but in order to install <a href=\"https:\/\/strongswan.org\/\" target=\"_blank\">strongSwan<\/a> we need first to install <a href=\"https:\/\/github.com\/Entware-ng\/Entware-ng\/wiki\" target=\"_blank\">Entware-ng<\/a>. Entware-ng is a package manager and software repository for embedded systems who allows you to easily extend your router capabilities (<a href=\"http:\/\/pkg.entware.net\/binaries\/mipsel\/Packages.html\" target=\"_blank\">there are about 1800 additional packages available<\/a>).<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>This is the USB flash drive who will be used to host the <a href=\"https:\/\/github.com\/Entware-ng\/Entware-ng\/wiki\" target=\"_blank\">Entware-ng<\/a> and <a href=\"https:\/\/strongswan.org\/\" target=\"_blank\">strongSwan<\/a>.<br \/>\n<em>It is not really necessary to use a USB flash drive. The <a href=\"https:\/\/github.com\/Entware-ng\/Entware-ng\/wiki\" target=\"_blank\">Entware-ng<\/a> and <a href=\"https:\/\/strongswan.org\/\" target=\"_blank\">strongSwan<\/a> installation can be performed also on Micro-SD\u00a0cards &#8211; as long as your router has such interface available (my router does, but for the purpose of this step-by-step article I will use an USB flash drive).<\/em><\/p>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_01.png\" rel=\"attachment wp-att-1266\"><img loading=\"lazy\" class=\"alignleft size-large wp-image-1266\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_01-1024x492.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_01\" width=\"474\" height=\"228\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_01-1024x492.png 1024w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_01-300x144.png 300w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_01-768x369.png 768w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_01.png 1100w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>This is the USB flash drive initial status. Please make sure to not keep any files on the flash drive because as part of the <a href=\"https:\/\/github.com\/Entware-ng\/Entware-ng\/wiki\" target=\"_blank\">Entware-ng<\/a> installation is necessary to format it.<\/p>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_02.png\" rel=\"attachment wp-att-1267\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-1267\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_02.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_02\" width=\"377\" height=\"488\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_02.png 377w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_02-232x300.png 232w\" sizes=\"(max-width: 377px) 100vw, 377px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Plug the USB flash drive into your router.<\/p>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_03.png\" rel=\"attachment wp-att-1268\"><img loading=\"lazy\" class=\"alignleft size-large wp-image-1268\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_03-1024x768.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_03\" width=\"474\" height=\"356\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_03-1024x768.png 1024w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_03-300x225.png 300w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_03-768x576.png 768w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_03.png 1183w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Connect to your router management interface and make sure you enable the USB support.<\/p>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_04.png\" rel=\"attachment wp-att-1269\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-1269\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_04.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_04\" width=\"964\" height=\"933\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_04.png 964w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_04-300x290.png 300w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_04-768x743.png 768w\" sizes=\"(max-width: 964px) 100vw, 964px\" \/><\/a>Make sure the &#8220;Run after mounting&#8221; and &#8220;Run before unmounting&#8221; sections contains the following command lines.<\/p>\n<p><span style=\"text-decoration: underline;\">Run after mounting<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n#!\/bin\/sh\r\n\/opt\/etc\/init.d\/rc.unslung start\r\n<\/pre>\n<p><span style=\"text-decoration: underline;\">Run before unmounting<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n#!\/bin\/sh\r\n\/opt\/etc\/init.d\/rc.unslung stop\r\nsleep 15\r\numount \/opt\r\n<\/pre>\n<p>After pressing the Save button, the new settings will be applied and the USB device will be recognized.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Make sure you unmount the USB device before proceeding to the next step.<\/p>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_05.png\" rel=\"attachment wp-att-1270\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-1270\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_05.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_05\" width=\"756\" height=\"241\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_05.png 756w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_05-300x96.png 300w\" sizes=\"(max-width: 756px) 100vw, 756px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>In the Administration -&gt; Scripts -&gt; Init section will be necessary to add the following command line to be executed when the router starts.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\necho &quot;LABEL=ENTWARE \/opt ext3 rw,noatime 1 1&quot; &gt;&gt; \/etc\/fstab\r\n<\/pre>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_06.png\" rel=\"attachment wp-att-1271\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-1271\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_06.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_06\" width=\"972\" height=\"766\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_06.png 972w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_06-300x236.png 300w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_06-768x605.png 768w\" sizes=\"(max-width: 972px) 100vw, 972px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>It is time to format the USB flash drive and make it ext3.<\/p>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_07.png\" rel=\"attachment wp-att-1272\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-1272\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_07.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_07\" width=\"739\" height=\"617\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_07.png 739w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_07-300x250.png 300w\" sizes=\"(max-width: 739px) 100vw, 739px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_08.png\" rel=\"attachment wp-att-1273\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-1273\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_08.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_08\" width=\"739\" height=\"409\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_08.png 739w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_08-300x166.png 300w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_08-672x372.png 672w\" sizes=\"(max-width: 739px) 100vw, 739px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Mount the newly created partition. The Entware-ng installer will require the \/opt to be mounted.<\/p>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_09.png\" rel=\"attachment wp-att-1274\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-1274\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_09.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_09\" width=\"770\" height=\"168\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_09.png 770w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_09-300x65.png 300w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_09-768x168.png 768w\" sizes=\"(max-width: 770px) 100vw, 770px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_10.png\" rel=\"attachment wp-att-1275\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-1275\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_10.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_10\" width=\"739\" height=\"185\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_10.png 739w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_10-300x75.png 300w\" sizes=\"(max-width: 739px) 100vw, 739px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>After the \/opt is mounted, the Entware-ng installation will be triggered using the following command.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nwget -O - http:\/\/pkg.entware.net\/binaries\/mipsel\/installer\/installer.sh | sh\r\n<\/pre>\n<p>Please note my router is a MIPS CPU based router. In case yours is ARM you will need to use another command.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nwget -O - http:\/\/pkg.entware.net\/binaries\/armv7\/installer\/entware_install.sh | sh\r\n<\/pre>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_11.png\" rel=\"attachment wp-att-1276\"><img loading=\"lazy\" class=\"alignleft wp-image-1276 size-full\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_11.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_11\" width=\"1139\" height=\"681\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_11.png 1139w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_11-300x179.png 300w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_11-768x459.png 768w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_11-1024x612.png 1024w\" sizes=\"(max-width: 1139px) 100vw, 1139px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>This is a very good moment to restart your router because it will validate if the init &amp; automount scripts are running correctly and Entware-ng installation completed successfully.<\/p>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_12.png\" rel=\"attachment wp-att-1277\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-1277\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_12.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_12\" width=\"595\" height=\"217\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_12.png 595w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_12-300x109.png 300w\" sizes=\"(max-width: 595px) 100vw, 595px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>After the reboot verify if the following command is returning a valid response.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nopkg list *strongswan*\r\n<\/pre>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_13.png\" rel=\"attachment wp-att-1278\"><img loading=\"lazy\" class=\"alignleft wp-image-1278 size-full\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_13.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_13\" width=\"1035\" height=\"1001\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_13.png 1035w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_13-300x290.png 300w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_13-768x743.png 768w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_13-1024x990.png 1024w\" sizes=\"(max-width: 1035px) 100vw, 1035px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2><\/h2>\n<h2>Install strongSwan on your router<\/h2>\n<p>Execute the following commands to perform a full installation of strongSwan.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nopkg install strongswan strongswan-charon strongswan-mod-addrblock strongswan-mod-aes strongswan-mod-af-alg strongswan-mod-agent strongswan-mod-attr strongswan-mod-attr-sql strongswan-mod-blowfish strongswan-mod-ccm strongswan-mod-cmac strongswan-mod-constraints strongswan-mod-coupling strongswan-mod-ctr strongswan-mod-curl strongswan-mod-des strongswan-mod-dhcp\r\nopkg install strongswan-mod-dnskey strongswan-mod-duplicheck strongswan-mod-eap-identity strongswan-mod-eap-md5 strongswan-mod-eap-mschapv2 strongswan-mod-eap-radius strongswan-mod-farp strongswan-mod-fips-prf strongswan-mod-gcm strongswan-mod-gcrypt strongswan-mod-gmp strongswan-mod-gmpdh strongswan-mod-ha strongswan-mod-hmac strongswan-mod-kernel-libipsec\r\nopkg install strongswan-mod-kernel-netlink strongswan-mod-ldap strongswan-mod-led strongswan-mod-load-tester strongswan-mod-md4 strongswan-mod-md5 strongswan-mod-mysql strongswan-mod-nonce strongswan-mod-openssl strongswan-mod-pem strongswan-mod-pgp strongswan-mod-pkcs1 strongswan-mod-pkcs11 strongswan-mod-pkcs8 strongswan-mod-pubkey strongswan-mod-random\r\nopkg install strongswan-mod-rc2 strongswan-mod-resolve strongswan-mod-revocation strongswan-mod-sha1 strongswan-mod-sha2 strongswan-mod-smp strongswan-mod-socket-default strongswan-mod-socket-dynamic strongswan-mod-sql strongswan-mod-sqlite strongswan-mod-sshkey strongswan-mod-stroke strongswan-mod-test-vectors strongswan-mod-unity strongswan-mod-updown strongswan-mod-whitelist\r\nopkg install strongswan-mod-x509 strongswan-mod-xauth-eap strongswan-mod-xauth-generic strongswan-mod-xcbc strongswan-utils\r\n<\/pre>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_14.png\" rel=\"attachment wp-att-1279\"><img loading=\"lazy\" class=\"alignleft wp-image-1279 size-full\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_14.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_14\" width=\"1035\" height=\"1001\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_14.png 1035w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_14-300x290.png 300w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_14-768x743.png 768w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_14-1024x990.png 1024w\" sizes=\"(max-width: 1035px) 100vw, 1035px\" \/><\/a><\/p>\n<h2><\/h2>\n<h2><\/h2>\n<h2>Configure strongSwan<\/h2>\n<p>The following configuration is despite whatever type of Azure gateway we will use (static \/ dynamic). This configuration will allow you troubleshoot and open the necessary ports required for the VPN tunnel.<\/p>\n<p><span style=\"text-decoration: underline;\">nano \/opt\/etc\/strongswan.conf<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# strongswan.conf - strongSwan configuration file\r\n#\r\n# Refer to the strongswan.conf(5) manpage for details\r\n#\r\n# Configuration changes should be made in the included files\r\n# Verbosity levels\u000b\r\n# -1: Absolutely silent\r\n# 0: Very basic auditing logs, (e.g. SA up\/SA down)\r\n# 1: Generic control flow with errors, a good default to see whats going on\r\n# 2: More detailed debugging control flow\r\n# 3: Including RAW data dumps in Hex\r\n# 4: Also include sensitive material in dumps, e.g. keys\r\n\r\ncharon {\r\n        load_modular = yes\r\n        plugins {\r\n                include strongswan.d\/charon\/*.conf\r\n        }\r\n        filelog {\r\n                \/opt\/tmp\/charon.log {\r\n                        time_format = %b %e %T\r\n                        append = no\r\n                        default = 0 # in case troubleshoot is required switch this to 2\r\n                }\r\n                stderr {\r\n                        ike = 0 # in case troubleshoot is required switch this to 2\r\n                        knl = 0 # in case troubleshoot is required switch this to 3\r\n                        ike_name = yes\r\n                }\r\n        }\r\n        syslog {\r\n                # enable logging to LOG_DAEMON, use defaults\r\n                daemon {\r\n                }\r\n                # minimalistic IKE auditing logging to LOG_AUTHPRIV\r\n                auth {\r\n                        default = 0 # in case troubleshoot is required switch this to 2\r\n                        ike = 0 # in case troubleshoot is required switch this to 2\r\n                }\r\n        }\r\n}\r\n\r\ninclude strongswan.d\/*.conf\r\n<\/pre>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_15.png\" rel=\"attachment wp-att-1280\"><img loading=\"lazy\" class=\"alignleft wp-image-1280 size-full\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_15.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_15\" width=\"1035\" height=\"873\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_15.png 1035w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_15-300x253.png 300w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_15-768x648.png 768w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_15-1024x864.png 1024w\" sizes=\"(max-width: 1035px) 100vw, 1035px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Make sure you open the required VPN communication with your router.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\niptables -t filter -A INPUT -p udp --dport 500 -j ACCEPT\r\niptables -t filter -A INPUT -p udp --dport 4500 -j ACCEPT\r\niptables -t filter -A INPUT -p esp -j ACCEPT\r\n<\/pre>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_16.png\" rel=\"attachment wp-att-1281\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-1281\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_16.png\" alt=\"On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_16\" width=\"966\" height=\"748\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_16.png 966w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_16-300x232.png 300w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2016\/04\/On-Premises_Site_2_Site_VPN_with_Azure_using_Tomato_Shibby_Mod_Entware-ng_and_Strongswan_16-768x595.png 768w\" sizes=\"(max-width: 966px) 100vw, 966px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Reboot is required in order the firewall rules to apply.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Continue with <a href=\"\/index.php\/on-premises-site-2-site-vpn-with-azure-using-tomato-shibby-mod-entware-ng-and-strongswan-setup-part-2\" target=\"_blank\">On-Premises Site 2 Site VPN with Azure using Tomato Shibby Mod (Entware-ng and Strongswan setup) &#8211; part 2<\/a>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Through the multitude of router firmware projects I found Tomato Firmware (Shibby Mod) as being the best one for my case (I am using it for OpenVPN server, PPTP server, Dynamic DNS, port forwarding, Quality Of Service \u2026 ). This article will describe step by step how you can configure a VPN site 2 site &hellip; <a href=\"https:\/\/www.vioreliftode.com\/index.php\/on-premises-site-2-site-vpn-with-azure-using-tomato-shibby-mod-entware-ng-and-strongswan-setup-part-1\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">On-Premises Site 2 Site VPN with Azure using Tomato Shibby Mod (Entware-ng and Strongswan setup) &#8211; part 1<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"On-Premises Site 2 Site VPN with Azure using Tomato Shibby Mod (Entware-ng and Strongswan setup) - part 1","jetpack_is_tweetstorm":false},"categories":[32,75],"tags":[55,113,84,110,109,112],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4NfDd-kd","_links":{"self":[{"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/posts\/1253"}],"collection":[{"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/comments?post=1253"}],"version-history":[{"count":0,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/posts\/1253\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/media?parent=1253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/categories?post=1253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/tags?post=1253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}