WOL – Wake On Lan over internet

dd-wrtwake-on-lan

My problem has become pretty specific but probably pretty easy to solve.
I've followed numerous guides on the internet to setup wake on lan and managed to get it working quite good although I still have one issue.

I can wake up my computer via LAN and even over 3G, but when I'm sending over 3G I can only send about a minute or two after I shut down the computer (might be longer), but if it takes much longer my computer won't boot.

The guides mentioned something about the router forgetting my MAC address after some time, but if that is the problem, should it work over a private network?, and how do I resolve this issue?

I've installed DD-WRT on my DIR-615 router.
The computer I want to wake up is running Windows 7 Ultimate.

Best Answer

WoL works by sending a specially formatted ethernet packet to the MAC address of your computer. If you are on the local network (the LAN) you can communicate direct with your computer's MAC address and WoL works all the time quite happily.

From anywhere outside the local network you rely on IP routing to forward IP encapsulated packets through the network to get to your computer. This forwarding relies on ARP (Address Resolution Protocol) at the final hop (your router to your computer).

Your router keeps a record of which IP addresses are mapped to which MAC addresses - the ARP table - which periodically has stale entries purged.

Under normal network operation the router first sends an ARP WHOHAS packet to all the computers on the network (MAC address ff:ff:ff:ff:ff:ff) requesting the computer that has the IP address specified in the packet to respond with an ARP HAS packet stating that it has the IP address in question. This gets cached in the ARP table for a period of time.

If the computer is switched (or asleep) the network stack can no longer respond with anything, so the ARP WHOHAS request never succeeds - so the router cannot work out where to send the packet to - hence WoL then fails.

There are 2 possible ways around this problem:

  • Set up a static ARP entry on the router

This is by far the simplest if the router has the ability to store a MAC->IP mapping permanantly. This will remove the need for ARP to try and discover the MAC address of your computer.

  • Have another network device on the local network that never sleeps and is able to perform the WoL for you.

Seems to defeat the object really, but it may be the only way to do remote-WoL.

Related Question