MikroTik Integration
Integrating Captivo with MikroTik Hotspot (PAP & CHAP)
Two ways to do each step: the WinBox GUI (screenshots) or the terminal/CLI (command blocks). Both produce the same result — use whichever you prefer.
1Create the Hotspot
If you don't have a hotspot yet, run the Hotspot Setup wizard (WinBox → IP → Hotspot → Servers → Hotspot Setup) and pick your guest-facing interface/bridge — not the WAN. It creates the hotspot server, address pool and default profile.
CLI alternative:
# interactive wizard (asks for interface, address pool, DNS…) /ip hotspot setup
2Define Captivo RADIUS on MikroTik
Add the Captivo RADIUS server and enable it for the hotspot service. The MikroTik router must also be registered as a NAS client on the Captivo side (IP + shared secret).
/radius add service=hotspot address=<RADIUS_IP> secret=<SECRET>
3Hotspot profile: RADIUS + PAP/CHAP
/ip hotspot profile set <profile> use-radius=yes login-by=http-pap # CHAP instead/also: login-by=http-chap (or http-pap,http-chap)
Speed limits work out of the box: when a speed limit is set on the guest profile, Captivo sends both WISPr (for pfSense) and Mikrotik-Rate-Limit side by side, and each NAS reads the one it understands.
4Walled Garden (important)
An unauthenticated guest must be able to reach Captivo and your SMS/email provider; otherwise the portal can't load the logo or verify the code.
/ip hotspot walled-garden add dst-host=*.captivo.io action=allow # *.captivo.io covers app.captivo.io (wildcard supported) # + your SMS / email provider domains
5Download and upload the portal template
- In Captivo go to Settings → Portal → Templates → MikroTik and download the ZIP.
- The ZIP contains
login.html+alogin.html. - In WinBox/WebFig open Files and upload them into the router's hotspot
html-directory(defaultflash/hotspot), replacing the existing files. Keep the other default pages (status/logout/error).
This step is GUI/FTP only — there's no practical CLI for uploading the files. Use Files (drag & drop) or FTP.
How it works
The guest connects and MikroTik shows login.html. The guest enters their phone/email, the portal JS verifies it against the Captivo API, then fills a hidden form (username/password/dst=$(link-orig)) and posts it to $(link-login-only). MikroTik authenticates via RADIUS, accepts, shows alogin.html and redirects to the original page.
NAS-Identifier (optional extra isolation)
Optional. If you enable NAS-Identifier Verification in Captivo (Settings → RADIUS), the router must send that exact value. On RouterOS the NAS-Identifier attribute is the router's system identity name — so you set it by changing the identity:
- In Captivo go to Settings → RADIUS → NAS-Identifier, generate and copy the value.
- On the router, set the system identity to that value:
/system identity set name=<NAS-Identifier>
For product-wide problems: The portal does not open · Sign-in is rejected · Sessions do not appear