# Mikrotik Script

1. **เข้าไปที่ Menu Tools > Mikrotik Script**&#x20;

<div align="center" data-full-width="true"><figure><img src="/files/IOMlozjmAuxkmENKIcig" alt=""><figcaption></figcaption></figure></div>

2. **ใส่ข้อมูลในแบบฟอร์มให้ครบตามภาพ**

**OS Version  :**   ใส่ Version ของ RouterOS  จะมีให้เลือก 2 Version คือ ROS6 , ROS7

**WAN Type    :**   เลือกประเภท Wan ที่ต้องการ  ในแบบฟอร์มจะมีให้เลือก 3 รูปแบบคือ Static , dhcp , pppoe &#x20;

* <mark style="color:blue;">Static</mark>  คือการ fix ip ให้กับขา Wan ในกรณีที่ Internet เป็นรูปแบบ Leased line หรือต้องการ static ip ในรูปแบบอื่นให้กับขา WAN
* <mark style="color:blue;">DHCP</mark>  คือการต้องค่าให้ขา WAN รับ dhcp มาจาก dhcp server หรืออุปกรณ์อื่นที่แจก IP มาให้กับขา WAN
* <mark style="color:blue;">PPOE</mark>   คือการตั้งค่าให้ขา WAN เชื่อต่อ Internet แบบ pppoe ซึ่งต้องค่าให้ router ของ ISP เป็นรูปแบบ bridge mode  และ ต้องขอ username และ password จาก ISP มาใส่ในฟอร์ม

**LAN Network  :**  ใส่ Network address สำหรับขา LAN <mark style="color:red;">\*ต้องใส่เป็น Network Address เท่านั้น ห้ามใส่เป็น Gateway หรือ IP อื่นใน network</mark>

**DHCP Start  :**  คือการตั้งค่า IP แรกที่จะให้ Mikrotik แจก dhcp

**DHCP End    :**   คือการตั้งค่า IP สุดท้ายที่จะให้ Mikrotik แจก dhcp

**Subnet  :**  คือการตั้งค่า Subnet Mask  ให้กับ LAN Network&#x20;

**Bridge LAN Port  :**  คือการเลือก Interface ใน Mikrotik ให้เป็นขา LAN   ต้องเลือกตามจำนวน Port ของ Mikrotik รุ้นที่เราใช้  เช่น  Mikrotik รุ่นที่ใช้มีทั้งหมด 5 Port  ก็ให้เลือก Port 2 - Port 5 &#x20;

<div data-full-width="true"><figure><img src="/files/pRALGh3yzU4g7htyxpjx" alt=""><figcaption></figcaption></figure></div>

3. **หากใส่ข้อมูลถูกต้องครบถ้วนแล้วให้กด Create Script  ระบบจะ Export เป็น file script ในรูปแบบ text ออกมาให้**

<div data-full-width="true"><figure><img src="/files/28YaUM6hESbDs76CK5Rn" alt=""><figcaption></figcaption></figure></div>

4. Download file เพิ่มเติมสำหรับการ Run Script     Download ให้ครบทั้งหมด 5 File&#x20;

<div data-full-width="true"><figure><img src="/files/KYgxRHA6Wm3CH64loPHV" alt=""><figcaption></figcaption></figure></div>

<div data-full-width="true"><figure><img src="/files/aXtahBHAC2e3K9hlLA5h" alt=""><figcaption></figcaption></figure></div>

5. **ให้แก้ไข file alogin.html และ login.html  โดยใช้โปรแกรม text editor เช่น notepad++**

&#x20;                  File alogin.html  ให้แก้ไขเป็น domain name ของเราที่ได้รับจาก mail&#x20;

<div data-full-width="true"><figure><img src="/files/DypU7AYNpH3gdRa47ntq" alt=""><figcaption></figcaption></figure></div>

&#x20;                  File login.html  ให้แก้ไขเป็น domain name ของเราที่ได้รับจาก mail&#x20;

<div data-full-width="true"><figure><img src="/files/KGVbRZPTzqEwJtVXNLhx" alt=""><figcaption></figcaption></figure></div>

6. **โยนไฟล์ certificate ทั้ง 3 ไฟล์เข้าไปใน winbox ของ Mikrotik  สามารถวางตรงหน้าว่างๆของ winbox ได้เลย**

<div data-full-width="true"><figure><img src="/files/vfPkTL5XM8A9tOYxPIIW" alt=""><figcaption></figcaption></figure></div>

7. **โยนไฟล์ alogin.html และ login.html เข้าไว้แทนไฟล์เดิมใน folder html** &#x20;

ให้ click ค้างไฟล์ที่ต้องการแล้วลากไปวางทับตำแหน่งไฟล์เดิมตามภาพทีละไฟล์   <mark style="color:red;">\* ต้องวางให้ตรงกับตำแหน่งไฟล์เดิม</mark>

<div data-full-width="true"><figure><img src="/files/QCbNqM2onVKpnJQiokDH" alt=""><figcaption></figcaption></figure></div>

8. **Clear Config เดิมใน Mikrotik  ให้ทำตามขั้นตอนตามภาพเลย**

<div data-full-width="true"><figure><img src="/files/42WqOyJkhgnlVcgouJ6U" alt=""><figcaption></figcaption></figure></div>

9. **เปิดไฟล์ microtikScript.txt  ด้วยโปรแกรม notepad++  จากนั้นคลุมดำทั้งหมดแล้ว copy ไปวางใน terminal ใน winbox ได้เลย** &#x20;

<div data-full-width="true"><figure><img src="/files/YhpqECwK9zW99iBehNpz" alt=""><figcaption></figcaption></figure></div>

**หากทำครบแล้วให้นำ Mac address ใน menu   System > identity ไป add ใน Web Seara** [ **วิธีทำ**](/connect-to-seara-with/how-to-setup-equipment-connect-to-seara/connect-microtik-to-seara.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manual.seara.biz/systems/tools/mikrotik-script.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
