--- Recap of the possible solutions at the bottom ---
First of all I apologize if I write something that makes no sense. My knowledge of networks didn't go beyond what an IP address is until 3 days ago, and a lot of this is still very alien to me.
I setup a system where I can turn on my home computer remotely using Wake on LAN / WAN. I have followed several guides to enable it and it seemed to be working, at first, except that after my remote PC has been turned off for a while, it doesn't work anymore.
I understood that this is due to the ARP table flushing, and I thought I had addressed this problem by mapping my remote PC IP address to its own MAC address in the DHCP config of its router.
Let me briefly illustrate what I did:
- Setup a DDNS service, allowed WoL in BIOS, allowed NIC to WoL on magic packets, disabled fast startup on windows 10 etc... that part is covered.
- I forwarded port 7 on my router listening to UDP packets. Since the router doesn't allow broadcasting, I cannot bind the port to 192.168.1.255 (it says "invalid ip"), and hence I bound it to the IP address of my remote machine.
- Then, in the DHCP config, I mapped my remote PC MAC address to its own IP.
- Lastly, I have downloaded an app on my phone (this one) that sends a magic packet with my remote PC MAC address. I tested it on 4G and it properly delivers the packet.
As I said above, everything works fine until remote PC stays turned off for a while. I thought step 3 would fix the ARP table flushing, but apparently it didn't (I thought DHCP configs and ARP table were the same thing?).
So my question is, is there a way I can circumvent this problem, and be able to turn on my pc remotely even after a it's been in shutdown for a while?
The second part of my question is: I read here that I am supposed to edit the ARP table of the router to have a static mapping between my pc MAC address and IP so that it doesn't get flushed out. I am not at home for the next 3 weeks and I don't recall my router having the possibility to edit the ARP table (I might be mistaken tho). So, is there a way I can SSH remotely to the router?
Any help or info is much appreciated.
Edit - for those that will stumble in the same issue:
If your router doesn't allow directed broadcasting (apparently most of them), sending a wake on WAN packet to a machine becomes a tad more complicated. One can either:
Add a static binding to the ARP table. Having a static DHCP reservation doesn't work because they carry out different functions, as explained here. Editing the ARP table is also not necessarily straightforward: seemingly most routers don't have that option in their web gui, and therefore you have to SSH into them. Even then, you might be facing a castrated system allowing a very small subset of commands, like in my case.
If you can't edit the ARP table, there are two more options:
Use a low-power raspberry pi to be on 24/7, direct the wol packet to it via ssh and broadcast it via LAN, as explained here.
If your router has an option to send WoL packets to machines in LAN, enable remote management of your router via HTTPS so you can access the router's web gui via browser. However, the general consensus is that this is a HIGHLY NON RECOMMENDED practice.