Mikrotik Hotspot User auto login-by MAC with redirection using Radius Manager

Task:

Enable selected users Auto login to mikrotik hotspot system without letting them seeing login page, using ‘mac login’ feature in mikrotik hotspot while applying selected user profile as well, or As assigned in radius manager billing system. [freeradius base]


Mikrotik Section:

Goto IP / Hotspot / Server Profile, select your HS server profile,
Goto LOGIN, and select LOGIN by MAC.
As showed in the image below …
mikrotik-login-by-mac
.
Now goto FILES / and download login.html from hotspot folder to your desktop.
As showed in the image below …
hotspot login
Open this login.html it in any html editor or notepad, and add following text in start.
1
2
3
4
5
6
7
8
9
<span style="line-height: 1.5;"><html><head></span>
 
<meta http-equiv="refresh" content="0; url=http://www.google.com">
 
<meta http-equiv="pragma" content="no-cache">
 
<meta http-equiv="expires" content="-1">
 
</head><body></body></html>
As showed in the image below …
login.html-editing
Save and upload it back to the mikrotik hotspot folder.
Mikrotik Section Done. moving to Radius Manager Section


Radius Manager Section

Connect to Radius Manager by ssh/putty
Edit RM system_cfg.php configuration  file by
(for centos you may change path to /var/www/html/radiusmanager/config)
1
nano /var/www/radiusmanager/config/system_cfg.php
search for “define(‘min_pswhsmac_len’, 4);”
and change it to
define(‘min_pswhsmac_len’, 0);
Save and exit.
As showed in the image below …
password-mac-0



Create NEW USER in RM ACP >
Now create new user in RM users, and select MAC and enter mac address in 00:00:00 format and save.
As showed in the image below …

new-user-in-rm-by-mac
new-user-in-rm-by-mac 2

TESTING Section:

From test PC, try to browse any web site, User will auto login by hotspot and will be redirected to google.com ( or any site mentioned in login.thml , i choose status page)
As showed here in mikrotik log window …

loggedin


oneline


successfull login

Latest
Previous
Next Post »