MikroTik hotspot user expiry: how to expire users by date
Last updated: 2 October 2026
A MikroTik hotspot user has limits on time online and on data, but no "valid until" date. Selling a 7-day or 30-day package therefore needs something extra. There are three ways to do it.
1. Uptime limit (not a real expiry)
/ip hotspot user add name=guest1 password=7788 limit-uptime=7dThis counts seven days of time connected. A customer who is online three hours a day would keep the login for nearly two months. It suits "5 hours of internet", not "valid for one week".
2. Scripts on the router
The usual method writes an expiry date into the user's comment at first login (a script in the profile's on-login), and runs a scheduler every few minutes that disables users whose date has passed. Free tools such as Mikhmon set this up for you.
It works, with these pitfalls:
- The router clock. If the router boots without the right time, users expire early or never. Set up time sync (System → NTP Client).
- RouterOS upgrades. RouterOS v7 writes dates differently from v6, and scripts that compare dates as text stop working after the upgrade.
- One job only. Two expiry scripts on the same router fight each other. Keep exactly one.
- Per router. Each router has its own users and its own scripts.
3. RADIUS
With RADIUS the expiry date is stored on a server, which simply refuses the login once it has passed and disconnects the open session. Nothing runs on the router, so reboots, upgrades and wrong clocks do not matter. See how RADIUS works with MikroTik.
Which to use
| You sell | Use |
|---|---|
| Hours of connected time | limit-uptime |
| Days or weeks, one router, a few users | Scripts (for example through Mikhmon) |
| Days, weeks or months with renewals, several routers or staff | RADIUS |
Where RadiusNest fits
RadiusNest stores each user's end date and counts it from first use for vouchers. Expired users are disconnected and refused automatically, renewals add time in one click, and none of it depends on scripts or the router clock.
Start the free trial See pricing
Questions and answers
Does limit-uptime count calendar days?
No. It counts time connected. Seven days of uptime can last many weeks of real time.
Why did my expiry scripts stop working after upgrading to RouterOS v7?
v7 changed the format of dates. Scripts that read or compare the old format need to be rewritten for the new one.
Can a user expire while still online?
With scripts, only when the scheduler next runs and removes the active session. With RADIUS the session is disconnected when the package ends.