Community discussions

MikroTik App
 
eldoncito2019
Member
Member
Topic Author
Posts: 333
Joined: Fri Jun 14, 2019 1:07 pm

Enable MAC ADDRESS in IP BINDING

Fri Sep 02, 2022 4:31 pm

This script did it for my REXTENDEX
/ip hotspot
:foreach item in=[host find] do={
    :local mac [host get $item mac-address]
    :local svr [host get $item server]
    ip-binding
    :if ([:len [find where mac-address=$mac and server=$svr]] = 0) do={
        add mac-address=$mac server=$svr type=blocked disabled=yes
    }
}

and disables the mac address 11:22:33:00:aa:bb, I need that same mac address, when I provide the hotspot username and password to the client and he enters them in the captive portal, that mac address remains enabled. Thanks for your valuable help.


EL DONCITO.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Enable MAC ADDRESS in IP BINDING

Fri Sep 02, 2022 8:36 pm

??? i do not understand, and what if I have barely understanded can't be done.

If you want add the mac-address enabled and work, instead of disabled and blocked, simply change "type=blocked disabled=yes" to "type=bypassed disabled=no" on script.
But on that way everyone spoof that MAC can work free without captive portal & co.
 
eldoncito2019
Member
Member
Topic Author
Posts: 333
Joined: Fri Jun 14, 2019 1:07 pm

Re: Enable MAC ADDRESS in IP BINDING

Fri Sep 02, 2022 8:58 pm

What I want to do is that if with your script I have the following mac XX:XX:XX:XX:XX:XX disabled, because the client may be circumventing the captive portal, when he contracts my hotspot and connects with that mac the script enable the mac XX:XX:XX:XX:XX, do you understand me?



EL DONCITO.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Enable MAC ADDRESS in IP BINDING

Sat Sep 03, 2022 2:31 am

Is like the first time login, the device is forever enabled, and never need the captive portal again, right?

This time yes, I have understanded, but I do not find any idea on how to do that...
 
eldoncito2019
Member
Member
Topic Author
Posts: 333
Joined: Fri Jun 14, 2019 1:07 pm

Re: Enable MAC ADDRESS in IP BINDING

Sat Sep 03, 2022 7:03 pm

I have this:
/ip dhcp-server
:foreach item in=[lease find] do={
    :local mac [lease get $item mac-address]
    /ip hotspot ip-binding
    :if ([:len [find where mac-address=$mac]] = 1) do={
        /ip hotspot ip-binding disable [find mac-address="$mac"]
    }
}



EL DONCITO.

Who is online

Users browsing this forum: No registered users and 15 guests