{"id":316,"date":"2009-03-16T01:21:12","date_gmt":"2009-03-16T07:21:12","guid":{"rendered":"http:\/\/gregsowell.com\/?p=316"},"modified":"2009-03-16T12:50:16","modified_gmt":"2009-03-16T18:50:16","slug":"mikrotik-hotspot-eula-redirect","status":"publish","type":"post","link":"https:\/\/gregsowell.com\/?p=316","title":{"rendered":"Mikrotik Hotspot EULA Redirect"},"content":{"rendered":"<p>You are running Mikrotik in hotspot mode for a customer, but don&#8217;t allow them connect to the device.  They  update their EULA(End User License Agreement) semi-regularly.  Rather than wasting time updating their login.html constantly, you want a more flexible solution.  <\/p>\n<p>My proposal is to simply use an IFrame.  An IFrame is a piece of html that allows you to add a frame to your page that contains a completely seperate web page.  So in effect, you will have a web page imbedded in your web page.<\/p>\n<p>Click below for PAGE CODE!<br \/>\n<!--more--><\/p>\n<p>I&#8217;ve modified this login page on my test Mikrotik to open an iframe from my server:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-327\" title=\"hotspotiframe\" src=\"http:\/\/gregsowell.com\/wp-content\/uploads\/2009\/03\/hotspotiframe.jpg\" alt=\"hotspotiframe\" width=\"974\" height=\"688\" srcset=\"https:\/\/gregsowell.com\/wp-content\/uploads\/2009\/03\/hotspotiframe.jpg 974w, https:\/\/gregsowell.com\/wp-content\/uploads\/2009\/03\/hotspotiframe-300x211.jpg 300w\" sizes=\"auto, (max-width: 974px) 100vw, 974px\" \/><\/p>\n<p>You will see the magic comes from <code lang=\"html\"><iframe loading=\"lazy\" src=\"http:\/\/gregsowell.com\/eula.html\" width=\"90%\" height=\"310\"> <\/iframe><\/pre>\n<p>.<br \/>\nWhat I'm doing is simply pulling an HTML page from a different source.  The iframe can be customized to have no borders and span the entire page if you want.  This makes it appear as if it is one page.<\/p>\n<p>Here is the HTML:<br \/>\n<code lang=\"html\"><br \/>\n<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\"\n   \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\"><br \/>\n<html><br \/>\n<head><br \/>\n<title>GregSowell.com Hotspot<\/title><br \/>\n<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=UTF-8\" \/><br \/>\n<meta http-equiv=\"pragma\" content=\"no-cache\" \/><br \/>\n<meta http-equiv=\"expires\" content=\"-1\" \/><\/p>\n<style type=\"text\/css\">\nbody {color: #737373; font-size: 10px; font-family: verdana;}<\/p>\n<p>textarea,input,select {\nbackground-color: #FDFBFB;\nborder: 1px solid #BBBBBB;\npadding: 2px;\nmargin: 1px;\nfont-size: 14px;\ncolor: #808080;\n}<\/p>\n<p>a, a:link, a:visited, a:active { color: #AAAAAA; text-decoration: none; font-size: 10px; }\na:hover { border-bottom: 1px dotted #c1c1c1; color: #AAAAAA; }\nimg {border: none;}\ntd { font-size: 14px; color: #7A7A7A; }\n<\/style>\n<p><\/head><\/p>\n<p><body><\/p>\n<div align=\"center\">\n<\/div>\n<table width=\"100%\" style=\"margin-top: 10%;\">\n<tr>\n<td align=\"center\" valign=\"middle\">\n\t<a href=\"http:\/\/www.gregsowell.com\" target=\"_blank\" style=\"border: none;\"><img decoding=\"async\" src=\"\/img\/gregsowell.png\" alt=\"gregsowell.com\" \/><\/a><\/p>\n<div class=\"notice\" style=\"color: #c1c1c1; font-size: 12px\">GregSowell.com Wireless Internet<\/div>\n<p>\t\t<\/p>\n<div class=\"notice\" style=\"color: #FF8080; font-size: 18px\">Guest access available by reading AUP and clicking Accept at bottom of page.<\/div>\n<p><\/p>\n<table width=\"600\" style=\"background-color: #ffffff\">\n<tr>\n<td>\n<iframe loading=\"lazy\" src=\"http:\/\/gregsowell.com\/eula.html\" width=\"90%\" height=\"310\"> <\/iframe><\/p>\n<p><center><\/p>\n<table width=\"140\" height=\"40\" style=\"border: 1px solid #cccccc; padding: 0px;\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n<td align=\"center\" height=\"32\" colspan=\"2\">\n\t\t\t<center><a style=\"color: #FF8080; font-size: 12px\"href=\"$(link-login-only)?dst=$(link-orig-esc)&amp;username=T-$(mac-esc)\"> Accept AUP Terms<\/a><\/center>\n\t\t<\/td>\n<\/tr>\n<\/table>\n<p><\/center>\n<\/td>\n<\/tr>\n<\/table>\n<\/td>\n<\/tr>\n<\/table>\n<p><\/body><br \/>\n<\/html>\n<\/pre>\n<p>After modifying the login.html page, you need to add the URL of your web server to the allowed list in walled garden:<\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">ip hotspot walled-garden add server=hotspot1 dst-address=1.1.1.1 src-address=0.0.0.0\/0 path=&quot;\/EULA.html&quot;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You are running Mikrotik in hotspot mode for a customer, but don&#8217;t allow them connect to the device. They update their EULA(End User License\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],"tags":[],"class_list":["post-316","post","type-post","status-publish","format-standard","hentry","category-mikrotik"],"_links":{"self":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/316","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=316"}],"version-history":[{"count":19,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/316\/revisions"}],"predecessor-version":[{"id":391,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/316\/revisions\/391"}],"wp:attachment":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}