Page 1 of 1

Automatic every x minutes change Wireless AP Interface MAC Adress

Posted: Fri Sep 02, 2016 12:12 pm
by RyperX
Hey guys,

i hope you can help me. I want to create a script that change every 30 minutes the mac adress of a virtuell wireless interface
I know i can set the mac with interface wireless set profile mac-address=xx......

But how would a script looks like when i want
interface wireless set profile mac-address=1234
wait 30mins
interface wireless set profile mac-address=4321
wait 30mins
interface wireless set profile mac-address=2222
wait 30mins
start again from beginning with mac 1234

Hopefully you can help me

Re: Automatic every x minutes change Wireless AP Interface MAC Adress

Posted: Thu Sep 15, 2016 12:30 am
by raymondr15
Hey guys,

i hope you can help me. I want to create a script that change every 30 minutes the mac adress of a virtuell wireless interface
I know i can set the mac with interface wireless set profile mac-address=xx......

But how would a script looks like when i want
interface wireless set profile mac-address=1234
wait 30mins
interface wireless set profile mac-address=4321
wait 30mins
interface wireless set profile mac-address=2222
wait 30mins
start again from beginning with mac 1234

Hopefully you can help me
What is the reason you want to do this for?

Re: Automatic every x minutes change Wireless AP Interface MAC Adress

Posted: Thu Sep 15, 2016 5:35 am
by IntrusDave
Here, this will generate a new mac address. It's dirty, but it works. just set the add a command to set the mac on the interface you want, then run the script every 30 minutes.
:local hexArray 0abcdef0123456789abcdef012345abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012345
:local newMAC "";

:local hex1num [/system clock get time ];
:local hex2num [/system resource get cpu-load ];
:local rnd1num  [:pick $hex1num 6 8];
:local rnd2num  [:pick $hex2num];

:set newMAC ("D4:CA:6D:" .\
      [:tostr [:pick $hexArray ($rnd1num+$rnd2num) ]] .\
      [:tostr [:pick $hexArray ($rnd2num+4) ]] .":".\
      [:tostr [:pick $hexArray ($rnd1num+12) ]] .\
      [:tostr [:pick $hexArray ($rnd2num+1) ]] .":".\
      [:tostr [:pick $hexArray $rnd1num ]] .\
      [:tostr [:pick $hexArray ($rnd1num+$rnd2num+5) ]]  );

:log warning $newMAC;

Re: Automatic every x minutes change Wireless AP Interface MAC Adress

Posted: Mon Sep 26, 2016 11:43 am
by RyperX

What is the reason you want to do this for?
Streetpassing for 3DS
Here, this will generate a new mac address. It's dirty, but it works. just set the add a command to set the mac on the interface you want, then run the script every 30 minutes.
:local hexArray 0abcdef0123456789abcdef012345abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012345
:local newMAC "";

:local hex1num [/system clock get time ];
:local hex2num [/system resource get cpu-load ];
:local rnd1num  [:pick $hex1num 6 8];
:local rnd2num  [:pick $hex2num];

:set newMAC ("D4:CA:6D:" .\
      [:tostr [:pick $hexArray ($rnd1num+$rnd2num) ]] .\
      [:tostr [:pick $hexArray ($rnd2num+4) ]] .":".\
      [:tostr [:pick $hexArray ($rnd1num+12) ]] .\
      [:tostr [:pick $hexArray ($rnd2num+1) ]] .":".\
      [:tostr [:pick $hexArray $rnd1num ]] .\
      [:tostr [:pick $hexArray ($rnd1num+$rnd2num+5) ]]  );

:log warning $newMAC;
Thanks but its important that i can specify the needed mac adress. A random one will not work