Wake on LAN works but Wake on WAN doesn't
Wake on LAN works but Wake on WAN doesn't
I have no idea about the hibernate status. Any of this power stuff has gotten very confusing since microsoft got involved. Load wireshark on the machine and send it and see if you get the packets. That will quickly tell you if both the port forwarding as well as the issue with sending to the external IP is working correctly. The problem with sending traffic to the outside IP address on the router is the router gets confused. What happens you are attempting to NAT both the source and destination IP to the same external IP. So if you send a packet from 192.168.0.100 to 11.22.33.44 as the packet passes from lan-wan the router will translate the packet do be from 11.22.33.44 to 11.22.33.44. It might then translate the second one to your inside ip so you get from 11.22.33.44 to 192.168.0.xx. But when the traffic comes back it has to figure out how to reverse this. Some routers also always send the packet to the ISP even if it was his own IP. The ISP would then have to be smart enough to send it back. This is something so messy that it is hard to say if any particular router will do this properly. Some do and others do not and there is nothing you can do. On your first comment the flaw in what you say is " route the packet to the correct MAC address". This is the main reason wake on wan does not work. Mac addresses timeout after about 15 minutes of the router not seeing traffic from it. If there is no entry the router will do a ARP ....BUT your machine is asleep and will not respond. The router will discard the packet. So it might work when you first put the machine in WOL mode but after a short time the mac address will time out and it will stop. This is the reason that WoL actually send traffic to the broadcast mac address so that there is no need to have any mac tables. The packet will get sent to every port.
I get that, or maybe I don't get it. You are wrong about how things work right now. When you say the Mac address gets deleted after 10 to 15 minutes of not being used, that doesn't explain why it fails when I turn off my computer and wait a few seconds before sending the message again. The Mac address should NOT have been erased because the machine isn't actually turned off; hibernation probably isn't happening at all, even though it looks like it is on the system status screen. That leaves the time question as a major mystery.
To make things simpler: if I send a packet from my home computer (192.168.1.11) to 11.22.33.44, my router changes it so it looks like it came from 11.22.33.44. That same router also takes the second IP address and turns it into my local inside network's IP (like 192.168.0.44). To do this trick, the router needs to know that a specific IP belongs to a certain MAC address because of static DHCP settings.
"Right now" .. I admit I am clueless about what you are talking about. Same for the IP sent to my ISP. Anyhow:
1) When the target computer is in hibernation, everything works fine and the packet arrives; 2) AnyDesk manages to wake up a shut-down target even after days of not using it at all. I really want to know what trick they are using.
I am willing to help you, but please help me too. Where should I run Wireshark? Do I just install and run it on my office PC permanently while it stays turned on? Or do I need to set up the target computer first while it is actually shut down? Then, while that other machine is running, I send a packet from home and see if anything shows up.
You would open Wireshark on the computer you want to wake up. You definitely need to do this while that machine is turned on. This just helps with fixing problems later. You will then see what packets come in and exactly how the data looks inside them, so you can check if it really matches the power-on command. NAT (Network Address Translation) is a really hard-to-understand idea. You have to think about how traffic goes out and comes back. It's not just one IP address; that changes depending on where the connection starts and ends. What you add now is another copy of the same thing when the data comes back into your computer. So now you are adding a second layer of NAT for both sending and receiving. In short, the traffic passes through the router four times instead of just two times for each packet round trip. If it works like that, maybe you are using something from Microsoft that handles this weirdly. The OS might actually be awake and responding to those ARP requests. When you use real Wake on LAN only, just the network card is active, but a standard ethernet chip doesn't know anything about IP addresses; it only knows your MAC address (like a fingerprint). I don't have time to explain this further, but if you search for "Wake on LAN" and see discussions about ARP timeouts, you'll find many people having trouble with the same issue. This problem has existed for years, and because few people still run Wake on Lan, even small router manufacturers haven't made it easy to set up fixed entries automatically.
Thanks, Bill001g. I thought so too, so I connected to my target computer using AnyDesk and started Wireshark on there. Then I started mc-wol on my home PC. Unfortunately, I see thousands of packets in Wireshark, but I really don't know what to look at. Maybe I need to set up a filter system, but I don't know how. It seems like 90% of the traffic is between two computers that are always running, and if there are mc-wol packets coming out, they get buried in all that noise. Also, hibernate doesn't seem to work well: my target PC comes back on by itself after about a minute without me sending any wake signal. And this isn't what I want anyway...
You could try using a filter on your tool to catch traffic only from the one port you are using. If you use AnyDesk to connect to a computer, it's probably sending way too much data. You should be looking at Wireshark and watching closely because all that traffic is building up. It's better if you just use a local keyboard and monitor and pretend your PC is turned off while running only Wireshack with almost no other programs open. That lets you capture raw traffic and see things you didn't expect. Maybe it's some kind of traffic waking the computer up. This whole thing is mostly Microsoft junk anyway. Wake-on-LAN has always been a headache but ever since they created all their different suspend options and worse, the BIOS makers don't support them consistently, it has made this nearly impossible to get working well. I still recommend the simple solution now that you can buy cheap power outlets that connect via the internet, so you just use the BIOS option telling the machine to start up right when it feels power again. You can also do a full shutdown and the port forwards are super straightforward for those power outlets; some have cloud-based access so they work even if people can't get port forwarding to work.
I tried hard for hours to wake the computer using Wake On LAN. Turns out my router doesn't let you forward ports to that broadcast address (255) and can't change the ARP settings either. I looked into the smart energy plug fix, but when power comes back on, nothing happens there; no BIOS setting helps. So I quit trying that route. If Wake On LAN works, why not just use my old phone in the same network to turn it on? Now I use another computer or phone to remotely trigger that old phone so it starts my PC. You can use Airdroid to start it, it works great from anywhere and doesn't need a Raspberry Pi. Just make sure your phone is always running; we use it as a babyphone anyway. Case closed!