1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Persistent wireless MAC

Discussion in 'Tomato Firmware' started by dasgg, Mar 7, 2012.

  1. dasgg

    dasgg Networkin' Nut Member

    Hi all

    Whenever I restart my router, the MAC reverts to the built in one. I have a WANUP script to change it back, but it takes about 3 seconds and it also broadcasts the original MAC before the script and I don't know how to fix it properly:

    ifconfig eth1 down ether {MAC}
    nvram set wl0_hwaddr={MAC}
    nvram commit

    Is there a better way to do this? Using toastman's 7496 and earlier it always reverts when I change it in the web interface. Also, is it a bug?
  2. dasgg

    dasgg Networkin' Nut Member

    Ok so the script was modified and moved to init. Seems nvram commit wasn't necessary - shaved 3 seconds off the bootup time, good. But if I do the setup before the nw is configured by the kernel (after init and before fire) then it defaults to channel 1 and it's stuck there. ie changing it in web interface does nothing, overview still shows channel 1. If the script is in fw.sh then it's fine iirc, but the radio will flash the original mac a few times before going to the new one. Here's what I am playing with from script_init.sh:

    nvram show > /tmp/home/root/nvr
    alias ro='echo '[WANUPSCR' $(cat /proc/uptime | cut -f 1 -d " ")]'
    echo $(ro) 'START'| logger
    ifconfig eth1 down hw ether $mymac
    echo $(ro) 'ifconfig eth1 down hw ether' $mymac | logger
    nvram set wl0_hwaddr=$mymac
    #nvram set wl0_channel= was already correct
    echo $(ro) 'nvram set wl0_hwaddr='$mymac | logger
    ifconfig eth1 up
    echo $(ro) 'ifconfig eth1 up' | logger
    echo $(ro) 'FINISH' | logger


    Ok lol. as soon as I posted this someone mentioned wl.. looked it up and I just had to add this:
    wl channel 1 <-actually changes the channel (overview)
    nvram set wl0_channel=1 <-is what the basic-network.asp will show
    But at least on my router the wmac wont stick without this silly script. It seems there must be a better way!

Share This Page