What's new

Solved WOL with request from internet Rt-ac68u

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Nesalex

Regular Contributor
Hi. Please is there a way to wake up the device via wake on LAN when requesting from an internet connection? I have a redirected port to NAS storage. When it shuts down I can wake it up by sending a request via WOL. It would be great if i could wake up the NAS when there is a request to connect to the NAS via a given port - I mean the connection request from the Internet. thank you
 
Last edited:
As it happens, I posted a script to PasteBin just yesterday, to do just this, but it's for DD-WRT.


I was planning to make a version for FT (FreshTomato) starting today, and perhaps even Merlin down the road. The basic concepts are identical, but each platform does have a few minor differences that requires a unique script. If you're interested, I might consider taking a look at Merlin first rather than FT.

Of course, there may be (and probably are) others who've already done so, but I don't know of them specifically.
 
Last edited:
Just realize it may take a few days. I haven't even updated to 386.4 as yet. And I don't want to code based on the prior firmware (386.3_2). Too many changes, including (iirc) how static leases are handled (which is part of my script). Merlin tends to differ significantly from DD-WRT and FT (which differ from each other very little), which is why I normally code for DD-WRT + FT first, and push Merlin off for later consideration.

Of course, if you feel confident about it, you could always try converting it yourself if you're in a hurry.
 
uff. It can wait. Well thank you. I'll wait When it's done, please write here in the thread. Thank you very much. After a dirty update to 386.4, I could not dial a PPPoE connection. I had to downgrade to 386.3_2 because it didn't work and I didn't have time to try a factory reset.
 
Ok, I have a working version for Merlin. Tested on 386.3_2 and 386.4 (worked on both with same changes).


Under Administration->System, make sure you have "Enable JFFS custom scripts and configs" enabled. Then download installer and edit it using the following script (just copy/paste it into the window of an ssh session).

Bash:
installer=/tmp/tmp.$$.installer.sh
curl -kLs pastebin.com/raw/b7p6f102 | tr -d '\r' > $installer
chmod +x $installer
nano $installer

The installer is actually an outer script that creates two inner scripts; nat-start and init-start. Within the nat-start script, you need to define the port forward itself (we're NOT using the GUI for these purposes). Within the init-start script, you need to define the MAC address of the target of the port forward. NOTE: If you've defined a static lease for the target using the GUI (which I strongly recommend), then you don't need to modify init-script at all; it will find the MAC address dynamically, at runtime.

Save your change and run the installer.

Bash:
$installer

Finally, reboot.

NOTE: If you have an existing nat-start and/or init-start script, the installer will NOT overwrite either of them (even if it's from a previous run of the installer itself). If they're from the installer, you'll have to delete those manually. If they've been generated from some other source, you'll have to find a means to incorporate my scripts into those scripts (or vice-versa). That process can NOT be safely automated.

If for any reason you need to remove these same scripts (e.g., to uninstall), you can use the following commands.

Bash:
rm -f /jffs/scripts/nat-start
rm -f /jffs/scripts/init-start
 
Last edited:
It's also an easy script to start devices when a VPN connection is made.
 
Ok, I have a working version for Merlin. Tested on 386.3_2 and 386.4 (worked on both with same changes).


Under Administration->System, make sure you have "Enable JFFS custom scripts and configs" enabled. Then download installer and edit it using the following script (just copy/paste it into the window of an ssh session).

Bash:
installer=/tmp/tmp.$$.installer.sh
curl -kLs pastebin.com/raw/b7p6f102 | tr -d '\r' > $installer
chmod +x $installer
nano $installer

The installer is actually an outer script that creates two inner scripts; nat-start and init-start. Within the nat-start script, you need to define the port forward itself (we're NOT using the GUI for these purposes). Within the init-start script, you need to define the MAC address of the target of the port forward. NOTE: If you've defined a static lease for the target using the GUI (which I strongly recommend), then you don't need to modify init-script at all; it will find the MAC address dynamically, at runtime.

Save your change and run the installer.

Bash:
$installer

Finally, reboot.

NOTE: If you have an existing nat-start and/or init-start script, the installer will NOT overwrite either of them (even if it's from a previous run of the installer itself). If they're from the installer, you'll have to delete those manually. If they've been generated from some other source, you'll have to find a means to incorporate my scripts into those scripts (or vice-versa). That process can NOT be safely automated.

If for any reason you need to remove these same scripts (e.g., to uninstall), you can use the following commands.

Bash:
rm -f /jffs/scripts/nat-start
rm -f /jffs/scripts/init-start
Wow. I didn't expect it to be so soon. Thank you very much. I will try it. Thank you again
 
It works great. Many thanks for creating the script. Nice automated even for a beginner like me because I haven't any previous experience with ssh .. Good luck
 
Ok, I have a working version for Merlin. Tested on 386.3_2 and 386.4 (worked on both with same changes).


Under Administration->System, make sure you have "Enable JFFS custom scripts and configs" enabled. Then download installer and edit it using the following script (just copy/paste it into the window of an ssh session).

Bash:
installer=/tmp/tmp.$$.installer.sh
curl -kLs pastebin.com/raw/b7p6f102 | tr -d '\r' > $installer
chmod +x $installer
nano $installer

The installer is actually an outer script that creates two inner scripts; nat-start and init-start. Within the nat-start script, you need to define the port forward itself (we're NOT using the GUI for these purposes). Within the init-start script, you need to define the MAC address of the target of the port forward. NOTE: If you've defined a static lease for the target using the GUI (which I strongly recommend), then you don't need to modify init-script at all; it will find the MAC address dynamically, at runtime.

Save your change and run the installer.

Bash:
$installer

Finally, reboot.

NOTE: If you have an existing nat-start and/or init-start script, the installer will NOT overwrite either of them (even if it's from a previous run of the installer itself). If they're from the installer, you'll have to delete those manually. If they've been generated from some other source, you'll have to find a means to incorporate my scripts into those scripts (or vice-versa). That process can NOT be safely automated.

If for any reason you need to remove these same scripts (e.g., to uninstall), you can use the following commands.

Bash:
rm -f /jffs/scripts/nat-start
rm -f /jffs/scripts/init-start

As always, nice work. Another link to add to the "keep in back pocket" file. Cheers
 
UPDATE: v2.1.0 is now available.

I've updated the script. It's exactly the same as before in terms of how it works and behaves, but I've revamped how the files are created and managed.

You can use the following command to download and install it using my new installer.

Code:
curl -kLs bit.ly/merlin-installer|tr -d '\r'|sh -s b7p6f102

It will create five (5) files.

Code:
/jffs/configs/merlin-wol-port-forward.options
/jffs/scripts/merlin-wol-port-forward.nat
/jffs/scripts/merlin-wol-port-forward.init
/jffs/scripts/nat-start
/jffs/scripts/init-start

init-start and nat-start are just simple shells that call their respective merlin* scripts.

I've been updating all my scripts in this way, so it's easier for someone to resolve conflicts when other scripts (whether from me or others) need to use the same event scripts. I was previously burying the meat and potatoes of my scripts in those event scripts, making that process too difficult. For the purposes of changing options, you just need to concern yourself w/ the merlin* files.

If you need to uninstall it, just delete those same files.

Code:
rm -f /jffs/configs/merlin-wol-port-forward.options
rm -f /jffs/scripts/merlin-wol-port-forward.nat
rm -f /jffs/scripts/merlin-wol-port-forward.init
rm -f /jffs/scripts/nat-start
rm -f /jffs/scripts/init-start
 
Last edited:
Is this still working on the latest firmware? i can't seem to get this to work, i've set everything up in the config file

i'm looking for port 32400 ( plex ) i.e when plex is accessed send wake on lan. but its not working
if i manually do wake on lan from the router that works fine
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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