Should I just update the /etc/runoam.sh to set the macaddr variable to required MAC value, instead of output of "flash get ELAN_MAC_ADDR | sed 's/ELAN_MAC_ADDR=//g'" and reboot?oh, if you have ssh, do you have full access to the router? i have looked a bit at the firmware and it appears the mac addresses are set by /etc/runoam.sh during boot. it gets the addresses from nv memory (some mtd partition). it reads mac address by cmd "flash get ELAN_MAC_ADDR". the best thing to temporarily set mac may be to copy commands from runoam.sh except the last line (which executes the cmd) and type "echo $exeCmd" which will display the command which would be executed to set the mac addr. in that change to your desired mac.
Code:
#!/bin/sh
exeCmd="eponoamd "
i=0
result=`flash get EPON_LLID_TBL.$i | grep 'fail'`
if [ "result" != "" ]
then
macaddr=`flash get ELAN_MAC_ADDR | sed 's/ELAN_MAC_ADDR=//g'`
exeCmd=$exeCmd" -mac "$i" "$macaddr" "
i=$((i+1))
result=`flash get EPON_LLID_TBL.$i | grep 'fail'`
fi
while [ "$result" == "" ]
do
macaddr=`flash get EPON_LLID_TBL.$i | sed 's/macAddr=//g'`
macaddr0=`echo $macaddr | sed 's/:[0-9a-fA-F]*:[0-9a-fA-F]*:://g'`
macaddr1=`echo $macaddr | sed 's/:[0-9a-fA-F]*:://g' | sed 's/[0-9a-fA-F]*://g'`
macaddr2=`echo $macaddr | sed 's/^[0-9a-fA-F]*:[0-9a-fA-F]*://g' | sed 's/:://g'`
macaddr0=`echo "0x"$macaddr0`
macaddr1=`echo "0x"$macaddr1`
macaddr2=`echo "0x"$macaddr2`
macaddr=`printf %04x%04x%04x $macaddr0 $macaddr1 $macaddr2`
exeCmd=$exeCmd"-mac "$i" "$macaddr" "
i=$((i+1))
result=`flash get EPON_LLID_TBL.$i | grep 'fail'`
done
$exeCmd &
Edit: Found that there is /var/config/lastgood_hs.xml and /var/config/lastgood_mp_hs.xml file, which has the ELAN_MAC_ADDRESS and GPON_SN. If I modify that, will that work?
Last edited: