Community discussions

MikroTik App
 
niceguy167
just joined
Topic Author
Posts: 3
Joined: Sun Mar 10, 2013 1:28 pm

Free Wifi Hotspot By Mac Address For Data Tracking

Fri Jun 17, 2016 11:18 am

So I currently have a Mikrotik router setup and it authenticates users as trail users and a script that locks down total bandwidth usage and works pretty well..... Except just recently I discovered that it tracks there web page usage only however It does not track there Video Streams, Torrents, ect.....
So what I would like is to make my login page add a user to userman by binding to there mac address and give them a download and upload limit per mac address and a bandwidth limit and free wifi for say the 5 or 6 hours then after that they get logged out and all uses are removed daily and they the next day they can use free wifi again.
Currently my login.html page does this
which is just a button that says I agree to terms and they see my terms.
Login.html
<a style="color: #FF8080; font-size: 15px;"
href="$(link-login-only)?dst=$(link-orig-esc)&username=T-$(mac-esc)">
<img alt="" src="img/agree.png" width="190" height="60" style="border-width: 0px" /></a></td>
Then I have a script that auto runs. every 5 min or so.
#Set your dowload limit in MegaBYTES!
:local downloadlimitmb "1050"
### You will not need to edit anything below this line ###
:local downloadlimit  [($downloadlimitmb  * 1048576)]
:local counter
:local datadown
:local username
:local macaddress
:foreach counter in=[/ip hotspot active find where user~"^[T][-].{17}"] do={
:set datadown [/ip hotspot active get $counter bytes-out]
:if ($datadown>$downloadlimit) do={
:set username [/ip hotspot active get $counter user]
:set macaddress [/ip hotspot active get $counter mac-address]
/ip hotspot user remove [/ip hotspot user find where name=$username profile=default]
/ip hotspot user add name=$username limit-bytes-out=$downloadlimit mac-address=$macaddress profile=default
/ip hotspot active remove $counter
:log info "Force logout on user: $username - Reached download quota"
Then I have a reboot script that reboots the router daily to clear the trial users if any are left.
Like I said this setup works great but it will not track Youtube, Netflix, Torrentz, ect....
It does track www data but that's about it.
Any help would be greatly appreciated.
Thanks
Steven
 
dana1975
Frequent Visitor
Frequent Visitor
Posts: 94
Joined: Sat Jul 04, 2009 8:32 pm

Re: Free Wifi Hotspot By Mac Address For Data Tracking

Wed Jan 31, 2018 7:47 pm

im running CAPsMAN with 8 SSID and each SSID have the different IP Range
im usung hotspot + windows AD as radidus to authenticate all users
for one SSID i need a Script, i want to users have 200M daily usage and after that they speed change to 512Kbps
thank you in advance for your help

Who is online

Users browsing this forum: No registered users and 11 guests