> For the complete documentation index, see [llms.txt](https://manual-en.seara.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual-en.seara.biz/systems/tools/mikrotik-script.md).

# Mikrotik Script

This menu generates a command-line script for configuring Mikrotik devices. The script can be used on both RouterOS 6 and 7. In this script, port1 of the Mikrotik is fixed as the WAN port.

1. **Go to Menu Tools > Mikrotik Script**

<div align="center" data-full-width="true"><figure><img src="https://2507662344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBkKbWLZfasd8l3v8ndZ%2Fuploads%2Fgit-blob-2315350f2b6e5b4f3f9852f14caf20fe613cfe1b%2Fimage%20(379).png?alt=media" alt=""><figcaption></figcaption></figure></div>

2. **Fill in the form as shown**

**OS Version:** The RouterOS version. Two versions are available: ROS6 and ROS7.

**WAN Type:** Select the desired WAN type. The form offers 3 options: Static, dhcp, pppoe.

* <mark style="color:blue;">Static</mark> fixes the IP on the WAN port — used when the internet is a Leased line or you otherwise need a static IP on the WAN port.
* <mark style="color:blue;">DHCP</mark> configures the WAN port to receive an IP from a DHCP server or another device that hands out IPs to the WAN port.
* <mark style="color:blue;">PPOE</mark> configures the WAN port to connect to the internet via pppoe. The ISP router must be in bridge mode, and you must obtain the username and password from the ISP to enter in the form.

**LAN Network:** Enter the network address for the LAN port. <mark style="color:red;">\*Must be a Network Address only — do not enter a Gateway or any other IP in the network.</mark>

**DHCP Start:** The first IP address Mikrotik will hand out via DHCP.

**DHCP End:** The last IP address Mikrotik will hand out via DHCP.

**Subnet:** The subnet mask for the LAN Network.

**Bridge LAN Port:** Select the Mikrotik interfaces to be used as LAN ports. Choose according to the number of ports on your Mikrotik model — for example, a 5-port Mikrotik would use Port 2 through Port 5.

<div data-full-width="true"><figure><img src="https://2507662344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBkKbWLZfasd8l3v8ndZ%2Fuploads%2Fgit-blob-363f9fa41d8efd2f8b43f0b1b6840eb4df0b9d82%2Fimage%20(380).png?alt=media" alt=""><figcaption></figcaption></figure></div>

3. **After the form is filled in correctly, click Create Script. The system will export a text script file.**

<div data-full-width="true"><figure><img src="https://2507662344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBkKbWLZfasd8l3v8ndZ%2Fuploads%2Fgit-blob-d0342cf7bf3651451308387c976ef6c51193b833%2Fimage%20(381).png?alt=media" alt=""><figcaption></figcaption></figure></div>

4. Download the additional files required to run the script. Download all 5 files.

<div data-full-width="true"><figure><img src="https://2507662344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBkKbWLZfasd8l3v8ndZ%2Fuploads%2Fgit-blob-1e50f286ca0955e7f62691d5620b1e7bf7418774%2Fimage%20(382).png?alt=media" alt=""><figcaption></figcaption></figure></div>

<div data-full-width="true"><figure><img src="https://2507662344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBkKbWLZfasd8l3v8ndZ%2Fuploads%2Fgit-blob-8332dd3c08ce34c48fffd11725e347aab6db9dc7%2Fimage%20(385).png?alt=media" alt=""><figcaption></figcaption></figure></div>

5. **Edit alogin.html and login.html using a text editor such as notepad++.**

In alogin.html, change it to the domain name you received by email.

<div data-full-width="true"><figure><img src="https://2507662344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBkKbWLZfasd8l3v8ndZ%2Fuploads%2Fgit-blob-ef353dc6dced4292c9d654da3069cfdcad9cc634%2Fimage%20(386).png?alt=media" alt=""><figcaption></figcaption></figure></div>

In login.html, change it to the domain name you received by email.

<div data-full-width="true"><figure><img src="https://2507662344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBkKbWLZfasd8l3v8ndZ%2Fuploads%2Fgit-blob-3905730c3c1a9ec1cb966ad9d5d4e9421804511d%2Fimage%20(388).png?alt=media" alt=""><figcaption></figcaption></figure></div>

6. **Drop all 3 certificate files into the Mikrotik Winbox. You can drop them directly onto an empty area in Winbox.**

<div data-full-width="true"><figure><img src="https://2507662344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBkKbWLZfasd8l3v8ndZ%2Fuploads%2Fgit-blob-8c0375cc344a954e633237d403127a8dcfa67d54%2Fimage%20(389).png?alt=media" alt=""><figcaption></figcaption></figure></div>

7. **Place alogin.html and login.html into the html folder, replacing the existing files.**

Click and hold each file, then drag it over the existing file location as shown, one file at a time. <mark style="color:red;">\* Must overlap the existing file's location exactly.</mark>

<div data-full-width="true"><figure><img src="https://2507662344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBkKbWLZfasd8l3v8ndZ%2Fuploads%2Fgit-blob-e8fa301af206b471ad301c39a14a543ccde60069%2Fimage%20(390).png?alt=media" alt=""><figcaption></figcaption></figure></div>

8. **Clear the existing configuration on the Mikrotik as shown in the image.**

<div data-full-width="true"><figure><img src="https://2507662344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBkKbWLZfasd8l3v8ndZ%2Fuploads%2Fgit-blob-71b8ebaf3ce97141d60f0dc115965481362ce9be%2Fimage%20(391).png?alt=media" alt=""><figcaption></figcaption></figure></div>

9. **Open microtikScript.txt with notepad++, select all, then copy and paste it into the Winbox terminal.**

<div data-full-width="true"><figure><img src="https://2507662344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBkKbWLZfasd8l3v8ndZ%2Fuploads%2Fgit-blob-8a3b76cd303fcb0191e929796c4abce76830a44f%2Fimage%20(393).png?alt=media" alt=""><figcaption></figcaption></figure></div>

**When finished, take the MAC address from menu System > Identity and add it in the SEARA web portal.** [**How-to**](broken://pages/nMR0CruRVaUL4aOwQMZK)
