# Radius Server and Login Page

## 1. Set Radius Server

Service: hotspot = On

Address: <mark style="color:yellow;">(IP ของ Server เช็คในอีเมล์)</mark>

Secret: <mark style="color:orange;">**เช็คในอีเมล์ สำหรับ Secret Key**</mark>

Authentication Port: <mark style="color:yellow;">(Port ของ Server เช็คในอีเมล์)</mark>

Account Port: <mark style="color:yellow;">(Port ของ Server เช็คในอีเมล์)</mark>

Timeout: 9000Radius >

<figure><img src="https://71561992-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M-OjnKhMWq_4gll0i0s%2Fuploads%2FEVP16YyjYHqD3psS0i9U%2Fimage.png?alt=media&#x26;token=bce4f8d8-0b46-422c-bd26-de0b5d2b75b3" alt=""><figcaption></figcaption></figure>

## 2. สร้าง Hot Spot Server

<mark style="color:orange;">**IP --> Hotspot --> Server**</mark>

&#x20;    NAME: ให้เอา MAC Address ของ Interface ที่ต้องการมาใส่ ในกรณีนีนี้คือ bridge\_LAN&#x20;

&#x20;    Interface: เลือก bridge\_LAN ที่เรานั้นได้สร้างเอาไว้

&#x20;    Address pool: เลือก  pool ตามที่เราสร้างไว้ในขั้นตอน DHCP Server&#x20;

&#x20;    Profile: default

<figure><img src="https://71561992-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M-OjnKhMWq_4gll0i0s%2Fuploads%2Fs4JtvxljSvBQVBXS8z3E%2Fimage.png?alt=media&#x26;token=9e99208d-9bb1-47de-864b-fc5bc71dbdf2" alt=""><figcaption></figcaption></figure>

ในหัวข้อ Server Profiles --> Login

&#x20;    Login: เลือก HTTP PAP

&#x20;    Radius: เลือก Use Radius

ในหัวข้อ Server Profiles --> RADIUS

&#x20;    ติ๊ก Use RADIUS และ

&#x20;    Interim Uptime: 00:01:00

<figure><img src="https://71561992-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M-OjnKhMWq_4gll0i0s%2Fuploads%2F0R82jSQejMWgjTeZJ703%2Fimage.png?alt=media&#x26;token=42bdd438-983e-415a-955d-77d935ccd56f" alt=""><figcaption></figcaption></figure>

&#x20;    ในหัวข้อ User Profiles  --> General

&#x20;         Address Poot: เลือก  pool ตามที่เราสร้างไว้ในขั้นตอน DHCP Server&#x20;

&#x20;          Shared User: ไม่ต้องใส่ ให้เป็นค่าว่าง

<figure><img src="https://71561992-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M-OjnKhMWq_4gll0i0s%2Fuploads%2FGJGlXreo0wV21EJNgvpM%2Fimage.png?alt=media&#x26;token=864ffad2-e41f-4182-835a-38e5372fb398" alt=""><figcaption></figcaption></figure>

## 3. แก้ไข File alogin.html และ login.html เพื่อให้ microtik ส่งการ Login ด้วย hotspot ไปยัง seara cloud

ให้ Download file สำหรับ Hotspot ตาม Link ด้านล่างและแตก zip file จะได้ file alogin.html และ login.html สำหรับใช้ใน hotspot

{% file src="<https://71561992-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M-OjnKhMWq_4gll0i0s%2Fuploads%2FZNfqwMYTKWTETt31IsK2%2Falogin%20and%20login.zip?alt=media&token=f0aa344a-56cd-4b84-bc8f-a9edaaf17de6>" %}
ไฟล์ alogin.html และ login.html
{% endfile %}

1. ให้แก้ไขไฟล์ alogin.html บรรทัดที่ 3 และ  บรรทัดที่ 34 โดยแก้ไขชื่อ domain จาก demo.seara-portal.net ให้ถูกต้องตามที่ได้รับจาก email&#x20;

<pre class="language-html" data-title="alogin.html" data-line-numbers><code class="lang-html">&#x3C;html>
&#x3C;head>
&#x3C;meta http-equiv="refresh" content="2" url="<a data-footnote-ref href="#user-content-fn-1">https://demo.seara-portal.net/app/portal/welcome</a>">
&#x3C;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
&#x3C;meta http-equiv="pragma" content="no-cache">
&#x3C;meta http-equiv="expires" content="-1">
&#x3C;title>mikrotik hotspot > redirect&#x3C;/title>
&#x3C;style type="text/css">
&#x3C;!--
textarea,input,select {
	background-color: #FDFBFB;
	border: 1px #BBBBBB solid;
	padding: 2px;
	margin: 1px;
	font-size: 14px;
	color: #808080;
}

body{ color: #737373; font-size: 12px; font-family: verdana; }

a, a:link, a:visited, a:active { color: #AAAAAA; text-decoration: none; font-size: 12px; }
a:hover { border-bottom: 1px dotted #c1c1c1; color: #AAAAAA; }
img {border: none;}
td { font-size: 12px; color: #7A7A7A; }

-->
&#x3C;/style>
&#x3C;script language="JavaScript">
&#x3C;!--
    function startClock() {
        $(if popup == 'true')
        open('$(link-status)', 'hotspot_status', 'toolbar=0,location=0,directories=0,status=0,menubars=0,resizable=1,width=290,height=200');
	$(endif)
	location.href = unescape("<a data-footnote-ref href="#user-content-fn-1">https://demo.seara-portal.net/app/portal/welcome"</a>);
    }
//-->
&#x3C;/script>
&#x3C;/head>
&#x3C;body onLoad="startClock()">
&#x3C;table width="100%" height="100%">
&#x3C;tr>
	&#x3C;td align="center" valign="middle">
	You are logged in
	&#x3C;br>&#x3C;br>
	If nothing happens, click &#x3C;a href="$(link-redirect)">here&#x3C;/a>&#x3C;/td>
&#x3C;/tr>
&#x3C;/table>
&#x3C;/body>
&#x3C;/html>
</code></pre>

2. ให้แก้ไขไฟล์ login.html บรรทัดที่ 5 และ  บรรทัดที่ 16 โดยแก้ไขชื่อ domain จาก demo.seara-portal.net ให้ถูกต้องตามที่ได้รับจาก email&#x20;

<pre class="language-html" data-title="login.html" data-line-numbers><code class="lang-html">&#x3C;html>
&#x3C;title>...&#x3C;/title>
&#x3C;body>
&#x3C;center>If you are not redirected in a few seconds, click 'continue' below&#x3C;br>
&#x3C;form name="redirect" action="<a data-footnote-ref href="#user-content-fn-1">https://demo.seara-portal.net/app/portal/login"</a> method="GET">
&#x3C;input type="hidden" name="mac" value="$(mac)">
&#x3C;input type="hidden" name="client_ip" value="$(ip)">
&#x3C;input type="hidden" name="username" value="$(username)">
&#x3C;input type="hidden" name="nasid" value="$(identity)">
&#x3C;input type="hidden" name="loginUrl" value="$(link-login-only)">
&#x3C;input type="hidden" name="linkorig" value="$(link-orig)">
&#x3C;input type="hidden" name="error" value="$(error)">
&#x3C;input type="hidden" name="interface" value="$(interface-name)">
&#x3C;input type="hidden" name="macesc" value="$(mac-esc)">
&#x3C;input type="hidden" name="dst" value="<a data-footnote-ref href="#user-content-fn-1">https://demo.seara-portal.net/app/portal/welcome</a>">
&#x3C;input type="submit" value="continue">
&#x3C;/form>
&#x3C;script language="JavaScript">
	document.redirect.submit();
&#x3C;/script>&#x3C;/center>
&#x3C;/body>
&#x3C;/html>
</code></pre>

3. นำ file ที่แก้ไขข้อมูลแล้วทั้ง 2 file ใส่ไปที่ Folder hotspot ของอุปกรณ์

&#x20;  <mark style="color:orange;">**File -> Upload--> /flash/hotspot/alogin.html**</mark>

&#x20;  <mark style="color:orange;">**File -> Upload--> /flash/hotspot/login.html**</mark>&#x20;

<figure><img src="https://71561992-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M-OjnKhMWq_4gll0i0s%2Fuploads%2FgWN4BJjzJevFzHmgUVde%2Fupload%20login%20file.png?alt=media&#x26;token=771253e5-6d12-4094-9ea8-4aa28cd0c186" alt=""><figcaption><p>ให้ Upload ไปทับ File เดิมในระบบที่มีอยู่</p></figcaption></figure>

[^1]: แก้ไข domain ให้เป็น domain ที่ได้รับจาก email&#x20;
