I have seen this question asked here several times with an answer of it can be scripted.
Can anyone asist in helping the community get this created as its been asked for a number of years.
This is what this device is really perfect for but yet it doesn’t exist yet in an easy to use form.
I don’t have the complete skill set to make it happen. Anybody willing to help out?
Yes you can use Mac Clone in UI. However that requires you to know a valid mac and also do it before connecting so that every free wifi you use won’t have your real mac evertime. It about having some anonimity with this device and having it do it automatically. You just boot up and connect to whatever wifi you wan and everything is already done for you in background automatically.
It should generate a new MAC Address on every new boot of the device. It should also have the option to do so via the web interface(or command line for advanced users via the script). A script would allow the user to decide when and how they want to utilize it. So if they want to schedule a cron job or if they want to manual run it or if they just want to set it on boot. Like on a pc you just have a script that changes hostname and mac address if you wish to do so(just load a dictionary file that it can pull random names from).
Is this possible to just build in so that people can’t screw up the device or can we work to create the scripts in this thread together so that people can use that may want it in the future.
It appears that this really needs done as an example the conference I am at the knocked down hotspots. This now doesn’t allow me to connect with the device as the MAC address has been blocked from making connection so I can’t even use it as a repeart with the LAN side connected because it keeps getting dropped everytime it connects.
I just copied from the openwrt-wan-mac script
Originally it is used to change wan mac. I modified it to change wifi repeater mac. Does it work for you?
#!/bin/sh /etc/rc.common
START=17
start() {
OLDMAC=$(uci get wireless.sta.macaddr)
logger "[WAN-MAC] Old WAN MAC address is ${OLDMAC}."
NEWMAC=$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/')
logger "[WAN-MAC] Applying new random MAC address to WAN (${NEWMAC})..."
uci set wireless.sta.macaddr=${NEWMAC}
uci commit network
}
I’ve been looking for pretty much the same thing as the OP and am happy that a thread for this exists. Please allow me to revive this discussion.
I can’t write script myself and was wondering if and how the mac-changer-script could be modified so that a prefered vendor prefix (first 6 digits) could be set in the script and only the last 6 digits would be randomized.
My plan is to have the mac addresses for WAN, LAN, WIFI, as well as the hostname randomized at boot. Would it make sense to have 4 seperate scripts or a single script to achieve all 4?
#!/bin/sh /etc/rc.common
START=17
start() {
OLDMAC=$(uci get wireless.sta.macaddr)
logger "[WIFI-MAC] Old WIFI MAC address is ${OLDMAC}."
NEWMAC=echo 00:11:22:$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3'/)
logger "[WIFI-MAC] Applying new random MAC address to WIFI (${NEWMAC})..."
uci set wireless.sta.macaddr=${NEWMAC}
uci commit network
}
I added the snippet to the existing script from earlier in this thread. Is this correct?
Can you help me to combine all 4 (Wireless,Ethernet,WAN & Host) into a single script?
#!/bin/sh /etc/rc.common
START=17
start() {
OLDMAC=$(uci get wireless.sta.macaddr)
logger "[WIFI-MAC] Old WIFI MAC address is ${OLDMAC}."
NEWMAC=$(echo 00:11:22:$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3'/))
logger "[WIFI-MAC] Applying new random MAC address to WIFI (${NEWMAC})..."
uci set wireless.sta.macaddr=${NEWMAC}
uci commit network
}