6

--- 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:

  1. 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.
  2. 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.
  3. Then, in the DHCP config, I mapped my remote PC MAC address to its own IP.
  4. 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:

    1. 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.

    2. 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.

wtfzambo
  • 163

2 Answers2

5

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.

Yes, if you're trying to use port-forwarding for WoL, that's correct.

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)

Many home routers indeed don't have this function (or at least not in the web UI). It's not something that a typical user would need to do; practically the only uses it sees are either WoL via port-forwarding or a poor attempt at "securing" the network.

(For that matter, many home routers don't even have the function to edit routes...)

(I thought DHCP configs and ARP table were the same thing?).

They definitely are not. (Some routers, such as pfSense, do have the feature to automatically copy static DHCP leases into static ARP table entries, but that's something they had to deliberately program for.)

So, is there a way I can SSH remotely to the router?

Depends on the router. Some allow SSH to be enabled, others only support Telnet or nothing at all; some restrict it to LAN only. Some let you do useful things via SSH, others have a very limited command set; you're unlikely to find an actual WoL command there, though you might be able to add temporary static ARP entries.

Whether you should also depends on the router. As mentioned in comments, many embedded devices tend to come with outdated and sometimes outright vulnerable software, which includes their SSH daemons. (For example, Dropbear sshd had a few remotely exploitable vulnerabilities in 2016.)

When you get home, I'd suggest getting a cheap Raspberry Pi-alike (low power so it can run 24/7), and setting up SSH (via port forwarding) into that. Admittedly, running the wake-on-LAN command via SSH is certainly not as convenient as doing it directly through an app... but it should actually be easy to forward the WoL packets to the Pi, and have it bounce them back to LAN as broadcasts. (No ARP issues since the Pi will always be online.)

Side note

I forwarded port 7 on my router listening to UDP packets.

Port 7 used to be assigned for the 'echo' service. Traditionally WoL packets are sent to port 9 (the 'discard' service), as they're supposed to be ignored by the actual OS – definitely not to be echoed back (possibly causing an echo storm).

Now it's very unlikely that any host will actually be listening for packets on the 'echo' port (unless it's a time-traveler from 1980s), and the actual WoL functionality doesn't even care about "ports" at all... but I'd fix it anyway, out of principle. Port 9 makes more sense for packets that are aimed at the NIC and not at the OS.

grawity
  • 501,077
3

According to the User’s Guide VMG8825-B Series manual page 132, you should be able to assign a static address to your computer in Network Setting > Home Networking > Static DHCP. The address should be your internal IP, for example 192.168.1.10.

Once this is done, sending a WoL package to the router's public IP should wake your computer. This should be done from outside your local network.

If this doesn't work, some element of hardware or software does not support WoL. See this post for a list of requirements: RDP wake-on-lan in LAN environment.


In the case that you have access to your router's configuration page from outside of the network, you can force the sending of a WoL package to your computer from this page.

In the manual, see on page 137 the section of "The Wake on LAN Screen".

Click Network Setting > Home Networking > Wake on Lan to open this screen:

enter image description here

Enter the computer's internal IP address or its MAC address and press the "Wake Up" button.

harrymc
  • 498,455