Page 1 of 1

Wake On LAN

Posted: Sun Feb 22, 2009 4:18 pm
by notfred
Just setup Wake On LAN on my wife's PC so I can power it up to run a backup without having to run around the house. Thought the following might be interesting to others.

1) Setup the hardware - older PCI network cards may require a little cable from the card to the motherboard, onboard adaptors don't.

2) Setup the BIOS - enable WOL in the BIOS, usually under the Power->APM screen, may be a separate entry or covered by something like "Allow PCI/PCIe devices to wake the PC"

3) Check the driver supports WOL, as root run
ethtool eth0
and look for
   Supports Wake-on: g
   Wake-on: d
The "g" means it supports "MagicPacket" WOL (extra letters mean other methods as well, don't worry about those), the "d" means it is disabled at the moment. To set this to enabled on every boot put
ethtool -s eth0 wol g
in /etc/rc.local and also run that command now.

4) Stop the kernel from powering off the network card at shutdown. Most distributions call "halt" with the "-i" parameter at the end of the shutdown scripts. That "-i" powers off the network card. Under Ubuntu we can stop this by editing /etc/default/halt as root
# Default behaviour of shutdown -h / halt. Set to "halt" or "poweroff".
HALT=poweroff

# Enable WOL
NETDOWN=no

5) Find the MAC address of the system by running
ifconfig eth0
and looking for
HWaddr 00:17:31:83:a0:f5
Make a note of it somewhere

6) Power down the machine and check the lights on the network interface are still on.

7) On the machine that will boot up the other one, install "wakeonlan" e.g.
sudo apt-get install wakeonlan


You can now do
wakeonlan 00:17:31:83:a0:f5
and it should power up. If you have an nVidia motherboard that uses the "forcedeth" driver, you may need to reverse the MAC address to
wakeonlan f5:a0:83:31:17:00
The kernel guys keep getting it wrong in the driver, it was broken in 2006 and it was also broken again last year unfortunately right when Ubuntu 8.10 was released.

Re: Wake On LAN

Posted: Tue Feb 24, 2009 12:11 pm
by Usacomp2k3
Thanks for detailing that. I've always wanted to get WoL to work right, but haven't really ever looked into it.

Re: Wake On LAN

Posted: Sun Mar 01, 2009 12:18 am
by way2strong
good stuff man, thanks for the post