Hotspot-expiration date+MAC address binding

Hi,
I have two questions regarding hotspot. When someone is connecting our hotspot, it asks him for a name and password. Name and password is prepared, but when it is used for the first time, I would like to:

  • start counting, how many days passed from the date this user was logged in for the first time (in other words, I would like to set a limit, that this user has for example 5 hours credit, but this credit is valid for 1 week or month from its first usage)
  • bind MAC address to this user (in other words, this account can be used with MAC address, which was used first time this account was used)
    Are there some examples of scripts for these issues or do you have some suggestion about proper solution?
    Thanks
    Ivan

I suggest you to try User Manager, User Manager is RADIUS based management system integrated to the RouterOS package. User Manager could be used for HotSpot client management (as well wireless, DHCP, PPP clients).
There are 5 different HotSpot login methods, and you can use some of them together. (e.g. login/password + cookie, or MAC-address, methods are described in HotSpot documentation).

  1. Using User Manager to accomplish first scenario, add uptime limit 5 hours and prepaid time 1 week. You can read User Manager documentation,
    http://wiki.mikrotik.com/wiki/User_Manager
    or search in the User Manager section in the forum.

If you will not use User Manager, then you can specify only ‘limit-uptime’, total uptime limit.

  1. Right now User Manager does not include MAC-address option per each user. But MAC-address method can be used, when client MAC-address is used as username, and client is authenticated as soon as MAC-address appeared in the host list.
    Username=MAC-address ip-address=x.x.x.x, IP address is assigned to certain client.

If you will not use User Manager, but local HotSpot authentication for login/password method (HTTP PAP/CHAP), specify for client ‘/ ip hotspot user add name=client1 mac-address=XX:XX:XX:XX:XX:XX’.

Probably exist another methods to accomplish your scenario.