9394952

导航

DD-WRT动态更新WAN口MAC

将代码在command窗口粘贴后,另存为startup,然后重启路由即可

#!/bin/ash
MAC=`(date; cat /proc/interrupts) | md5sum | sed -r 's/^(.{10}).*$/\1/; s/([0-9a-f]{2})/\1:/g; s/:$//;'`
echo "00:${MAC}"
ifconfig eth1 hw ether 00:${MAC}
nvram set def_hwaddr="00:${MAC}"
nvram set wan_hwaddr="00:${MAC}"
stopservice wan
startservice wan 

参考文档:https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=918422

posted on 2018-12-20 11:26  9394952  阅读(99)  评论(0编辑  收藏  举报