Skip to content
RemoteMikroTik

Ahmad Foysal · · 3 min read

Connect Mikhmon to a MikroTik That Has No Public IP

Hotspot managers like Mikhmon talk to the router through the RouterOS API. When the line has no public IP, the API is unreachable. This is how to fix that without a VPN server.

Mikhmon is a popular way to sell hotspot vouchers on MikroTik. It runs on a PC, a phone or web hosting and talks to the router through the RouterOS API, usually port 8728.

That works on the local network. It stops working when Mikhmon runs somewhere else and the router's line has no public IP. That is common with 4G/5G, Starlink and many broadband lines behind CGNAT. Mikhmon then shows a connection error, and port forwarding does not help.

Why Mikhmon cannot reach the router

Mikhmon has to connect to the router. On a CGNAT line, connections from the internet stop at the ISP and never reach your MikroTik. You can confirm it in one minute.

The usual workarounds:

  • Buy a public IP from the ISP, if they sell one. It costs extra every month, and it is often impossible on mobile or satellite lines.
  • Run Mikhmon on a PC at the site. Then you can only sell vouchers while that PC is on and you are on that network.
  • Rent a VPS and build a VPN from the router to it. It works, but now you maintain a server.

The simple way: give the router a fixed API address

RemoteMikroTik makes the router dial out to our server over an encrypted SSTP tunnel on TCP 443, which CGNAT does not block. Each router then gets fixed public addresses on our server:

Service Example address
Winbox vpn1.remotemikrotik.com:1002
WebFig vpn1.remotemikrotik.com:4002
API vpn1.remotemikrotik.com:7002

Mikhmon uses the API address. It never changes, even when the SIM or ISP gives the router a new IP.

Set it up

1. Add the router to RemoteMikroTik

Create an account at https://remotemikrotik.com, choose Routers → Add router, and paste the setup script into the MikroTik's terminal. If the API service is off, the script turns it on for the tunnel only. Step by step.

The API port is on Standard and Pro. Choose one of those for this router, or upgrade later.

2. Make a router user for Mikhmon

Do not use your main admin login in a tool that stores the password. Make a separate user for Mikhmon:

/user add name=mikhmon group=full password=CHANGE-THIS-PASSWORD

If you prefer a group with fewer rights, it must include at least api, read and write. Check Mikhmon's own guide for what your version needs.

3. Add the router in Mikhmon

In Mikhmon, add a new router session:

  • IP MikroTik: the API address from the router's page in the panel, with the port, for example vpn1.remotemikrotik.com:7002
  • Username / Password: the user from step 2
  • Hotspot name, DNS name, currency: as before

Save and connect. The dashboard should show the router's hotspot users and resources.

Keep it safe

The API address can be reached from the internet, so:

What else you get

  • Winbox from anywhere with the Winbox address, for anything Mikhmon cannot do.
  • Voucher reset from Telegram for customers who changed their phone (Pro). See voucher not working on a new phone.
  • Offline alerts on Telegram when a hotspot router has been down for 10 minutes (Pro).

Next steps

Common questions

Which plan do I need for Mikhmon?

Mikhmon needs the API port, which is on Standard and Pro. The Free plan gives Winbox only.

Can I connect several routers to one Mikhmon?

Yes. Each router in RemoteMikroTik gets its own API address and port. Add each one as a separate router session in Mikhmon.

Does it work for other hotspot or billing software?

Yes. Anything that connects with the RouterOS API using a host and a port can use the same address. Software that needs RADIUS traffic from the router to a server is a different case: that goes out from the router and usually works without this.

Mikhmon says it cannot connect.

Check that the router shows Online in the panel, that you typed the port, that the API service is on (/ip service print), and that the user has API rights. Then try the same host and port with another API tool to see whether the problem is the address or the Mikhmon setup.