What's new

script to use AC86U's WakeOnLan

  • 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!

shorshi

New Around Here
Hey,

I was wondering if there is a way to somehow have an easy script, like a single-click type thing like a .bat file, in order to use the WakeOnLan feature under "network tools" in the Router GUI. I know there's WOL tools, but for some reason i can't wake other PCs from one of my computers. I can however connect to the Router GUI and do it by hand. was wondering if someone can help me automate that?

Thanks!

shorshi
 
Hi shorshi.

To have a fully working WOL you have to do a thing or two first:
1) fixed ip on dhcp for the device to be woken up (through router gui)
2) open port for that service pointing that ip (through router gui)
3) fixed arp entry to link the device fixed ip and its mac addres (through ssh)
4) to make "3" permanent, you have to create a script and put it in /jffs/scripts and call it in services-start (through ssh)
5) depending on your model, you might need to create a cron job to call "4" on a timely basis (through ssh)

Then you can wake the device up from any pc or mobile phone. If your ISP don't provide you with fixed public IP, you can create a ddns and WOL from inside or outside your network with a single click or touch from your pc or phone.

It may sound complicated at first, but it is not, I'm a complete newbie and I accomplished it thanks to all the help I received here from very helpful and kind members.
Excuse my non native English and non native _networkish_ too 😁
 
Last edited:
Bash:
#!/bin/sh

ssh admin@192.168.1.1 ether-wake -i br0 xx:xx:...

Change for your admin username, ssh port, router ip, mac address to wake up, etc
 
Hey,

I was wondering if there is a way to somehow have an easy script, like a single-click type thing like a .bat file, in order to use the WakeOnLan feature under "network tools" in the Router GUI. I know there's WOL tools, but for some reason i can't wake other PCs from one of my computers. I can however connect to the Router GUI and do it by hand. was wondering if someone can help me automate that?

Thanks!

shorshi
Just change mac.
Command: /jffs/scripts/WoL.sh #chmod +x

Bash:
#!/bin/bash
# Define the MAC
MAC_ADDRESS="00:00:00:00:00:00"
# Send the WoL packet using ether-wake
/usr/sbin/ether-wake -i br0 -b $MAC_ADDRESS
# Check if WoL command was successful
if [ $? -eq 0 ]; then
    echo "WoL packet sent successfully to $MAC_ADDRESS"
else
    echo "Failed to send WoL packet to $MAC_ADDRESS"
fi

You can use an app such as WolOn to execute command with single click. Pretty neat.
 
Interesting, mine works without the -b (broadcast). I wonder what the difference is?
WoL without specifying IP, its useful for small network environments (if ur unsure about subnet)
 
Last edited:
WoL without specifying IP, its useful for small network environments (if ur unsure about subnet)
I wasn't clear. As I posted above, I use exact the same ether-wake command with MAC but without -b. No issues.
 
I wasn't clear. As I posted above, I use exact the same ether-wake command with MAC but without -b. No issues.
With -b the destination MAC address in the ethernet header is "ff:ff:ff:ff:ff:ff". Without the -b the destination address is the same as the MAC address you're trying to wake.
 
Last edited:

Similar threads

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