Linux – Wake On Lan doesn’t work after some time, how to solve this

linuxnetworkingwake-on-lan

Last week I installed Ubuntu and tried to get it to boot with Wake On Lan.

I rerouted all incoming packets at port 9 to the server. When it's the magic packet the server will boot. All went well until I tried it the next day from a different location. It wouldn't work. So I started Googling and did some tests and found out the server won't respond to the magic packet after x amount of minutes.

I've got telnet access to my router, if there is anything I need changed there.

Best Answer

If your router is configured to forward the WOL packet to your sleeping computer, it needs to be able to discover the computer's MAC address based on the IP address, which is what the ARP protocol does. However, with the computer off, ARP won't work, so once the router's ARP cache becomes stale the relevant entry is removed and you're out of luck (that apparently takes 20 minutes in your case).

Some routers let you configure this ARP mapping statically, or use the static IP configuration as an ARP mapping as well, or contain their own WOL tool to do the job (e.g. Tomato and DD-WRT firmwares) - you'll have to check yours to see if it's supported.

Another option is to forward the WOL packet to the broadcast address (such as 192.168.1.256, if that's your subnet's address), but this too is not supported on all routers.