intertwingly

It’s just data

Wake on LAN


One of the issues with running remotely is this flat out doesn’t work if the remote machine is suspended or powered off.  As the summer months approach, power management is increasingly important, particularly in North Carolina, and particularly in a house where the office is in a finished attic.

Booting a machine is possible remotely, but it takes a series of steps to set up, but I managed to muddle through it.

First, I need to enable the function in the BIOS, by pressing F2 on startup, selecting “Power Management Setup” and enabling “Resume by PCI PMC”.

Next I needed to gather some details using ifconfig (like Joe, I missed the memo).  The information I needed was the name of the device, (eth0), the HWaddr (of the form 00:00:00:00:00:00), and the Bcast address (191.168.1.255).

Next, I verified what the hardware supports by entering sudo ethtool eth0.  In my case it said “Supports Wake-on: g” and “Wake-on: d”.  Translated this apparently means “MagicPacket support is available, but is currently disabled”.  It turns out that enabling wake on LAN is something that you need to do each time you boot, so I created a file named /etc/network/if-up.d/wake-on-lan with the following contents:

#!/bin/sh
/usr/sbin/ethtool -s eth0 wol g

I then restarted the network with

/etc/init.d/NetworkManager restart

At this point, I was (finally!) set up. I can suspend, hibernate, or outright shutdown that machine.

On the remote machine (in my case an eee), I installed wakeonlan, and created a small script:

wakeonlan -i 191.168.1.255 00:00:00:00:00:00

I’ve heard reports that this doesn’t work over wireless, but I had no problem.  I presume that this would have to do with your specific network topology as this is operating at the LAN level.

For options other than g, etherwake may be of interest.