Hm, I managed to make a script that is triggered on DHCP lease
{
:log info "DHCP trigerred";
:if ($leaseBound = 1) do={
:log info "Lease Bound";
:do {
:local Comment [/ip dhcp-server lease get value-name=comment number=[/ip dhcp-server lease find address=$leaseActIP]];
}
:local FirstByte [:pick $leaseActMAC 1 2 ];
:local FirstByteHex "0x$FirstByte";
:local FirstByteNum [:tonum $FirstByteHex];
:local StatusBytes ($FirstByteNum&0x3);
:local MessageText "IP: $leaseActIP MAC: $leaseActMAC Name: $"lease-hostname" Comment: $Comment";
log info $MessageText;
log info "First Byte: $FirstByte $FirstByteHex";
:log info $StatusBytes;
:if ($StatusBytes = 2) do={
:log info "Random MAC!!!!";
}
}
}
I guess the rest should be easy: to change lease to static, add comment and make it block access.
Ideal would be if I can inform client that he is not allowed to use random MAC but it seems quite complicated to do.