Adding Scripts to Router (WOL)


Occasional Visitor
Hello, I am trying to setup WOL to access my unraid server. I am using an app internally to turn the server on and it works perfect so WOL is setup correct and is working however when I try to do this remotely I just can't seem to get it to work. I have tried various instruction and am trying out this method at the moment. The document can be found here:

Is there a way to add this script into my router? I have ssh in but not quite sure where to enter the code. Or if anyone can guide me with a better way I am open to sugestions.

My router is ASUS AC68u running 386.5_2-gnuton0




Senior Member
... when I try to do this remotely I just can't seem to get it to work ...
have you correctly configured a DDNS on the router in order to make sure you remotely access the correct public IP address .... unless you mean something else by "remotely" ....


Occasional Visitor
Hi, yes I use my routers Asus ddns address.


  • BlurAndPixelate_Apr042022_115319.jpg
    36.8 KB · Views: 72
  • BlurAndPixelate_Apr042022_115256.jpg
    36.2 KB · Views: 71
  • Screenshot_20220404-115036_Chrome.jpg
    21.4 KB · Views: 73


Part of the Furniture
Your ARP example and port forward don't match. If your local IP network is, then you set aside an IP solely for this purpose (e.g.,, which never gets assigned to an actual device, then port forward to that same IP. When you're on the public side of your WAN, you then need to specify the MAC address of the actual target of WOL in order for it to work. When you're on the LAN side, you can use the local IP (e.g., because it can use ARP to determine the MAC address, something it can't do on the internet side of the WAN.

P.S. Don't ever use the x.x.x.255 address for anything. That's the broadcast address, and broadcasts are usually NOT allowed across the firewall. That's why the example solution uses, rather than


Part of the Furniture
Once it's working, you can make it persistent using an init-start script.


mkdir -p $SCRIPTS_DIR

create_script() {
cat << 'EOF' > $SCRIPT
sleep 120
arp -i br0 -s FF:FF:FF:FF:FF:FF
) &
chmod +x $SCRIPT

if [ -f $SCRIPT ]; then
    echo "error: $SCRIPT already exists; requires manual installation"
    echo 'Done.'

Enable JFFS script in Administration > System, then copy/paste the above into terminal window of an SSH connection to the router (which will configure and install the script) and reboot.

Note: The script will NOT overwrite any pre-existing init-start script, including one of its own making. If some other addon is using the init-start script already, you'll need to manually add the script's code to it.


Occasional Visitor
Wow thank you so much!!! Just remind me what to set the port forwarding to please?



Occasional Visitor
IIRC, when I was doing this a few years ago, I simply added a port forward from 7799 (external) to UDP (internal).
OK so I ran your script and it did what it did, made a file with and ff:ff etc. I port forwarded external port to 3535 internal port to 9 and internal ip to and rebooted the router.

On the app I have I put the routers ddns address and set the port to 3535 but still nothing.


Part of the Furniture
When you're on the internet side of the WAN, the status check IP/Hostname needs to be that of your router's WAN, NOT the local, internal IP (


Part of the Furniture
What port do you use (successfully) when you're connected locally? 7? 9? That should be the internal port of the port forward.

P.S. Or maybe the app hides this from you and tries both 7 and 9.


Part of the Furniture
Yes 9 is working perfect internal, WOL from that app starts my server up from cold.

Then your port forward should work if the internal ip : port is IOW, the app should use 3535 to your external WAN ip and forward UDP to to wake the device.


Occasional Visitor
Then your port forward should work if the internal ip : port is IOW, the app should use 3535 to your external WAN ip and forward UDP to to wake the device.
I know right... scratching my head.

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!