{"id":1259,"date":"2016-04-10T10:40:26","date_gmt":"2016-04-10T08:40:26","guid":{"rendered":"https:\/\/www.vioreliftode.com\/?p=1259"},"modified":"2020-04-13T22:21:42","modified_gmt":"2020-04-13T20:21:42","slug":"on-premises-site-2-site-vpn-with-azure-using-tomato-shibby-mod-entware-ng-and-strongswan-setup-part-4","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-4\/","title":{"rendered":"On-Premises Site 2 Site VPN with Azure using Tomato Shibby Mod (Entware-ng and Strongswan setup) &#8211; part 4"},"content":{"rendered":"<input class=\"fooboxshare_post_id\" type=\"hidden\" value=\"1259\"\/><p><em>This article is part of a series of 4 where I am talking about how to setup site-2-site VPN between on-premises and Azure using Tomato Shibby Mod, Entware-ng and Strongswan. For a better understanding please make sure you read also the other parts:<\/em><\/p>\n<ol>\n<li><em><a href=\"\/index.php\/on-premises-site-2-site-vpn-with-azure-using-tomato-shibby-mod-entware-ng-and-strongswan-setup-part-1\" target=\"_blank\" rel=\"noopener\">Install and configure Entware-ng + strongSwan on your router.<\/a><\/em><\/li>\n<li><em><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\" rel=\"noopener\">Configure and perform the site-2-site VPN using Azure dynamic gateway.<\/a><\/em><\/li>\n<li><em><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\" rel=\"noopener\">Configure and perform the site-2-site VPN using Azure static gateway.<\/a><\/em><\/li>\n<li><em>Troubleshooting Azure site-2-site VPN and strongSwan.<\/em><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h1>Troubleshooting Azure site-2-site VPN and strongSwan<\/h1>\n<p>&nbsp;<\/p>\n<p>In case the site-2-site connection fails there are two log files that can be checked to identify the cause (Azure VPN gateway logs and stronSwan logs).<\/p>\n<p>&nbsp;<\/p>\n<h2>strongSwan logging<\/h2>\n<p>The strongSwan log file location is defined in the strongswan.conf file. Below is an example of strongswan.conf who will make strongSwan to log into <em>\/opt\/tmp\/charon.log<\/em> enough details about what&#8217;s going wrong with the VPN connection.<br \/>\n<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\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                charon {\r\n                        path = \/opt\/tmp\/charon.log\r\n                        time_format = %b %e %T\r\n                        append = no\r\n                        default = 2 # in case troubleshoot is required switch this to 2\r\n                }\r\n                stderr {\r\n                        ike = 2 # in case troubleshoot is required switch this to 2\r\n                        knl = 3 # 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 = 2 # in case troubleshoot is required switch this to 2\r\n                        ike = 2 # 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>After modifying strongswan.conf make sure you stop and start stongSwan.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>Azure VPN gateway logging<\/h2>\n<p>With a bit of Powershell is possible to look also into the Azure VPN gateway logs.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\nAdd-AzureAccount\r\nGet-AzureSubscription\r\n$subscriptionName = '&lt;YOUR SUBSCRIPTION NAME&gt;'\r\n$storageAccountName='&lt;YOUR STORAGE ACCOUNT NAME&gt;'\r\n$azureVNet='&lt;YOUR AZURE NETWORK NAME&gt;'\r\n$captureDuration=300\r\nSet-AzureSubscription -SubscriptionName $subscriptionName -CurrentStorageAccountName $storageAccountName\r\n$storageAccountKey=(Get-AzureStorageKey -StorageAccountName $storageAccountName).Primary\r\n$storageContext=New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey\r\nStart-AzureVNetGatewayDiagnostics -VNetName $azureVNet -StorageContext $storageContext -CaptureDurationInSeconds $captureDuration\r\nStart-Sleep -s $captureDuration\r\n$logURL=(Get-AzureVNetGatewayDiagnostics -VNetName $azureVNet).DiagnosticsUrl\r\n$logContent=(Invoke-WebRequest -Uri $logURL).RawContent\r\n$logContent | Out-File -FilePath C:\\vpn.log\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is part of a series of 4 where I am talking about how to setup site-2-site VPN between on-premises and Azure using Tomato Shibby Mod, Entware-ng and Strongswan. For a better understanding please make sure you read also the other parts: Install and configure Entware-ng + strongSwan on your router. Configure and perform &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-4\/\" 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 4<\/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 4","jetpack_is_tweetstorm":false},"categories":[32,75],"tags":[55,110,109,111,112],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4NfDd-kj","_links":{"self":[{"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/posts\/1259"}],"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=1259"}],"version-history":[{"count":2,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/posts\/1259\/revisions"}],"predecessor-version":[{"id":1952,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/posts\/1259\/revisions\/1952"}],"wp:attachment":[{"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/media?parent=1259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/categories?post=1259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/tags?post=1259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}