I can successfully wake my computer if my Android device in connected to the local network but I can't wake my computer from another network.
All BIOS WOL settings are enabled. I also opened a port (9 UDP) and I'm using DDNS.
In my firewall there is a rule to allow incoming packets in port 9.
I'm trying to check if my computer receives the Magic Packet using Wireshark but I don't see any incoming packets. I'm sending the packet using Fing (Android app).
What am I doing wrong?
Note: I'm running Ubuntu 14.04 LTS
2 Answers
Wake-on-lan doesn't work over the internet
That's a good thing, do you want random people waking up your system via the Internet?
Your computer is behind a router. Pretty much anywhere your phone has Internet service, it is also behind a router, whether municipal Wifi, Starbucks, your workplace, etc.
WOL packets are broadcast packets. Standard routers do not forward broadcast packets. Broadcast packets are not meant to leave your LAN, can you imagine the possibilities for abuse if they did?
The proper way to do what you are trying to do is this: you need a system on your network on all the time that you can hop on, log into, and tell to issue a WOL packet on your network. DD-WRT has this capability if your router is flashed to it.
That's why it's called "Wake-on-LAN". It's supposed to work in LANs.
However, I've been told more than once that, to my surprise, any packet received by the computer's NIC may be a magic packet if it
- is addressed to the broadcast MAC address, and
- contains anywhere in the payload the magic string (6x
FFand 16xcomputer's MAC address)
However, your router needs to allow the forwarding of packets to the broadcast MAC address, or your computer's WoL system needs to be more flexible, such as accepting WoL addressed to its own MAC address (I actually thought this was the standard approach, but Wikipedia says I'm wrong).
Since it looks like Internet WoL is unreliable, as you will depend on intermediate routers allowing it, you are probably safer if you find something in your network you may use to do the WoL for you. For example, being able to ssh (or telnet, but that's dangerous) to your router and send the magic packet from there. Or, if your router is supported, check out dd-wrt and flash your router if you're comfortable with it. dd-wrt can be used to send the magic packet from within your network, and since it is always on, you won't need more hardware online 24/7.
I use a Raspberry Pi as a WoL "platform" - the router has a port forward to the Pi's ssh server, so I ssh to the Raspberry Pi and send the magic packet from there. Since it is inside the LAN, it's close to guaranteed that the WoL will work.