0

I have a direct ethernet connection between a Windows 10 PC and a Raspberry Pi.

I have the Pi set up as a server that I can hop onto and run a script that will run Etherwake, a command line Wake on lan program, and it works fine when I test it by turning off my computer and letting it sit for a minute, then I run the command and the computer turns on.

But when I let it sit overnight, it doesn't work anymore. Running the script does nothing.

From what I've been reading, a lot of people fix this by messing with some sort of ARP settings on their router, but there isn't a router in this situation- again, its a direct ethernet cable running between the two computers.

geekman
  • 11
  • 1
  • Wake on LAN is done via MAC address not IP address. Wake on LAN happens at layer 2. Any solution allowing you to specify an IP address for a target is a HACK. Stop using the computers IP address and use the MAC address of the computers network interface. https://en.m.wikipedia.org/wiki/Wake-on-LAN – Appleoddity Aug 26 '17 at 05:51
  • The command I'm running right now only asks for a MAC address when I run it, no IP address – geekman Aug 26 '17 at 06:06
  • Ok. Then that is right. It is not an ARP issue then. It is a problem with the computer not responding properly. Try a BIOS update or tweaking settings in the BIOS. Unfortunately, wake on LAN is far from reliable and unpredictable. It simply might not work right on your computer. – Appleoddity Aug 26 '17 at 06:08
  • Static ARP is only required when there's no other way to send a broadcast within the client's segment. A magic packet just contains FF:FF:FF:FF:FF:FF followed by 16x the WoL client's MAC address anywhere inside the packet. Usually, just put this in a UDP packet and send to 255.255.255.255. – Zac67 Sep 04 '17 at 20:30

1 Answers1

0

Since the unpowered destination machine will not answer to ARP requests, it's likely that the ARP cache just times out - the sender can't resolve the IP address and nothing is sent.

Because of this, the WoL magic packet is usually sent as a broadcast. As the switch's MAC table will likely have aged as well, a unicast WoL packet would effectively be sent as broadcast anyway.

A broadcast is only sent locally, so when you need to send a remote WoL you need to use either directed broadcasting or a static fake ARP entry on the destination router.

Directed broadcasting usually requires explicit enabling and can be tricky, depending on the equipment. A static ARP entry for e.g. 192.168.0.254 => FF:FF:FF.FF:FF:FF will send all IP packets to that IP as a local Ethernet broadcast, doing the trick. Of course, you only need one entry on each subnet you need to direct WoL to.

The static ARP trick can also be used to wake a device from the Internet: set up port forwarding for any obscure UDP port to the fake ARP IP address and send the WoL packet to the forwarded port on your router's public IP address.

Zac67
  • 8,639
  • 2
  • 10
  • 28