{"id":17,"date":"2025-03-04T20:33:36","date_gmt":"2025-03-05T01:33:36","guid":{"rendered":"https:\/\/thenetworksdown.com\/tnd\/?p=17"},"modified":"2025-11-26T11:33:29","modified_gmt":"2025-11-26T16:33:29","slug":"l02-legacy-dmvpn-with-ipsec-backup","status":"publish","type":"post","link":"https:\/\/thenetworksdown.com\/?p=17","title":{"rendered":"DMVPN with Crypto Map Backup"},"content":{"rendered":"\n<p>So, since I tend to plan and design for worst case scenarios, I was thinking\u2026 What if you need to do maintenance on a DMVPN Hub Router, and you only have a single router terminating those DMVPN Spoke connections at that site? &nbsp;I know, I know\u2026 It\u2019s a Cisco Router, and we probably have 2 of them doing HSRP and BGP or something fancy, and we <em>never<\/em> have to do code upgrades to fix vulnerabilities or memory leaks (<strong>riiight<\/strong>); but let\u2019s just pretend. &nbsp;What if you have an ASA available for &#8220;unleaded&#8221; (Crypto Map based) IPSec and AnyConnect VPN access to your main site, that you <em>may or may not<\/em> have migrated Site-to-Site connectivity off of to get your fancy DMVPN network setup on the Hub router. &nbsp;Would it work?<\/p>\n\n\n\n<p>The question we are actually asking here is, &#8220;Can the DMVPN Spoke-side be configured to leverage DMVPN and also&nbsp;tunnel out with a straight old-school Crypto Map based static IPSec tunnel for failover?&#8221; &nbsp;Let me qualify that last statement real quick&#8230; Of course your DMVPN Spoke [<em>I really hope<\/em>] is already running IPSec to encrypt the GRE transport of the tunnel\u2026 &nbsp;So, assuming you live in the reality that we all do, of creepers being on the internet, and you are establishing an <em>Encrypted<\/em> DMVPN tunnel to your hub leveraging IPSec; can the DMVPN spoke create a second independent IPSec tunnel that doesn\u2019t jack up your DMVPN config? &nbsp;Will it get confused? &nbsp;Am I confused?  Let\u2019s think about this. &#x1f914;<\/p>\n\n\n\n<p>Why are we even using DMVPN? &nbsp;Well because I\u2019m a CCIE candidate (<em>at the time of writing this article in 2015<\/em>) and it\u2019s on the blueprint. &nbsp;[<em>crickets<\/em>] Oh, right\u2026 Well, one of DMVPN\u2019s major advantage over traditional Crypto Map IPSec is its ability to build routed tunnels that support every engineer\u2019s favorite&nbsp;<strong>routed<\/strong>&nbsp;protocol\u2026 multicast. &nbsp;Yes, believe it or not we all <strong><em>do<\/em><\/strong> love multicast no matter how many times we have to keep referencing who the Static RP is vs an Auto-RP and how to replicate all your fancy mulitcasting with MSDP through different AS in BGP. &nbsp;OK, enough of that; we can talk multicast in another post\u2026<\/p>\n\n\n\n<p>So big deal, we can push multicast traffic over these tunnels, now you can put someone on hold using your IP Phone and they can hear your hold music that\u2019s being distributed via multicast. &nbsp;Fantastic.  Well, another benefit of having the tunnel supporting multicast is it\u2019s ability of learning dynamic routes via your favorite <strong>routing<\/strong> protocol (EIGRP\/RIP\/OSPF,)&nbsp;<em><code>{yes, bgp is fully supported for DMVPN but using unicast tcp port 179 is not helping my case here for multicast support lol}<\/code><\/em>. &nbsp;And lastly, DMVPN will save you from needing to create a full mesh of static site to site tunnels. Just pin up one static tunnel to your hub (in this example) and let NHRP and IPSec do the rest of the work for you.  <strong>Thanks Technology<\/strong>!<\/p>\n\n\n\n<p>Having NHRP resolve your NBMA (<em>Public<\/em>) IP Address to your Tunnel IP (<em>Private<\/em>) will allow the spoke routers to &#8220;automatically&#8221; build tunnels between each other on an as needed basis. Sounds pretty sweet right?  Gotta love that first redirect packet sent back from the Hub to the Spoke to find the shortcut defined to build that Dynamic Spoke-to-Spoke connectivity.<\/p>\n\n\n\n<p>So now I get why DMVPN is kind of nice, but how would the backup Crypto Map IPSec Tunnel we spoke about earlier ever kick in if the routing table already has routes being learned via the DMVPN Hub? &nbsp;If we are running both DMVPN and Crypto Map based IPSec at the same time, won\u2019t the router get confused? &nbsp;After all, the Tunnel interface is virtual in nature, and is really using the ISP facing physical interface to communicate with the DMVPN Hub router. Hmmmm&#8230; If only there were an order of operations&#8230;<\/p>\n\n\n\n<p>So, once the DMVPN Hub goes down for its <em>imaginary<\/em> maintenance, the peering between the Hub and Spoke will go down, which will withdraw the dynamic route(s) which were learned from the Hub on the spoke router.  This will also will break the neighbor relationship that was previously in place between the Hub and Spoke router (<em>assuming we were running a routing protocol over DMVPN<\/em>). &nbsp;So now, as long as you have either a static route configured to your VPN endpoints, or are routing quad zeros (0.0.0.0) on the DMVPN Spoke router, everything will get routed to the ever so existing realm of the internet. &nbsp;But, what if the traffic we are trying to route, wasn\u2019t actually destined for the internet?&nbsp; What if, your DMVPN Spoke, who was just told by the Hub \u201cGoodbye; I\u2019m no longer routing with you\u201d, could build another encrypted tunnel to another VPN endpoint, that was fully operational, but was an &#8220;old school style&#8221; static Crypto Map IPSec Tunnel?<\/p>\n\n\n\n<p>But wait a minute; didn\u2019t we establish earlier that we are already using IPSec to secure our DMVPN tunnels due to the creepers on the internet? &nbsp;Won\u2019t trying to encrypt outside of our tunnel interface mess up or conflict with that policy? &nbsp;Well\u2026 It shouldn\u2019t. &nbsp;<em><strong>Right<\/strong><\/em>?  <\/p>\n\n\n\n<p>Since we apply the IPSec Protection Profile on the Virtual Tunnel interface of the router, what is stopping us from applying another IKE and IPSec Profile on the physical link heading to our ISP hand off? &nbsp;Interesting\u2026 But both the Tunnel and the ISP facing interface are the same thing; <em><strong>aren\u2019t they<\/strong><\/em>? &nbsp;Let\u2019s see how it would be configured in the lab.<\/p>\n\n\n\n<p>So here\u2019s the topology. Pretty basic, nothing to exiting to write home about here:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/thenetworksdown.com\/wp-content\/uploads\/2020\/04\/DMVPN_IPSEC_Failover.png\" alt=\"DMVPN\" class=\"wp-image-18\" style=\"width:619px;height:541px\"\/><\/figure>\n\n\n\n<p><a href=\"http:\/\/www.thenetworksdown.com\/CCIE\/wp-content\/uploads\/2015\/09\/DMVPN_IPSEC_Failover.png\"><\/a><\/p>\n\n\n\n<p>We want to setup the DMVPN SPOKE router (top left corner) with something similar to the following syntax for additional&nbsp;IKEv1 (ISAKMP) &amp; IPSec configs:<\/p>\n\n\n\n<p><strong><em>NOTE:<\/em><\/strong><em>&nbsp;<\/em>This is assuming we have already setup the ASA Firewall with the relevant non crypto config (Tunnel Group, NAT Exemptions, Proxy Lists, Routing, ETC).  Also, I encourage you to &#8220;<em>step your encryption game up<\/em>&#8221; from the super weak examples listed below.<\/p>\n\n\n\n<p><strong>Phase 1 (ISAKMP) Steps.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create Additional ISAKMP policy to be used for connecting to the DMVPN Spoke.<\/li>\n<\/ul>\n\n\n\n<p><code>crypto isakmp policy 2<br> authentication pre-share<br> encryption 3des<br> hash md5<br> group 2<br> lifetime 86400<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Define the ISAKMP PSK config to be used for connecting to the DMVPN Spoke.<\/li>\n<\/ul>\n\n\n\n<p><code>crypto isakmp key $UP3R$3CR3+P$k address W.X.Y.Z<\/code><\/p>\n\n\n\n<p><strong>Phase 2 (IPSec) Steps.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create your ACL for interesting traffic to be pushed over the vpn<\/li>\n<\/ul>\n\n\n\n<p><code>ip access-list extended VPN-BACKUP<br>permit ip&nbsp;<em>MY.LOCAL.NETWORK&nbsp;MY.LOCAL.INV-MASK&nbsp;REMOTE.SIDE.NETWORK REMOTE.SIDE.INV-MASK<\/em><\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create your new Transform Set<\/li>\n<\/ul>\n\n\n\n<p><code>crypto ipsec transform-set&nbsp;<em>NAME-YOUR-TS-SET&nbsp;PARAMETERS-OF-TS<\/em><\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create your new Crypto Map<\/li>\n<\/ul>\n\n\n\n<p><code>crypto map VPN-FAILOVER 10 ipsec-isakmp<br> set peer&nbsp;<em>W.X.Y.Z<\/em><br> set transform-set&nbsp;<em>NAME-YOUR-TS-SET<\/em><br> match address VPN-BACKUP<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Apply the new Crypto Map to your ISP facing interface<\/li>\n<\/ul>\n\n\n\n<p><code>interface FastEthernet4<br> crypto map VPN-FAILOVER<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Don\u2019t forget to modify your NAT Config on the router!<\/li>\n<\/ul>\n\n\n\n<p><code>ip access-list extended SPOKE-NATS<br><em> deny ip MY.LOCAL.NETWORK&nbsp;MY.LOCAL.INV-MASK&nbsp;REMOTE.SIDE.NETWORK REMOTE.SIDE.INV-MASK<\/em><br> permit ip MY.LOCAL.NETWORK&nbsp;MY.LOCAL.INV-MASK any<\/code><\/p>\n\n\n\n<p><em>Remember, the <strong>deny<\/strong> above in this access-list says please <strong>ignore the urge to be sent to the NVI interface to be natted<\/strong>. &nbsp;Aka, the HQ location needs to route directly back to me with my private IP address; not the External NAT everyone else is using to read blog articles on this site and other items on the interwebs\u2026<\/em><\/p>\n\n\n\n<p>So there you have it.  The answer is yes, we can do this.  By having this additional config setup on your already existing DMVPN router, it will help you automatically fail over to your ASA (in the example above). <\/p>\n\n\n\n<p>Hopefully you stuck with me through this and now have another alternative for fail over on top of your existing DMVPN setup. &nbsp;Stay tuned for some more blogging and articles!<\/p>\n\n\n\n<p>&#8211; This article was originally written back in September of 2015, and I finally got around to reviewing and wrapping it up now-ish&#8230; Keep learning and keep labbing &#8211; 51406<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, since I tend to plan and design for worst case scenarios, I was thinking\u2026&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2566,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[18,23,28,31],"class_list":["post-17","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech-stuff","tag-dmvpn","tag-firewall","tag-how-to","tag-labbing"],"rise-blocks_total_comments":0,"rise-blocks_categories":[{"term_id":3,"name":"Tech Stuff","slug":"tech-stuff","term_group":0,"term_taxonomy_id":3,"taxonomy":"category","description":"","parent":0,"count":43,"filter":"raw","cat_ID":3,"category_count":43,"category_description":"","cat_name":"Tech Stuff","category_nicename":"tech-stuff","category_parent":0}],"rise-blocks_excerpt":"So, since I tend to plan and design for worst case scenarios, I was thinking\u2026..","_links":{"self":[{"href":"https:\/\/thenetworksdown.com\/index.php?rest_route=\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thenetworksdown.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thenetworksdown.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thenetworksdown.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thenetworksdown.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17"}],"version-history":[{"count":1,"href":"https:\/\/thenetworksdown.com\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":2486,"href":"https:\/\/thenetworksdown.com\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions\/2486"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thenetworksdown.com\/index.php?rest_route=\/wp\/v2\/media\/2566"}],"wp:attachment":[{"href":"https:\/\/thenetworksdown.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thenetworksdown.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thenetworksdown.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}