Community discussions

MikroTik App
 
zatara
newbie
Topic Author
Posts: 25
Joined: Sat Oct 17, 2009 10:37 am

Question with hotspot and mac authentication

Sat Nov 20, 2010 8:54 am

I have a setup where I have 3 Mikrotik Hotspots setup on RB411s. I am using the IP Hotspot and each device is acting as the server and authentication hub. I am only using a single user that I am allowing to login about 30 time simultaneous. So that way I don't have to setup individual rules. Mostly I am using it for rate limiting. I am using http chap and cookie login. I would like to add a script that when a user connects to the hotspot, and then logs in successfully, I add the mac address of there computer to the http bypass page.

I know how to do some of it, but I am not sure how to get the MAC address of the client who is logged. in.

I can can the mac-address to the /ip hotspot ip-binding list and choose bypass. Please help me automate this process.

Thanks,

-Z
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Question with hotspot and mac authentication

Sat Nov 20, 2010 2:39 pm

The user mac address is a two-part process. You need to get the user ip address from "/ip hotspot active", then get the mac address for that ip in "/ip hotspot host" (to-address). Try this if you just need macs that are authorized:
:put [/ip hotspot host find where authorized];
This returns internal addresses (*xx,*yy, etc);
Then do a foreach loop to retrieve the mac for each entry, and check that each is bypassed.
 
zatara
newbie
Topic Author
Posts: 25
Joined: Sat Oct 17, 2009 10:37 am

Re: Question with hotspot and mac authentication

Mon Nov 29, 2010 11:11 pm

I have a working script and will post it below in case anyone else needs it:
foreach a in  [/ip hotspot host find where authorized] do={:local ln; set ln [/ip hotspot host get $a mac-address]; [ip hotspot ip-binding add mac-address=$ln type=bypassed]; }
I discovered that this script will not create duplicates, so I did not add any if statements for error checking. Thanks for your help Surfer Tim for getting me to this point!

Cheers,

-z

Who is online

Users browsing this forum: sparkus and 12 guests