This assign random MAC addressses avoiding 0 and F for skip all particular circumstances.
289.254.654.976 possible values.
Curiosity:
However remote, there is always the possibility that different interfaces on different AP take the same value…
or that the random MAC is identical to the device that want to connect…
and yes, [$num2hex] can be raplaced with [:rndstr from=“123456789ABCDE” length=2]) as @rextended suggested above, will change that…
It randomizes 2-4 octets (:foreach i in={1;2;3} do={…) from current wifi mac address (BSSID) and ensures that all new generated macs are unique, last 2 octets I’m using for personal tracking, it can be easily changed which octets to randomize in mentioned :foreach loop.
Added 2 schedulers to execute this script, on startup (with 5s delay before script execution) and each day at night time.
Edit: updated script with [:rndstr …] to generate random octet.
Edit2: removed wifi enabled status toggle on bssid change
Not using CAPsMAN, but it think it is more complex than just set random mac on CAP device, I think script executed on CAP will need also to update new mac on CAPsMAN device, over API for eg. Also maybe better solution will be to run script on CAPsMAN which will randomize macs for each CAP client and update wifi mac on CAP over API, anyway different script needs to be made for CAPsMAN.
(Not tested on capsman) On interfaces is not needed at all to disable and enable the interface, is automatic when change anything on wifi (also comment…)
I’m disabling wifi interface to force clients to disconnect when bssid is changed, but I will check how client behaves when bssid is changed while connected…