MikroTik routers
Connect a MikroTik hotspot to SafeNet with one script. Vouchers, customer accounts and speed limits.
Your MikroTik keeps running the hotspot, and guests see your SafeNet login page: your logo, packages bought with mobile money, and vouchers. SafeNet adds a secure VPN tunnel to the router, and the router asks SafeNet whether each code is valid, how long it lasts and how fast it may go. It works from any internet connection, even without a fixed public IP.
What you need
- A MikroTik router with RouterOS 7 (for example hAP ax lite, hAP ac², hEX with an access point).
- Winbox or the router's web page (WebFig) to open a terminal.
1. Set up the hotspot on the MikroTik
If the router already runs a hotspot, skip this. Otherwise, in Winbox: IP → Hotspot → Hotspot Setup, choose the interface guests connect to (usually the bridge or Wi-Fi), and accept the defaults. Skip creating a local hotspot user.
2. Add the router in SafeNet
- Pick the siteChoose the site in SafeNet's top bar.
- Add the routerOpen Routers (VPN), type a name (for example "Kariakoo hotspot"), choose MikroTik, and click Add router.
- Copy the scriptSafeNet shows a setup script made for this router. Click Copy script. Keep it private: it contains the router's VPN key and RADIUS secret.
3. Paste the script into the router
- Open a terminalIn Winbox or WebFig, click New Terminal.
- Paste and runPaste the whole script and press Enter. It creates the VPN tunnel, points the hotspot at SafeNet, allows one device per code, and replaces the hotspot's login page with your SafeNet page (it also lets phones reach SafeNet before they log in).
- Ran an older script before?Then the router still shows its old login page. Open the router's page in SafeNet again and run just the last four lines (under SafeNet's login page on the hotspot).
- Check the connectionRun:
A recent "last-handshake" means the tunnel works. Within a minute the router shows as Connected on SafeNet's Routers page./interface wireguard peers print
4. Test it
- Make a voucherIn SafeNet: Vouchers → Generate, one voucher for 1 hour.
- Log inJoin the hotspot Wi-Fi. Your SafeNet login page opens: open Voucher and type the code, or buy the cheapest package and enter your PIN. You're connected straight after.
- See it in SafeNetThe session appears on the Live page with its data usage.
Speed limits from your SafeNet plans are sent to the MikroTik automatically. Changes in Portal settings and Packages show on the login page straight away; nothing to update on the router.
Still the old page? Check /file print where name~"login.html" shows a new file in the hotspot folder, and that /ip hotspot walled-garden print lists radius.safezonetz.com. If the router has a custom hotspot folder (IP → Hotspot → Server Profiles → HTML Directory), the script puts the page there too.
SafeNet Setup guides