I have a NAS in my network, that should be accessible from my LAN and over VPN connections.
To save some power, my NAS shuts down after some time.
I want the routerboard to send a WOL-Packet, when I access the IP of the NAS.
My Idea was to run a script on a new connection over the firewall to the NAS but I found no way of doing this.
The other problem is, that as the NAS is on the same Local Network not alle connections run over the Router - so my second Idea was to do some kind of Port Knocking on the router to run the script.
I think I heard that you can make a script run when a DHCP server leases out an IP address?
If that is true, you could simply make that the trigger for the router to send out the magic-packet.
You mean everytime when new machine is powered on, DHCP server (mikrotik) serves the IP to DHCP client, and then in the same time WoL script is run. Correct?