{"id":120,"date":"2016-05-26T09:50:52","date_gmt":"2016-05-26T07:50:52","guid":{"rendered":"http:\/\/wp.12p.no\/?p=120"},"modified":"2016-05-26T09:50:52","modified_gmt":"2016-05-26T07:50:52","slug":"setting-up-ikev2-azure-to-palo-alto-networks-firewall","status":"publish","type":"post","link":"https:\/\/12p.no\/wp\/?p=120","title":{"rendered":"Setting up IKEv2 Azure to Palo Alto Networks Firewall"},"content":{"rendered":"<p>So, lately I&#8217;ve setup a lot of vpn tunnels to Azure. With different results. Seems to me that it&#8217;s easy to setup the vpn itself, but when it comes to getting the vpn to maintain up and stable you have to tweek back and forth a bit. But heres a example that seems to be working excellent.<\/p>\n<p>Scenario: Two locations, &gt;7 local subnets, one BIG azure subnet.<\/p>\n<p>IKEv2 static routing <em>or policy based as Microsoft calls it: https:\/\/azure.microsoft.com\/nb-no\/documentation\/articles\/vpn-gateway-about-vpn-devices\/<\/em><\/p>\n<p><em>&#8220;Static Routing = Policy-based<\/em><\/p>\n<p><em>Dynamic Routing = Route-based<\/em>&#8221;<\/p>\n<p>Palo Alto PA500, using software PANos 7.1.2<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/2.png\" rel=\"attachment wp-att-122\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-122\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/2-1024x618.png\" alt=\"2\" width=\"474\" height=\"286\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Azureside setup as IKEv2 policy based, routing each spesific net to each location (gw), seperate PSK keys for each site.<\/p>\n<p>Step 1, create tunnel interface, assign interface to correct vr and sec zone<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/25.png\" rel=\"attachment wp-att-130\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-130\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/25.png\" alt=\"PAN \" width=\"611\" height=\"318\" \/><\/a><\/p>\n<p>Step 2 create IP sec tunnel<\/p>\n<p>bind to tunnel, create new IKE gateway<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/3.png\" rel=\"attachment wp-att-123\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-123\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/3.png\" alt=\"PAN \" width=\"729\" height=\"470\" \/><\/a><\/p>\n<p>Step 3,<\/p>\n<p>Setup IKEv2 only mode, bind to interface . Static ip for Azure GW, and preshared key (provided by azure setup)<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/4.png\" rel=\"attachment wp-att-124\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-124\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/4.png\" alt=\"PAN \" width=\"604\" height=\"478\" \/><\/a><\/p>\n<p>step 4<\/p>\n<p>I found out that not enabling passive mode worked best for this VPN.<\/p>\n<p>Create new IKE Crypto profile,<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/5.png\" rel=\"attachment wp-att-125\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-125\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/5.png\" alt=\"PAN \" width=\"620\" height=\"422\" \/><\/a><\/p>\n<p>Step 5<\/p>\n<p>Azure allows a lot of IKE ciphers, but this one seems to be stable<\/p>\n<p>DHgroup 2, AES-256-cbc, SHA1, keylife 28800 secs<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/6.png\" rel=\"attachment wp-att-126\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-126\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/6.png\" alt=\"PAN \" width=\"807\" height=\"396\" \/><\/a><\/p>\n<p>Step 6 Create IPsec crypto profile<\/p>\n<p>Here&#8217;s where it gets interesting, according to the samples you should use ESP DHgrp2 AES-252cbc and sha1<\/p>\n<p>And that works. For a while&#8230; then the tunnel goes down and never comes up again by itself.<\/p>\n<p>Using this setup<\/p>\n<p>ESP, NO-PFS, aes-256cbc,3des,aes-128-cbc, sha1 and lifetime 3600secs<\/p>\n<p>seems to work the best.<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/7.png\" rel=\"attachment wp-att-127\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-127\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/7.png\" alt=\"PAN \" width=\"802\" height=\"433\" \/><\/a><\/p>\n<p>Then the result should look something like this:<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/Untitled-1.jpg\" rel=\"attachment wp-att-131\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-131\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/Untitled-1-1024x125.jpg\" alt=\"PAN sec rules\" width=\"474\" height=\"58\" \/><\/a><\/p>\n<p>step 7<\/p>\n<p>Since we use static routing we\u00a0 simply route the whole \/16 net to the tunnelinterface we created<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/8.png\" rel=\"attachment wp-att-128\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-128\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/8.png\" alt=\"PAN \" width=\"818\" height=\"507\" \/><\/a><\/p>\n<p>step 8<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/9.png\" rel=\"attachment wp-att-129\">Create rules to match the traffic (Yes i know this rule is an any-any-rule, but i used that for testing, and migration tool afterwards to convert to lay 7 rules.)<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-129\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2016\/05\/9-1024x118.png\" alt=\"PAN \" width=\"474\" height=\"55\" \/><\/a><\/p>\n<p>And boom the vpn is up and running<\/p>\n<p>A recommended troubleshooting command if you need it<\/p>\n<p>tail follow yes mp-log ikemgr.log<\/p>\n<p>Provides a good realtime view of the ipsec tunnel. That&#8217;s how i found out what was going wrong with the intial setup using the samples provided by azure. The error i got was that the tunnel had missing KE. (proxy id or in this case ciphers and no-fps)<\/p>\n<p>&nbsp;<\/p>\n<p>Using\u00a0 the same setup on both locations worked perfectly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, lately I&#8217;ve setup a lot of vpn tunnels to Azure. With different results. Seems to me that it&#8217;s easy to setup the vpn itself, but when it comes to getting the vpn to maintain up and stable you have to tweek back and forth a bit. But heres a example that seems to be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[9,15,20,21,22],"class_list":["post-120","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-azure","tag-ikev2","tag-pa500","tag-paloalto","tag-paloalto-ikev2-azure"],"_links":{"self":[{"href":"https:\/\/12p.no\/wp\/index.php?rest_route=\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/12p.no\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/12p.no\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/12p.no\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/12p.no\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=120"}],"version-history":[{"count":0,"href":"https:\/\/12p.no\/wp\/index.php?rest_route=\/wp\/v2\/posts\/120\/revisions"}],"wp:attachment":[{"href":"https:\/\/12p.no\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/12p.no\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/12p.no\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}