MikroTik
MikroTik routers connect with one command. Afterwards the router fetches each paid purchase from Tuvorlink within seconds, logs customers in without a code, applies the package's time, data and speed limits (and fair usage), and removes users when their time is up.
What you need
- A MikroTik router with RouterOS v6.43 or newer (v7 recommended).
- The internet (Starlink or your ISP's router) plugged into ether1.
- WinBox (from mikrotik.com/download) or any terminal to the router.
Connect it
In your dashboard: Hotspots › Add hotspot, device MikroTik, then Router setup. It takes two steps.
Step 1: Router & ports. Choose how the router is set up:
- Existing router (connect only): its settings are kept. If it has no hotspot, one is added on its LAN bridge.
- New or reset router (full setup): for a new router, one reset to its default configuration, or one that was in bridge mode behind another router. Tuvorlink builds the whole network. Choose:
- Hotspot ports: where customers plug in or connect access points (ether1 is always the internet).
- Your own network (LAN) ports: for your laptop, CCTV or till, outside the hotspot.
- Whether the router's own Wi-Fi is part of the hotspot, and its Wi-Fi name (your business name unless you change it). The Wi-Fi becomes an open network with that name: customers join without a password and get the login page.
- The time zone, and how many customers at the busiest time (this sizes the customers' network).
Leave Stop customers sharing their connection ticked unless you want phones to be able to share your Wi-Fi onward. Then click Continue to command.
Step 2: Command. Click Copy command, open New Terminal in WinBox, paste and press Enter. It looks like this (first it gets the router internet on ether1 if it has none; if that step fails, the download still runs):
:do { :if (…no internet…) do={ /ip dhcp-client add interface=ether1 … } } on-error={}; /tool fetch url="https://tuvorlink.com/i/…" dst-path=tuvorlink-setup.rsc; :delay 2s; /import file-name=tuvorlink-setup.rsc; /file remove tuvorlink-setup.rsc
It finishes in 10 to 30 seconds with Tuvorlink: connected. The Router status check under the command checks every 5 seconds (or press Check now) and changes to Connected by itself, then the page shows the router's hotspot: Hotspot running on bridge · 3 devices logged in.
The command works once and for one hour. If it expires, click New command. Change the setup goes back to step 1.
After paying: automatic login or a code
By default the phone that paid is logged in by itself: the customer never sees a code. If you'd rather customers keep a code (to log in again on another device, or because you also sell printed vouchers), open Hotspots › Change and under After paying choose:
- Log the device in by itself: no code to type (the default), or
- Show the code, and send it by SMS: after paying, the customer sees their code with a Log in with this code button, can have it texted to them, and the Wi-Fi page shows Have a code? Log in at the top.
Either way the router applies the package's time, data, speed and devices.
"Not allowed by device-mode"?
New MikroTiks on RouterOS 7 lock downloads and scripts until someone with the router in hand unlocks them. If the command answers not allowed by device-mode:
- Paste
/system/device-mode/update mode=advancedin the terminal. - Within 5 minutes, unplug the router's power for 10 seconds (or briefly press its reset button), then plug it back in.
- Run the install command again (get a new one if it expired).
What it does on the router
Every install, both kinds:
- Gets internet on ether1 first if the router has none (a DHCP client), and sets the router's clock (time zone and NTP): secure downloads fail on a router whose date is wrong.
- Names the router after your business (WinBox's title bar shows it), and labels everything it adds Tuvorlink: the
tuvorlink-syncandtuvorlink-reportscripts, thetuvorlinkpages folder, the walled-garden entry, the hotspot users of paid purchases. - Two scheduled scripts: one fetches new purchases every 10 seconds (and tells your dashboard whether the hotspot is running), one reports every minute: each purchase's time and data (including the session still going on), the router's health and who is online.
- Speed profiles for your packages, named
tuvorlink-<number>(andtuvorlink-<number>-fupfor the fair-usage speed). - Walled-garden entries so customers can reach Tuvorlink and pay before they're online.
- Makes the hotspot work on its bridge: hardware offloading off on the bridge's ports (otherwise the switch chip passes customers' traffic without the hotspot seeing it), bridged traffic through the firewall, and the bridge in the LAN list so the default firewall lets its DHCP and DNS through.
- Keeps customers logged in while their phone sleeps (no idle timeout) and clears devices stuck half-way through logging in.
- With Stop customers sharing ticked: a firewall rule so a customer's phone can't pass your Wi-Fi on.
Full setup (new or reset router) also builds the network on the ports chosen in step 1, in the background so your own connection dropping doesn't stop it:
| Port | Use | Addresses |
|---|---|---|
| ether1 | Internet (Starlink or ISP router) | from your internet |
| the hotspot ports (ether2–ether4 unless you chose others), and the Wi-Fi if chosen (open, with the Wi-Fi name you chose) | Customers, behind the hotspot | 10.20.0.x |
| the LAN ports (ether5 unless you chose others) | Your own devices (outside the hotspot) | 10.30.0.x |
Ports your router doesn't have are skipped, and ports in neither list are left as they are. Plug your laptop into a LAN port to manage the router; with none, manage it with WinBox by its MAC address.
Your original hotspot pages folder is kept: to go back, set the hotspot profile's HTML directory to it again. Users you create yourself are never touched. The router only ever reads data from Tuvorlink after installation; it never runs scripts from it.
More Wi-Fi: access points
To cover a bigger area, add access points (Ruijie / Reyee, TP-Link, Ubiquiti, Tenda and others) behind your MikroTik. Customers on them get the same login page and packages, and phones move between them without paying again.
- Cable the access point to a hotspot port (ether2–ether4 unless you chose others). With a PoE adapter: the adapter's LAN socket goes to the MikroTik, its PoE socket to the access point. The port's light comes on when the cable works.
- Set it up as a plain access point: its internet (WAN) by DHCP, and no DHCP server, router mode or login page (captive portal, Wi-Fi auth) of its own. The MikroTik hands out the addresses and shows the login page.
- Give its Wi-Fi the same name as the MikroTik's (the Wi-Fi name from step 1: your business name unless you changed it), open (no password), on both bands. With one name everywhere, phones join whichever is nearest.
- Let the access point itself through: on your dashboard, IP binding › Add, with its MAC address (on its label), limits Custom, no speed and no days. It can then reach its own cloud (Ruijie Cloud, Omada and so on) for updates and management. Customers on it still log in and pay.
Two mistakes cost you money:
- An access point on ether1 or a LAN port (ether5). On a LAN port everyone on it gets internet without paying.
- An access point linked to the MikroTik over Wi-Fi (repeater, wireless bridge, or mesh with the MikroTik). All phones behind it then look like one device to the MikroTik, so one payment unlocks all of them. Always use a cable.
Example: a Ruijie / Reyee access point
- Reset it (hold the reset button for about 10 seconds), join its Wi-Fi @Ruijie-s… and open
https://192.168.120.1. Accept the browser's certificate warning and set the admin password it asks for. - In the setup wizard: Internet: DHCP, SSID: your Wi-Fi name, Security: Open, Country/Region: Ghana, time zone Africa/Accra. Changing the country can reset the SSID: check it before Next. If it warns WAN port is not connected, close the warning; don't choose Wireless Repeater.
- Name the project and click Create Network & Connect. Skip binding it to Ruijie Cloud unless you use it.
- Cable it to a hotspot port and add it under IP binding. To change its Wi-Fi name later, open its address (WinBox: IP › DHCP Server › Leases, host name
RAP…orEAP…) and go to Workspace › Wi-Fi › Edit.
On your dashboard
MikroTik routers also give you Active users (who is online, with Disconnect), Network status (online, outages, CPU and memory), Vouchers to print and sell for cash, IP binding, Pause internet and Policies (block sites): see Your dashboard. Routers installed with an older script show "needs the new install command" on those pages until you run it again.
Troubleshooting
| Problem | What to do |
|---|---|
not allowed by device-mode |
See "Not allowed by device-mode"? above. |
STOPPED. Couldn't download the login page |
The router has no internet or DNS: plug the internet into ether1, test with /ping tuvorlink.com, then run a new command. |
| Setup page stays on "Waiting for the router" | The command didn't run: paste it again (each command works once; get a new one if it already ran). |
| Dashboard says no hotspot running | Get a new command and run it: it creates the hotspot, or prints why it can't. If it says the router has no DHCP server of its own, choose New or reset router and run again. |
| Customers join the Wi-Fi but get no address | The bridge isn't in the LAN list or the hotspot sits on a single port: running the command again fixes both. |
| Customers get an address but no login page | Check IP › Hotspot › Servers: the hotspot must be on the bridge (not on ether2 or wlan1 alone), and Server Profiles › HTML directory should be tuvorlink (or flash/tuvorlink). |
| Router shows Offline on the dashboard | It hasn't checked in for a few minutes: check its internet. See its log with /log print where message~"Tuvorlink". |
| "Router script out of date", or "needs the new install command" | Get a new command and run it: routers keep their old setup until you do. |
| A disconnected device is back online | It still had time on its purchase and logged in again. Devices only stay off once their purchase ends. |
| A customer's TV can't get online | TVs can't open the Wi-Fi page: the customer adds it by its MAC address on their payment page (Using it on a TV?, packages for more than one device, router script from version 9). See What customers see. |
| A TV added by a customer stays offline | Its MAC address must be the one it uses on your Wi-Fi (turn off its "private"/"random" MAC), and the purchase must have a device free: the TV gets in once one is. |
| Phones on an access point get internet without paying | The access point is on a LAN port (ether5): move its cable to a hotspot port. |
| Phones on an access point get no address | Its cable to the MikroTik isn't working (the port's light is off: check the PoE adapter's LAN and PoE sockets), or it's in router mode: set it to access point with DHCP. |
| An access point shows offline in its own cloud | Add its MAC address under IP binding. |
Can't run commands?
Under Router setup › Or paste the full setup script you get the whole script to paste instead, for routers that can't download files.