Auto Random MAC Address and renew WAN IP address
本帖最後由 tomleehk 於 2014-5-14 22:57 編輯
This script will change your eth1 MAC address to a random address, then it will apply it to the system and restart the interfaces.- #!/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
複製代碼 Save the script as the startup scrupt
1. Using the Web Interface, goto the Administration tab.
2. If available, go to the Command subtab, otherwise go to the diagnostics subtab.
3. Type the commands you wish to run every startup into the Commands: dialog box (place each command on a newline using the enter key, and if the command isn't something that stops running after a moment, put a '&' after the command)
4. Click the Save Startup button at the bottom of the page if you'd like the commands to save into the rc_startup variable (you may need to scroll). Save Firewall will save the commands into the rc_firewall variable. |