I'm trying to figure out a way to invoke the "mac clone" command found under the "setup" menu in DD-WRT v24SP2. I can do it in the GUI (of course), but I want to place it in a script so that I can cron and randomize it.
Perhaps it would be best if I explained my plight? What I want to create is a script that I can run that will randomly set the MAC address of the router to get a new IP address. I've tried many different scripts , but none seem to work with my router model (Buffalo WZR-HP-G300NH). After giving up on scripts, I decided to try using the built in "MAC clone" function in the GUI; It worked like a charm. Unfortunately, I can't exactly cron the GUI, nor can I have it select the MAC randomly from the GUI.
Here is what I have to set the MAC to a random value:
MAC=`(date; cat /proc/interrupts) | md5sum | sed -r 's/^(.{10}).*$/\1/; s/([0-9a-f]{2})/\1:/g; s/:$//;'`
echo "00:${MAC}"
The echoed value is the randomly generated MAC address (it always starts with 00, I know it's bad.).
So (bad grammar), the question I have is: How do I call whatever built-in function is used to clone the MAC address using the above script?
Thanks in advance!