電訊茶室's Archiver

tomleehk 發表於 2014-5-19 18:39

Auto Wireless MAC/WAN address changer

[i=s] 本帖最後由 tomleehk 於 2014-6-11 01:28 編輯 [/i]

Auto Wireless MAC/WAN address changer

This script will change your Wireless MAC address to a random value, then it will apply it to the system and restart the interfaces.[code]#!/bin/ash
MAC=`(date; cat /proc/interrupts) | md5sum | sed -r 's/^(.{10}).*$/\1/; s/([0-9a-f]{2})/\1:/g; s/:$//;'`
echo "00:${MAC}"
nvram set wl0_hwaddr="00:${MAC}"
nvram set def_whwaddr="00:${MAC}"
nvram set def_hwaddr="00:${MAC}"
nvram commit
stopservice wan
startservice wan[/code]The 2 lines of script below is to apply the change immdiately and yet it may have some problem on connection via WIFI afterwards.[code]stopservice wan
startservice wan[/code]Just in case it happens, just remove these 2 lines from the script and let new new MAC address apply after reboot.

頁: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.