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.
??? 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.
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.
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…
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.