Netgear R6220 Mac address won't change

I usually use this script to randomise the Mac address on openwrt routers at boot. It doesn't seem to be working on my R6220. Does anyone know why it wouldn't be working? I've checked and the script is definitely enabled, I tried doing the commands manually via SSH and that didn't seem to work either

Just looked at /etc/config/network. I can see that the mac is being changed correctly for wan which is named eth0.2. But this doesn't want to change the mac address doesn't change for the lan_eth0_1_dev and wan_eth0_2_dev which have the same mac, is there a way to set these via console or is it only possible by editing the config file. I tried doing the command

uci set network.wan_eth0_2_dev.macaddr=${NEWMAC}

But that didn't change anything

config device 'lan_eth0_1_dev'
        option name 'eth0.1'
        option macaddr 'xx:xx:xx:xx:xx:xx'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'
        option macaddr 'xx:xx:xx:xx:xx:xx'

config device 'wan_eth0_2_dev'
        option name 'eth0.2'
        option macaddr 'xx:xx:xx:xx:xx:xx'

Oh actually that did work working script for this device is

#!/bin/sh /etc/rc.common


start() {
 NEWMAC=$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')
  uci set network.wan.macaddr=${NEWMAC}
  uci set network.wan_eth0_2_dev.macaddr=${NEWMAC}
  uci set network.lan_eth0_1_dev.macaddr=${NEWMAC}
  uci commit network

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.