This script changes the MAC address on OpenWrt on any specified (v)NIC interface. Change th OUI of the MAC address in line 13 to a legitmate NIC vendor for RFC and IEEE compliancy. The 802.1X authentication server might have a validator in place to check spoofed MAC addresses against the above IEEE database.
Read this blog post for more information.
Install MAC address changer script:
Initialize on startup:
$ chmod +x /etc/init.d/mac-change.sh
$ /etc/init.d/mac-change.sh enable
Verify:
$ /etc/init.d/mac-change.sh enabled && echo on
on
Edit /etc/rc.local
to execute on startup in case the init is too slow:
$ vi /etc/rc.local
/etc/init.d/mac-change.sh start
exit 0
Use the logread
command to for debugging and troubleshooting the script. More info on init scripts.
Leverage the crontab
utilty if you want to change your MAC address every 3 hours:
$ /etc/init.d/cron start
$ /etc/init.d/cron enable
$ crontab -e
* 3 * * * /etc/init.d/mac-change.sh start
Verify:
$ crontab -l
* 3 * * * /etc/init.d/mac-change.sh start
Berkeley Software Distribution (BSD)
Jeroen van Kessel | cryptsus.com - we craft cyber security solutions