Trying to get Wake On LAN over the internet (WAN?) to work

Status
Not open for further replies.

xjokru

Commendable
Oct 1, 2016
41
0
1,530
I am trying to use Wake On Lan, but from a remote IP, over the internet, to turn my PC on.

I have enabled all of the necessary things in windows and BIOS:
-deep power off disabled
-ethernet adapter allowed to wake the device
-etc.

The green light of my PC's ethernet cable even keeps blinking when the PC is off.
But I seem to have run into a problem with the port required for WOL not staying open; I have the port forwarding rule set up in my router (see below) and it works when I open up say Depicus Wake On Lan Monitor. My PC even wakes up after the monitor has been active, but only for about 5 minutes, I assume this is due to some clever port opening and closing going on.

Now my question is, is there any way to disable this kind of closing/smart opening or whatever, as my router seems to close port when the PC is turned off, defeating the whole purpose of WOL over WAN or whatever it's called.

Could a broadcast address, instead of the direct static address of my PC work? How would I use said address? What else can I do?

Any help is appreciated and sorry if this is a stupid question.

My PC:
CPU: Intel Core i5-4440
GPU: Nvidia GTX 1060-6GB
MBD: Acer Predator G3-605
Ethernet adapter is by intel

My router:
Elisa (finnish ISP) version of ZyXEL VMG3925-B10B

OMXdRW6
 
Solution
P.S. I was thinking of another possible workaround. I haven't tried it personally (although I could if given time), but seems to me it would work provided you have and can set that BIOS option I spoke of earlier, where the system will automatically boot when power returns from a prior loss of power.

Get yourself one of those smart plugs.

https://www.amazon.com/WeMo-Switch-Smart-Works-Alexa/dp/B00BB2MMNE

Doesn't have to be that particular one. Just happens to be the one I have. There are a lot of other manufacturers offering similar devices these days, and pretty darn inexpensively. Seen deals lately over at Slickdeals.net for as a little as $10-15 a unit, esp. when sold in multipacks. Just make sure it can accessed remotely...
In order for WOL to work, the ARP entry for the target device (which maps the target device's MAC address to its IP address) must be available, but it's only cached in the router for a very short period (5-10 mins in most cases). And since the device is sleeping, when you try to use that port forward to wake the device, the first thing the router has to do is determine its MAC address based on its IP address, so it can then update its ARP table and initiate communications w/ it over ethernet. But of course it's sleeping, so the ARP request fails, and you can't wake the device. A classic chicken and egg problem.

The solution is to add a static/permanent ARP entry for that device to the router. If you have access to the CLI, the command would be:

arp -s 00:01:02:03:04:05 192.168.1.100

... where you replace 00:01:02:03:04:05 and 192.168.1.100 w/ the target device's actual MAC address and IP on the LAN.

So now the ARP table always has this information available, even if the target device is sleeping.

Of course, not all routers provide this kind of low level access. Or perhaps they do buried somewhere in the GUI, but that would vary from router to router. Using third-party firmware like dd-wrt, tomato, etc., makes this a trivial exercise. OEM firmware is hit and miss.
 
The above post explains why but the short answer is there is no such thing as wake on "WAN".

Very technically even some of the hacks that partially work with port forwarding should not work. Many PC bios take thing they technically should not. wake on lan has no concept of ip address. When the machine boots it technically could be assigned a different IP by the DHCP server.

The best solution I have seen the router has a special feature where you can remotely access the router and request it send the wake on lan packet to the end device. I know asus routers have this feature.

Even when you get all this mess figured out microsoft has made a major mess of things with all their special sleep/suspend modes. It can be a challenge to keep microsoft stuff from interfering.
 
You are going to need something running 24/7 that allows you to access it remotely and trigger wol.
This device will either need port forwarding in order to access it from outside your nat or use a pinhole with an open connection to a 3rd party. teamviewer might have something like this.
 

xjokru

Commendable
Oct 1, 2016
41
0
1,530


I'm not 100% sure that the ARP cache doesn't get reset, but if this was my only problem, then shouldn't wake on wan work say 10 seconds after I close my PC regardless of what it was doing? Because that isn't the case, WOW only works 10 seconds after I close my PC if the PC was actively listening to the port, which is why I asked about disabling auto closing/opening of ports.
 

xjokru

Commendable
Oct 1, 2016
41
0
1,530


Would say a raspberry pi work? Can it run teamviewer in WOL mode only?
 


I don't understand the distinction you're making between closing the PC vs. closing the PC while listening to the port.

When you configure your PC and BIOS for WOL, that tells Windows and the BIOS to place the network adapter into a special WOL state as the system is being shutdown. IOW, it has to be powered down cleanly! If, for example, you literally just pull the power from the machine, or power is suddenly lost for any other reason, WOL will NOT be set. WOL is a process of the normal shutdown process. That's why it's recommended that if you're going to use WOL, that you also configure the BIOS to automatically boot the machine when recovering from a loss of power (the name of this BIOS option varies from system to system).

The reason I'm explaining all this is just to make it clear how it actually works, and why it can be tricky to set up properly. And before WOW is ever going to work, WOL has to be configured and working reliably from the LAN.

All that said, whatever issues you may be having that might explain why WOL/WOW doesn't work even a few seconds after a clean shutdown, doesn't negate the issue of ARP. This is a loooooong standing and well known problem when dealing w/ WOW. Sooner or later the ARP entry for the target device is going to drop from the router's ARP cache. And when it does, the router will have no way of determining the MAC address of the target device based on its IP address unless there's a static/fixed entry in its ARP table. That's just the way it works. My own WOW configuration works perfectly, and has for many years, but I'm always using a third party firmware on my router (dd-wrt, tomato, etc.) that makes adding a static ARP entry trivial. When it comes to OEM firmware, that's another matter. Usually you don't have this kind of low-level access, so you can't fix that particular problem.

So I'm not claiming you might not have other issues. But I can guarantee you that this issue w/ ARP *is* and will remain an issue for WOW. For anyone familiar w/ WOW, this is old news, and well understood. And why so many of us choose to use third party firmware.
 
P.S. I was thinking of another possible workaround. I haven't tried it personally (although I could if given time), but seems to me it would work provided you have and can set that BIOS option I spoke of earlier, where the system will automatically boot when power returns from a prior loss of power.

Get yourself one of those smart plugs.

https://www.amazon.com/WeMo-Switch-Smart-Works-Alexa/dp/B00BB2MMNE

Doesn't have to be that particular one. Just happens to be the one I have. There are a lot of other manufacturers offering similar devices these days, and pretty darn inexpensively. Seen deals lately over at Slickdeals.net for as a little as $10-15 a unit, esp. when sold in multipacks. Just make sure it can accessed remotely, not just locally.

You don't even need WOL capability for this to work. You plug the smart plug into the wall, configure it w/ your wifi router, and plug your PC into the smart plug. Since the smart plug can typically be configured for remote access w/ your smartphone, once you shutdown the PC locally or remotely, you can simply power off the smart plug w/ the smartphone app, wait a few seconds, then power the smart plug back on. And now, because of that BIOS option, it will reboot! In fact, using this technique, you could even recover a hung PC!

Because of advances in devices such as these, we have other options, some that may eventually make the need for WOL/WOW obsolete. Just so long as you have that recovery option in the BIOS.
 
  • Like
Reactions: ptrillides
Solution

xjokru

Commendable
Oct 1, 2016
41
0
1,530


The difference is that when listening to the port, shutting down and shortly after sending a WOL packet, the PC turns on. Doesn't turn on, if not listening.
 

xjokru

Commendable
Oct 1, 2016
41
0
1,530


Also, I'm not sure whether this is right, but it's all Icould find.
https://imgur.com/vzY2al9
vzY2al9

 
You really need to read the details on WoL.

When you talk WoL there is no such thing as a port and there is no such thing as a IP address. WoL ONLY understands mac addresses.

The bios is watching for a packet set to the broadcast mac address that contains the PC mac address in a special format. This is a very special hardware function that is in no way related to "listening" to any port.

Maybe we go back to the best answer that is IT CAN'T BE DONE. Now if you want to really learn all the details of the hack that people use to make this work then that answer might be different. It is going to take some effort on your part to use these tools for a function that it is not really designed for.
 

xjokru

Commendable
Oct 1, 2016
41
0
1,530


Can you stop focusing on the WOL part, I've read the previous replies. There pretty clearly is something going on with the ports, because the WOW works if I have listened to the port with say depicus' Wake On LAN monitor, before shutting the PC down. The WOW doesn't work if I haven't had said program on and listening to the port.
 

kanewolf

Titan
Moderator
Have you successfully gotten WOL to work when initiated from another device on the LAN? If not, then there is still an issue with the target PC.

Router ports and port forwarding only work if the IP is active. Your PC doesn't have an IP address when powered down. You can prove (or disprove) that by attempting to ping the PC after shutting it down.
 


You were told in the very first post what the problem is. The ARP times out.

What happens is the packet comes into the router it gets mapped to the internal IP address BUT when the router attempt to locate the mac address there is no ARP entry. It wills send a ARP request but because the PC is shutdown and does not actually have a IP it does not respond. The packet will be dropped at this point.

In addition even if there was a ARP entry this is a violation of the packet format for WoL.

The official standard says packet is sent to the BROADCAST mac address not the mac of the PC. Some PC WoL will accept data send to the PC mac address but this is depends how closely they follow the standard. They are technically not suppose to use the pc mac.

But we are back at the start but you didn't want to hear that it will not work with the router you currently have.

You need a router you can set a static ARP entry in. Then you set the ARP for a dummy IP and map it to the broadcast MAC. Your actual device will use its own IP after it boots.

You must be VERY sure the WoL works when sent from a locally connected device. WoL has massive number of issues, there are all kinds of microsoft bios supported "sleep/suspend" modes you must not have enabled.

Still step 1 is to buy a router you can put in static ARP........But it will be much simpler to just buy a ASUS router that allows you to remotely login to the router and ask it to send the WoL packet on your behalf.
 
I agree w/ bill001g in many respects.

There is no spec for anything called WOW. That's just shorthand for triggering WOL via a port forward. And yes, it would actually be better to use the broadcast address (FF:FF:FF:FF:FF:FF) instead of the MAC address of each device you intend to wake over the WAN, and need a port forward for each. In fact, that's exactly how I do it here, but I didn't want to complicate matters even further by going down that path. But even in that case, you *still* need to add a static entry in the router's ARP table.

Code:
arp -s FF:FF:FF:FF:FF:FF 192.168.1.254

In this case, there is no device that's been assigned 192.168.1.254. It's just a means to get the broadcast address into the router's ARP table, then trigger it w/ a port forward. And now when you use Depicus for WOW, that same port forward will work for *any* device on the LAN configured for WOL, because it's (more correctly) causing exactly what you want; a broadcast. And what it broadcasts is a UDP packet containing the WOL magic packet.

That said, in most cases, whether technically proper or not, creating port forwards bound to a specific IP and MAC on the LAN will work too.

But however you choose to do it, whether proper or improper, without the ability to add static ARP entries to the router's ARP table, the whole discussion is moot.

You either have to perform some kind of remote access into your router/LAN (OpenVPN server, ssh server, etc.) and invoke the local WOL utility (e.g., ether-wake on Linux), or as I suggested earlier, use one of those smart plugs. A smart plug completely circumvents all this WOL stuff. You don't even need to open ports. You're just directly manipulating the AC outlet powering that device.

 

xjokru

Commendable
Oct 1, 2016
41
0
1,530
Here's an update:
I have now tested WOL and it's working consistently.
Now to I hope you can answer these questions:
1) Are a static DHCP and a static ARP entry different? If they are how? See https://i.imgur.com/vzY2al9.png
2) Are the ARP cache and the ARP table different? My router seems to keep even very old devices in the ARP table, is that a good or a bad sign?
3) Could a raspberry pi be running with teamviewer in the background 24/7 or would it crash/overheat/etc.
4) Are you 100% certain that this won't work with my current router?
 
DHCP and ARP are different things I would suggest the wiki if you really want to know the details.

ARP cache and arp table are likely the same thing. There really is no fixed time that device keep ARP the common number you see is 15 minutes.

A raspberry should work, at some point though you need to ask is it worth the hassle. Most pc have pretty good power saving modes where they stay on but down clock the cpu and turn off things like the video card.

You never posted your router model but it would clearly have a place to set ARP entries. Many you must actually use the ARP command from a cmd window in the router.
 

xjokru

Commendable
Oct 1, 2016
41
0
1,530


I did post my router model, in the very first post along with the relevant specs of my PC.
 


That is somewhat interesting it allows you to display the ARP table but not change it.

More importantly the manual says this router supports wake on lan. Can you remotely access the router, I only read part of the manual.
 

xjokru

Commendable
Oct 1, 2016
41
0
1,530


I'm a bit bad at this so uhhh, how would I send those commands to a router, like the "arp -s 00:01:02:03:04:05 192.168.1.100" someone recommended?
 
It depends on the router it may not have that ability.

Still I strongly suspect it is going to be simpler to just remotely access your router likely via a web page and click on the WoL button to activate the internal PC. No port forwarding, no arp tables, no messing with non standard stuff.
 

xjokru

Commendable
Oct 1, 2016
41
0
1,530


Well my ISP's version of the firmware doesn't seem to support this so that's great.

Edit: This version also seems to have deleted the Wake on LAN section of Home Networking

Edit2: I already made a topic on the ISP forum, but it's in finnish and a lot smaller, so we'll see if they know anything
 


I'm sure there is some sort of software that works. I don't have a pi so IDK.

Do you have a NAS or any PC you can remote into using something like teamviewer or chrome remote desktop? You can buy embedded ones fairly cheap if your WoL is that important. You can for sure do what you want with ubuntu on a x86. Not sure about Arm or what ever pie uses. Most of the software is for the x86. For $200 you could get a low power pc and use it for a small nas, remote admin, etc.
 
Status
Not open for further replies.