{"id":5985,"date":"2019-04-04T10:35:25","date_gmt":"2019-04-04T16:35:25","guid":{"rendered":"http:\/\/gregsowell.com\/?p=5985"},"modified":"2019-04-02T15:30:20","modified_gmt":"2019-04-02T21:30:20","slug":"accessing-geolocked-content-the-easy-way-with-mikrotik-mum-2019-presentation","status":"publish","type":"post","link":"https:\/\/gregsowell.com\/?p=5985","title":{"rendered":"Accessing Geolocked Content The Easy Way With Mikrotik &#8211; MUM 2019 Presentation"},"content":{"rendered":"<p>This is a virtual light switch to turn routing rules on and off on a Mikrotik.  My example here allows me to route my roku through a remote VPN, then easily turn that off.  This allows me to access remote geolocked streaming video as well as local geolocked content.<\/p>\n<p>Here&#8217;s the presentation:<br \/>\n<iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/zOEXuykB47o\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>Here&#8217;s my lab configuration:<br \/>\n<a href=\"http:\/\/gregsowell.com\/wp-content\/uploads\/2019\/04\/geolocked-diagram.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gregsowell.com\/wp-content\/uploads\/2019\/04\/geolocked-diagram.png\" alt=\"\" width=\"634\" height=\"376\" class=\"aligncenter size-full wp-image-5987\" srcset=\"https:\/\/gregsowell.com\/wp-content\/uploads\/2019\/04\/geolocked-diagram.png 634w, https:\/\/gregsowell.com\/wp-content\/uploads\/2019\/04\/geolocked-diagram-300x178.png 300w\" sizes=\"auto, (max-width: 634px) 100vw, 634px\" \/><\/a><\/p>\n<p>Here&#8217;s the HTML for the &#8220;on\/off&#8221; buttons:<\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;div style=&quot;width:50%&quot;&gt;\r\n&lt;form action=&quot;http:\/\/4.4.4.1:85&quot;&gt;\r\n    &lt;input type=&quot;submit&quot; value=&quot;VPN Off&quot; \/&gt;\r\n&lt;\/form&gt;\r\n&lt;form action=&quot;http:\/\/4.4.4.2:85&quot;&gt;\r\n    &lt;input type=&quot;submit&quot; value=&quot;VPN On&quot; \/&gt;\r\n&lt;\/form&gt;\r\n&lt;\/div&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<p>Here&#8217;s the USA Mikrotik:<\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">\/interface pptp-server server\r\nset enabled=yes\r\n\/ip address\r\nadd address=100.64.0.1\/30 interface=ether1 network=100.64.0.0\r\n\/ip firewall nat\r\nadd action=masquerade chain=srcnat out-interface=ether1\r\n\/ip route\r\nadd distance=1 gateway=100.64.0.2\r\n\/ppp secret\r\nadd local-address=4.4.4.3 name=roku password=rokupassword remote-address=4.4.4.4\r\n\/system identity\r\nset name=USA<\/code><\/pre>\n<p>Here&#8217;s the AUS Mikrotik:<\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">\/interface bridge\r\nadd name=loop1\r\n\/interface pptp-client\r\nadd connect-to=100.64.0.1 disabled=no name=pptp-usa password=rokupassword user=roku\r\n\/ip address\r\nadd address=100.64.1.1\/30 interface=ether2 network=100.64.1.0\r\nadd address=192.168.10.1\/24 interface=ether1 network=192.168.10.0\r\nadd address=4.4.4.1 interface=loop1 network=4.4.4.1\r\nadd address=4.4.4.2 interface=loop1 network=4.4.4.2\r\n\/ip dhcp-client\r\nadd dhcp-options=hostname,clientid interface=ether5\r\n\/ip firewall filter\r\nadd action=drop chain=input comment=&quot;tunnel off&quot; dst-address=4.4.4.1 src-address-list=tunnel-off\r\nadd action=drop chain=input comment=&quot;tunnel on&quot; dst-address=4.4.4.2 src-address-list=tunnel-on\r\nadd action=add-dst-to-address-list address-list=tunnel-off address-list-timeout=6s chain=input \\\r\n    comment=&quot;tunnel off&quot; dst-address=4.4.4.1 protocol=tcp\r\nadd action=add-dst-to-address-list address-list=tunnel-on address-list-timeout=6s chain=input \\\r\n    comment=&quot;tunnel on&quot; dst-address=4.4.4.2 protocol=tcp\r\n\/ip firewall nat\r\nadd action=masquerade chain=srcnat out-interface=ether2\r\nadd action=masquerade chain=srcnat out-interface=pptp-usa\r\n\/ip route\r\nadd distance=1 gateway=4.4.4.3 routing-mark=roku\r\nadd distance=1 gateway=100.64.1.2\r\n\/ip route rule\r\nadd action=lookup-only-in-table disabled=yes src-address=192.168.10.100\/32 table=roku\r\n\/system identity\r\nset name=AUS\r\n\/tool netwatch\r\nadd comment=&quot;turn off&quot; down-script=&quot;\/ip route rule set 0 dis=yes&quot; host=4.4.4.1 interval=5s\r\nadd comment=&quot;turn on&quot; down-script=&quot;\/ip route rule set 0 dis=no&quot; host=4.4.4.2 interval=5s<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is a virtual light switch to turn routing rules on and off on a Mikrotik. My example here allows me to route my\u2026<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,17,8],"tags":[],"class_list":["post-5985","post","type-post","status-publish","format-standard","hentry","category-mikrotik","category-mikrotik-tutorials","category-networking"],"_links":{"self":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/5985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5985"}],"version-history":[{"count":3,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/5985\/revisions"}],"predecessor-version":[{"id":5989,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/5985\/revisions\/5989"}],"wp:attachment":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}