Community discussions

 
looki83
just joined
Topic Author
Posts: 6
Joined: Tue Jan 29, 2013 8:04 pm
Location: Poland

Ip hotspot active user = Ip Bindings

Tue Jan 29, 2013 8:37 pm

Hi

I need a script that will make possible to resolve below problem

IP HOTSPOT ACTIVCE USER -> IP BINDINGS


If the user log in correctly with correct log in and a password in the hotspot HTML
it will automatically be transfered in IP BINDINGS place with the same address IP and address mac

heellllp me :)
 
User avatar
dasiu
Trainer
Trainer
Posts: 232
Joined: Fri Jan 30, 2009 11:41 am
Location: Reading, UK
Contact:

Re: Ip hotspot active user = Ip Bindings

Wed Jan 30, 2013 1:09 am

:foreach user in=[/ip hotspot active find] do={
    :local ip [/ip hotspot active get $user address];
    :local mac [/ip hotspot active get $user mac-address];
    :local username [/ip hotspot active get $user user];
    :foreach binding in=[/ip hotspot ip-binding find address=$ip] do={
        /ip hotspot ip-binding remove $binding;
        }
    /ip hotspot ip-binding add type=bypassed mac-address=$mac address=$ip comment=$username;
}
But you need to make sure, that DHCP server will give user the same IP all the time, otherwise he will be asked for password again if the IP changes.
 
looki83
just joined
Topic Author
Posts: 6
Joined: Tue Jan 29, 2013 8:04 pm
Location: Poland

Re: Ip hotspot active user = Ip Bindings

Wed Jan 30, 2013 1:32 am

You are crazy..... Thanks Dasiu
 
dahili
just joined
Posts: 7
Joined: Sun Feb 06, 2011 5:15 pm

Re: Ip hotspot active user = Ip Bindings

Sat Aug 03, 2013 1:57 am

This version will not ask password if the ip change any ip ok for same mac

:foreach user in=[/ip hotspot active find] do={
:local ip [/ip hotspot active get $user address];
:local mac [/ip hotspot active get $user mac-address];
:local username [/ip hotspot active get $user user];
:foreach binding in=[/ip hotspot ip-binding find address=$ip] do={
/ip hotspot ip-binding remove $binding;
}
/ip hotspot ip-binding add type=bypassed mac-address=$mac address=0.0.0.0 comment=$username;
}
 
ivanRR
just joined
Posts: 1
Joined: Tue Jan 16, 2018 10:40 am

Re: Ip hotspot active user = Ip Bindings

Tue Jan 16, 2018 11:59 am

:foreach user in=[/ip hotspot active find] do={
    :local ip [/ip hotspot active get $user address];
    :local mac [/ip hotspot active get $user mac-address];
    :local username [/ip hotspot active get $user user];
    :foreach binding in=[/ip hotspot ip-binding find address=$ip] do={
        /ip hotspot ip-binding remove $binding;
        }
    /ip hotspot ip-binding add type=bypassed mac-address=$mac address=$ip comment=$username;
}
But you need to make sure, that DHCP server will give user the same IP all the time, otherwise he will be asked for password again if the IP changes.
why all of user active = ip binding. please change to only spesification user -> ip binding

thank u

Who is online

Users browsing this forum: No registered users and 10 guests