Wake-on-lan doesn't work over the internet

5

2

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

kalpetros

Posted 2014-08-17T22:17:24.120

Reputation: 151

Answers

2

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.

LawrenceC

Posted 2014-08-17T22:17:24.120

Reputation: 63 487

2

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

  1. is addressed to the broadcast MAC address, and
  2. contains anywhere in the payload the magic string (6xFF and 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.

Valmiky Arquissandas

Posted 2014-08-17T22:17:24.120

Reputation: 1 770

Thanks for your reply it explains a lot. But I read the following: The easiest way to issue a Wake-on-LAN command from outside your local network is through your web browser, and the absolutely simplest way to do that is through your router. It says that with DD-WRT you can turn your computer on from anywhere. Is this possible? – kalpetros – 2014-08-18T21:46:59.517

I'm not sure how you do that from your web browser, unless you make all the work before that, that may include configuring your router and something else to send the magic packet for you. With dd-wrt, yes, you can turn your computer on from anywhere, as long as your router is turned on 24/7. I have found these threads on SuperUser that will probably help you further: http://superuser.com/questions/266009/wol-wake-on-lan-over-internet and http://superuser.com/questions/18298/is-automatic-wake-on-lan-possible-with-dd-wrt

– Valmiky Arquissandas – 2014-08-18T23:48:22.293

That's why it's called "Wake-on-LAN" It's supposed to work in LANs. So by your definition I shouldn't be surprised that by using a LAN cable I can access my NAS, but not Google? – Mike de Klerk – 2017-01-18T13:56:43.540

I'm not sure what you mean. What you call a "LAN cable" (which is an informal name) links machines in a local network - that is, a network where you can route frames in layer 2, which is the required scenario for WoL. What you do with that network is up to you. You can also call it an Ethernet cable but flow ATM traffic in it. – Valmiky Arquissandas – 2017-01-19T19:04:43.567

much like the raspberry pi solution, you can try the app i created and install it on an android device you have lying around the house. it will forward the WOL packet and broadcast it in the LAN so your PC will wake: https://play.google.com/store/apps/details?id=com.bianco.wolproxy&hl=en

– Itay Bianco – 2018-06-07T14:56:21.890