I just managed to set ethernet MAC with rc.local
by writing the following into /etc/rc.local
,
#!/bin/sh
ifconfig eth0 down
ifconfig eth0 hw ether 00:xx:xx:xx:xx:xx
ifconfig eth0 up
Remember to replace with your MAC to be fixed and to make sure rc.local service is up with the commands below.
chmod +x /etc/rc.local
systemctl start rc.local
systemctl enable rc.local
systemctl status rc.local
reboot
If it doesn't work, check the service status with systemctl
to see what went wrong.