{"id":58,"date":"2019-01-22T22:54:53","date_gmt":"2019-01-22T22:54:53","guid":{"rendered":"https:\/\/thelordofthepings.newedgenetworking.com\/wp\/?p=58"},"modified":"2023-08-22T01:12:01","modified_gmt":"2023-08-22T01:12:01","slug":"guest-wifi-and-branch-backup-vpn-redo","status":"publish","type":"post","link":"https:\/\/andrewjwhittle.com\/wp-lotpnet\/2019\/01\/22\/guest-wifi-and-branch-backup-vpn-redo\/","title":{"rendered":"Guest wifi and branch backup VPN redo"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">This post is about a situation I ran into a while ago and records my configs and testing for converting from a PBR setup to VRF on a Cisco 881 router with a diagram at the end.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Through a combination of configs involving PBR (Policy Based Routing) AKA Source Routing (as opposed to standard Destination Routing), Proxy Server exceptions, and Default Route\/missing Default Route it was impossible to get to internet facing apps\/sites over guest wifi or branch backup VPN.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I knew I could use VRF\u2019s (Virtual Routing and Forwarding) to separate the traffic and solve the issue, but had to prove it to my team as they weren\u2019t familiar with VRF\u2019s. A Cisco router without VRF\u2019s built only has the \u201cglobal routing table\u201d. VRF\u2019s create separate instances of routing tables; one for each VRF, while leaving the global in place.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">IOS-XE comes with a mgmt-intf VRF by default for a separate management network. Carriers use VRF\u2019s, or contexts in some non Cisco hardware, to keep customers traffic separate and allow for overlapping network schemes. If needed you can \u201cleak routes\u201d between VRF\u2019s and\/or the global routing table. This would be done if the carrier has something like a network monitoring server that needs to access customer devices.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I used a post by Jeremy Stretch at packetlife.net as a guide and to show that someone smarter than me confirmed the design. <\/span><a href=\"http:\/\/packetlife.net\/blog\/2012\/sep\/4\/simultaneous-tunneled-and-native-internet-access\/\"><span style=\"font-weight: 400;\">http:\/\/packetlife.net\/blog\/2012\/sep\/4\/simultaneous-tunneled-and-native-internet-access\/<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Jeremy\u2019s post goes into the details of building everything from the base up.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h1>Testing:<\/h1>\n<h2><b>Test from a computer on guest wifi:<\/b><\/h2>\n<pre><span style=\"font-weight: 400;\">C:\\Users\\&gt;tracert google.com<\/span>\r\n\r\n<span style=\"font-weight: 400;\">Tracing route to google.com [172.217.5.78]<\/span>\r\n\r\n<span style=\"font-weight: 400;\">over a maximum of 30 hops:<\/span>\r\n\r\n<span style=\"font-weight: 400;\"> \u00a01<\/span> <span style=\"font-weight: 400;\">81 ms \u00a0\u00a0139 ms 251 ms \u00a0172.17.1.1<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a02 \u00a0152 ms<\/span> <span style=\"font-weight: 400;\">35 ms<\/span> <span style=\"font-weight: 400;\">29 ms \u00a0[10.1.180.1]<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a03 \u00a0520 ms \u00a0\u00a0173 ms 652 ms \u00a0[10.254.254.161]<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a04 <\/span> <span style=\"font-weight: 400;\">4 ms \u00a0\u00a0\u00a0\u00a06 ms <\/span> <span style=\"font-weight: 400;\">7 ms \u00a0[****]<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a05 <\/span> <span style=\"font-weight: 400;\">8 ms <\/span> <span style=\"font-weight: 400;\">5 ms \u00a0\u00a0\u00a015 ms [****]<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a06<\/span> <span style=\"font-weight: 400;\">12 ms<\/span> <span style=\"font-weight: 400;\">10 ms <\/span> <span style=\"font-weight: 400;\">6 ms \u00a0144.228.109.65<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a07<\/span> <span style=\"font-weight: 400;\">34 ms \u00a0\u00a0166 ms 219 ms \u00a0sl-mpe50-sea-.sprintlink.net [144.232.3.126]<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a08 \u00a0662 ms \u00a0\u00a0638 ms 849 ms \u00a072.14.242.31<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a09 \u00a0572 ms<\/span> <span style=\"font-weight: 400;\">45 ms <\/span> <span style=\"font-weight: 400;\">9 ms \u00a0108.170.245.115<\/span>\r\n<span style=\"font-weight: 400;\">10 \u00a0\u00a0578 ms \u00a0\u00a0995 ms 370 ms \u00a066.249.94.201<\/span>\r\n<span style=\"font-weight: 400;\">11 \u00a0\u00a0955 ms \u00a0\u00a0618 ms 507 ms \u00a0209.85.240.228<\/span>\r\n<span style=\"font-weight: 400;\">12 \u00a0\u00a0268 ms \u00a0\u00a0457 ms 447 ms \u00a0216.239.54.158<\/span>\r\n<span style=\"font-weight: 400;\">13 \u00a0\u00a0358 ms \u00a0\u00a0342 ms 638 ms \u00a0216.239.51.124<\/span>\r\n<span style=\"font-weight: 400;\">14 \u00a0\u00a0\u00a061 ms<\/span> <span style=\"font-weight: 400;\">71 ms<\/span> <span style=\"font-weight: 400;\">51 ms \u00a0108.170.247.193<\/span>\r\n<span style=\"font-weight: 400;\">15 \u00a0\u00a0\u00a056 ms<\/span> <span style=\"font-weight: 400;\">88 ms<\/span> <span style=\"font-weight: 400;\">68 ms \u00a0108.170.237.113<\/span>\r\n<span style=\"font-weight: 400;\">16 \u00a0\u00a0\u00a055 ms<\/span> <span style=\"font-weight: 400;\">32 ms<\/span> <span style=\"font-weight: 400;\">44 ms \u00a0172.217.5.78<\/span>\r\n\r\n<span style=\"font-weight: 400;\">Trace complete.<\/span><\/pre>\n<h2><b>Test from a computer on the regular corp wifi or LAN:<\/b><\/h2>\n<pre><span style=\"font-weight: 400;\">C:\\Users\\&gt;tracert google.com<\/span>\r\n\r\n<span style=\"font-weight: 400;\">Tracing route to google.com [172.217.5.78]<\/span>\r\n\r\n<span style=\"font-weight: 400;\">over a maximum of 30 hops:<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a01<\/span> <span style=\"font-weight: 400;\">12 ms <\/span> <span style=\"font-weight: 400;\">5 ms<\/span> <span style=\"font-weight: 400;\">11 ms \u00a0192.168.2.1<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a02 <\/span> <span style=\"font-weight: 400;\">5 ms <\/span> <span style=\"font-weight: 400;\">5 ms <\/span> <span style=\"font-weight: 400;\">3 ms \u00a010.3.254.1 &lt; --- Headend Tunnel interface<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a03<\/span> <span style=\"font-weight: 400;\">10 ms <\/span> <span style=\"font-weight: 400;\">4 ms \u00a0\u00a0\u00a0\u00a05 ms [10.254.254.161]<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a04<\/span> <span style=\"font-weight: 400;\">17 ms <\/span> <span style=\"font-weight: 400;\">2 ms \u00a0\u00a0\u00a0\u00a09 ms [***]<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a05 <\/span> <span style=\"font-weight: 400;\">6 ms <\/span> <span style=\"font-weight: 400;\">4 ms <\/span> <span style=\"font-weight: 400;\">4 ms  [****]<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a06<\/span> <span style=\"font-weight: 400;\">10 ms <\/span> <span style=\"font-weight: 400;\">3 ms \u00a0\u00a0\u00a0\u00a07 ms 144.228.109.65<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a07 <\/span> <span style=\"font-weight: 400;\">6 ms <\/span> <span style=\"font-weight: 400;\">2 ms <\/span> <span style=\"font-weight: 400;\">2 ms \u00a0sl-mpe50-sea-.sprintlink.net [144.232.3.126]<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a08 <\/span> <span style=\"font-weight: 400;\">5 ms <\/span> <span style=\"font-weight: 400;\">4 ms \u00a0\u00a0\u00a0\u00a05 ms 72.14.242.31<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a09 <\/span> <span style=\"font-weight: 400;\">7 ms <\/span> <span style=\"font-weight: 400;\">4 ms <\/span> <span style=\"font-weight: 400;\">3 ms \u00a0108.170.245.115<\/span>\r\n<span style=\"font-weight: 400;\">10 \u00a0\u00a0\u00a0\u00a09 ms<\/span> <span style=\"font-weight: 400;\">12 ms <\/span> <span style=\"font-weight: 400;\">9 ms \u00a066.249.94.201<\/span>\r\n<span style=\"font-weight: 400;\">11 \u00a0\u00a0\u00a010 ms<\/span> <span style=\"font-weight: 400;\">29 ms<\/span> <span style=\"font-weight: 400;\">26 ms \u00a0209.85.240.228<\/span>\r\n<span style=\"font-weight: 400;\">12 \u00a0\u00a0\u00a034 ms<\/span> <span style=\"font-weight: 400;\">54 ms<\/span> <span style=\"font-weight: 400;\">59 ms \u00a0216.239.54.158<\/span>\r\n<span style=\"font-weight: 400;\">13 \u00a0\u00a0\u00a032 ms<\/span> <span style=\"font-weight: 400;\">32 ms<\/span> <span style=\"font-weight: 400;\">32 ms \u00a0216.239.51.124<\/span>\r\n<span style=\"font-weight: 400;\">14 \u00a0\u00a0\u00a030 ms<\/span> <span style=\"font-weight: 400;\">31 ms<\/span> <span style=\"font-weight: 400;\">30 ms \u00a0108.170.247.193<\/span>\r\n<span style=\"font-weight: 400;\">15 \u00a0\u00a0\u00a033 ms<\/span> <span style=\"font-weight: 400;\">30 ms<\/span> <span style=\"font-weight: 400;\">29 ms \u00a0108.170.237.113<\/span>\r\n<span style=\"font-weight: 400;\">16 \u00a0\u00a0\u00a038 ms<\/span> <span style=\"font-weight: 400;\">31 ms<\/span> <span style=\"font-weight: 400;\">40 ms \u00a0172.217.5.78<\/span>\r\n\r\n<span style=\"font-weight: 400;\">Trace complete.<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h1><b>Config differences:<\/b><\/h1>\n<h2><b>ADD config:<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">First you have to create a named VRF. Some people use all caps for VRF names to make them stand out. I don\u2019t because it\u2019s a pain when you want to ping, trace, or use any VRF specific commands.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">!The VRF names doesn\u2019t matter but fdoor relates to Front Door VRF sometimes used with DMVPN. It separates the base routing and the \u201coverlay routing\u201d used by the VPN. You could also put all interfaces in VRF\u2019s and not use the global routing table but I didn\u2019t.<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">!<\/span><i><span style=\"font-weight: 400;\">Create the VRF.<\/span><\/i>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">ip vrf fdoor<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span><i><span style=\"font-weight: 400;\">Required to support DHCP when using VRF\u2019s.<\/span><\/i>\r\n<span style=\"font-weight: 400;\">no ip dhcp use vrf connected<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span><i><span style=\"font-weight: 400;\">Place the internet interface in the VRF<\/span><\/i>\r\n<span style=\"font-weight: 400;\">interface &lt;internet-interface&gt;<\/span>\r\n<span style=\"font-weight: 400;\">ip vrf forwarding fdoor<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span><i><span style=\"font-weight: 400;\">Place the guest interface in the VRF<\/span><\/i>\r\n<span style=\"font-weight: 400;\">interface vlan15<\/span>\r\n<span style=\"font-weight: 400;\">ip vrf forwarding fdoor<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span><i><span style=\"font-weight: 400;\">Tell the tunnel to use the VRF for its source interface.<\/span><\/i>\r\n<span style=\"font-weight: 400;\">Interface &lt;tunnel-number&gt;<\/span>\r\n<span style=\"font-weight: 400;\">tunnel vrf fdoor<\/span><\/pre>\n<h2><b>CHANGE config:<\/b><\/h2>\n<pre><span style=\"font-weight: 400;\">!<\/span><i><span style=\"font-weight: 400;\">The NAT needs to be told about the VRF.<\/span><\/i>\r\n<span style=\"font-weight: 400;\">!<\/span><i><span style=\"font-weight: 400;\">Change this:<\/span><\/i>\r\n<span style=\"font-weight: 400;\">ip nat inside source list 130 interface &lt;internet-interface&gt; overload<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span><i><span style=\"font-weight: 400;\">To this:<\/span><\/i>\r\n<span style=\"font-weight: 400;\">ip nat inside source list 130 interface &lt;internet-interface&gt; vrf fdoor match-in-vrf fdoor overload<\/span>\r\n<i><span style=\"font-weight: 400;\">!The default route needs to be moved to the VRF.<\/span><\/i>\r\n<span style=\"font-weight: 400;\">!<\/span><i><span style=\"font-weight: 400;\">Change from this:<\/span><\/i>\r\n<span style=\"font-weight: 400;\">ip route 0.0.0.0 0.0.0.0 &lt;internet-interface&gt; &lt;internet-gw&gt;<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span><i><span style=\"font-weight: 400;\">To this:<\/span><\/i>\r\n<span style=\"font-weight: 400;\">ip route vrf fdoor 0.0.0.0 0.0.0.0 &lt;internet-interface&gt; &lt;internet-gw&gt;<\/span><\/pre>\n<h2><b>REMOVE config:<\/b><\/h2>\n<pre><span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">interface Vlan10<\/span>\r\n<span style=\"font-weight: 400;\">no ip policy route-map wifi-mgmt-route-map <\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">interface Vlan30<\/span>\r\n<span style=\"font-weight: 400;\">no ip policy route-map wifi-guest-route-map<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">interface Vlan36<\/span>\r\n<span style=\"font-weight: 400;\">no ip policy route-map LAN-route-map<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">no route-map wifi-mgmt-route-map permit 10<\/span>\r\n<span style=\"font-weight: 400;\"> !match ip address CAPWAP-traffic<\/span>\r\n<span style=\"font-weight: 400;\"> !set ip precedence flash-override<\/span>\r\n<span style=\"font-weight: 400;\"> !set ip next-hop &lt;branch-LAN-gw&gt;<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">no route-map LAN-route-map permit 10<\/span>\r\n<span style=\"font-weight: 400;\"> !match ip address all-except-localwifi<\/span>\r\n<span style=\"font-weight: 400;\"> !set interface Tunnel1999<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">no route-map wifi-guest-route-map permit 10<\/span>\r\n<span style=\"font-weight: 400;\"> !match ip address 130<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span>\r\n<span style=\"font-weight: 400;\">!<\/span><i><span style=\"font-weight: 400;\">These routes are not needed as we have dynamic routes for the tunnel and a static default route for internet access in the fdoor VRF.<\/span><\/i>\r\n<span style=\"font-weight: 400;\">no ip route 0.0.0.0 0.0.0.0 vlan33 &lt;branch-LAN-gw&gt; 254<\/span>\r\n<span style=\"font-weight: 400;\">no ip route &lt;DNS1&gt; 255.255.255.255 &lt;internet-interface&gt; &lt;internet-gw&gt;<\/span>\r\n<span style=\"font-weight: 400;\">no ip route &lt;DNS2&gt; 255.255.255.255 &lt;internet-interface&gt; &lt;internet-gw&gt;<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">As you can see you end up with less configs and better routing. I was able to convert a few hundred of these setups over a few weeks with old school copy pasta. But it I had to do this again I\u2019d spend time on a Python script that would convert, test, and document the results.<\/span><\/p>\n\n\n<p><span id=\"docs-internal-guid-8a2975d6-7fff-4b41-c0c4-179ab1137158\"><span style=\"font-size: 10pt; font-family: Arial, sans-serif; color: rgb(0, 0, 0); background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; vertical-align: baseline;\"><span style=\"border:none;display:inline-block;overflow:hidden;width:517px;height:713px;\"><img loading=\"lazy\" decoding=\"async\" width=\"517\" height=\"713\" style=\"margin-left:0px;margin-top:0px;\" src=\"https:\/\/lh6.googleusercontent.com\/SKiYqbyce5vt2srGXjrx57WrNotgMuee2b6NkwxFpCSLImL3VX1AFrV4tf6hddJogHC4HZJInfjKelxOKqULZtHTwYpZNyLgEoXpRtsdxZqVlaj4AZk3H3yLyrFxHNiTG-qw7c8qthO1CdxEUqo7vA\"><\/span><\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is about a situation I ran into a while ago and records my configs and testing for converting from a PBR setup to VRF on a Cisco 881 router with a diagram at the end. Through a combination of configs involving PBR (Policy Based Routing) AKA Source Routing (as opposed to standard Destination [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[35,3,45],"tags":[12,47,46],"class_list":["post-58","post","type-post","status-publish","format-standard","hentry","category-cisco","category-routing","category-wifi","tag-cisco","tag-vpn","tag-wifi"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/andrewjwhittle.com\/wp-lotpnet\/wp-json\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/andrewjwhittle.com\/wp-lotpnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andrewjwhittle.com\/wp-lotpnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andrewjwhittle.com\/wp-lotpnet\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/andrewjwhittle.com\/wp-lotpnet\/wp-json\/wp\/v2\/comments?post=58"}],"version-history":[{"count":12,"href":"https:\/\/andrewjwhittle.com\/wp-lotpnet\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":335,"href":"https:\/\/andrewjwhittle.com\/wp-lotpnet\/wp-json\/wp\/v2\/posts\/58\/revisions\/335"}],"wp:attachment":[{"href":"https:\/\/andrewjwhittle.com\/wp-lotpnet\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andrewjwhittle.com\/wp-lotpnet\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andrewjwhittle.com\/wp-lotpnet\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}