Is it possible to set up mikrotik hotspot in automatic trial mode for a cafe visitor without any authentication window, but with time limit per day (Trial Uptime Limit/Trial Uptime Reset)?
Without Javascript on the client side as possible.
Yes, you need to alter/create your own login.html that basically takes the login parameters with a meta refresh to the hotspot. Basically something like this would need to be placed inside login.html (this is part of the hotspot file system withing routeros);
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://"YOUR_ROUTER_IP/DNS"/login?username=T-$(mac-esc)&dst=http://www.google.com" />
</head>
</html>
Obviously makes sure to change “YOUR_ROUTER_IP/DNS” with the correct URL. You can change the DST after login also. You will need to ensure the trial option is checked withing the hotspot configuration also.
I recommend backing up all current files and configuration, just to be on the safe side too.
Thank You fore the quick reply. I try this one, but didn’t work - cyclic reload
For me it works this way:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://10.0.0.1/login?username=T-$(mac-esc)" />
</head>
</html>
If needed, alogin.html will provide automatic redirection to i.e. the cafe’ webpage :
modify these lines in alogin.html :
<meta http-equiv="refresh" content="2; url=YOURDESIREDURL">
location.href = unescape('YOURDESIREDURL'); ****** within single quotes*****