What's new

Remote Wake on LAN (Wake on WAN) (for Plex)?

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

Wysie

Occasional Visitor
Hello,

I've managed to set up Wake on LAN, and also added some port forwarding rules so I can do a wake on WAN as well, but the Wake on WAN portion doesn't work.

I've the following 2 rules set up for this:

Port Range: 9
Local IP: 192.168.1.50
Local Port: 9
Protocol: TCP/UDP

Port Range: 7
Local IP: 192.168.1.50
Local Port: 9
Protocol: TCP/UDP

May I know what else I need to do? I'm hoping to be able to wake up the PC remotely as it's also my Plex Media Server. I've also done the following but it doesn't seem to be working:

Code:
arp -i br0 -s 192.168.1.50 FF:FF:FF:FF:FF:FF

I've a workaround at the moment based on this (https://github.com/RMerl/asuswrt-merlin/wiki/WOL-Script-Wake-Up-Your-Webserver-On-Internet-Traffic):

Code:
#!/bin/sh

INTERVAL=5
NUMP=3
OLD=""
TARGET=IP Address without quotes
PORT=32400
IFACE=br0
MAC=MAC Address without quotes
WOL=/usr/bin/ether-wake
LOGFILE="/var/log/ether-wake.log"

while sleep $INTERVAL;do
NEW=`dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print }' | tail -1`
SRC=`echo $NEW | awk -F'[=| ]' '{print $8}'`
DPORT=`echo $NEW | awk -F'[=| ]' '{print $27}'`
PROTO=`echo $NEW | awk -F'[=| ]' '{print $23}'`

if [ "$NEW" != "" -a "$NEW" != "$OLD" ]; then
if ! ping -qc $NUMP $TARGET >/dev/null; then
# echo "NOWAKE $TARGET was accessed by $SRC, port $DPORT, protocol $PROTO and is already alive at" `date`>> $LOGFILE
# else
echo "WAKE $TARGET requested by $SRC, port $DPORT, protocol $PROTO at" `date`>> $LOGFILE
$WOL -i $IFACE $MAC
sleep 5
fi
OLD=$NEW
fi
done

The code above is working for me. However, it also means that any scan that hits 32400 will wake up my PC, something I'd prefer to avoid.

Thanks!
 
Last edited:
vt1431: Thanks! However, if you see my initial post I've already tried using the arp line from the same tutorial as well, still can't get it to work :(
 
I know this is very old.... But as OP says a port scan will trigger the PC to wake up. I changed the script to use a IP whitelist in order only to allow some ip's to send WOL package. It is very useful for TVs etc. that often use the public static ip adress of the home. Furthermore, IP-ranges can be whitelisted for ISP prodividers; I use that for phones for instance as my phone always has aa.bc.*.* format running 3G/4G. If you travel all ips can be whitelisted, or better, send a manually WOL package specific port.
Also, my findings indicate that the PLEX lenght size always is 60. That can also help to exclude random wakeups.

Source:
https://github.com/Meliox/FTPauto/blob/master/utils/woltraffic.sh
 
I know this is very old.... But as OP says a port scan will trigger the PC to wake up. I changed the script to use a IP whitelist in order only to allow some ip's to send WOL package. It is very useful for TVs etc. that often use the public static ip adress of the home. Furthermore, IP-ranges can be whitelisted for ISP prodividers; I use that for phones for instance as my phone always has aa.bc.*.* format running 3G/4G. If you travel all ips can be whitelisted, or better, send a manually WOL package specific port.
Also, my findings indicate that the PLEX lenght size always is 60. That can also help to exclude random wakeups.

Source:
https://github.com/Meliox/FTPauto/blob/master/utils/woltraffic.sh
Link not working , anyone still got the whitelist code
 
Merlin has WoL from the internet firewall blocked. Or he did at one point when I asked the exact same question.

Check your firewall tables.
 
Merlin has WoL from the internet firewall blocked. Or he did at one point when I asked the exact same question.

Check your firewall tables.
That's a different approach. It's wake on wan. Basically you just need to do NAT/portforward. E.g. send magic packet to port 53434 and forward that to port 7/9 for the ip.

The asked for script listens for specific traffic on the port plex is running.
 

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