is it possible, to trigger an event, e.g. wol packet, when accessing a port on a specific IP address through the Mikrotik router?
Following situation:
I have a server that is offline most the time. On this server there’s a software installed (SubSonic Music Server Software) that listens on port 4040.
I connect with my iPhone to my home network via VPN and start the app iSub to connec to port 4040 of my server.
This port access to the ip of the server should trigger, that the Mikrotik sends a wol packet to the MAC address and wake him up.
I hope I have described my problem accurately!
I connect to my network via VPN through Mikrotik router. This shouldn’t trigger the wol.
Only when I start an app on my iphone that connects to an LAN-IP (my server, it’s offline at this moment) on port 4040 (LAN is connected to Mikrotik) then the wol packet should be send to the specific MAC.
you can create firewall rule for those packets, and in script, periodically check whether packet count is non-zero. if it’s not - send WoL and reset packet counter
how can I check in the script if host is online and then exit the script directly without sending wol packet ??
After the host is waked up, the packet count will always increase, because I access my application on port 4040.
(The Mikrotik sends wol packets though the host is up and running)
Reviving this old thread to ask a follow-on question. While the firewall rule works fine for WAN traffic. Is there a way to trigger the script for LAN connected devices traffic?