I setup multiple users (kids).
One is called "UnknownDevices". It is set to block all day long.
One is called "ApprovedDevices". It is set to allow all day long. All my devices are put here.
Some users for kids devices with proper block/allow times set.
Add this script. It will take any device that isn't assigned to a user and assign it to the "UnknownDevices" user.
Setup the scheduler to run the script every ?? seconds - i put 30 seconds. That means within 30 seconds, a new device will automatically get pushed to the "UnknownDevices" user and therefore be blocked. This will mean that IOS devices that change their mac address will get blocked automatically.
#log info "Checking for unknown devices...";
:foreach i in=[/ip kid-control device find user=""] do= {
:local name [/ip kid-control device get $i name];
:local mac [/ip kid-control device get $i mac-address];
#log info $i;
#log info $name;
#log info $mac;
:local dt ([/system clock get date ] . "_" . [ /system clock get time ]);
#log info $dt;
if ($name = "") do={
:set name "<Unknown>";
}
:set name "$name $dt";
log warning "** Found Unknown device $name - adding to UnknownDevices list.";
/ip kid-control device add name="$name" user="UnknownDevices" mac-address=$mac
}