Wake On LAN

Where Penguins and Daemons chill together in the warmth of the Sun.

Moderators: SecretSquirrel, notfred

Wake On LAN

Postposted on Sun Feb 22, 2009 4:18 pm

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
Code: Select all
ethtool eth0
and look for
Code: Select all
   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
Code: Select all
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
Code: Select all
# Default behaviour of shutdown -h / halt. Set to "halt" or "poweroff".

# Enable WOL

5) Find the MAC address of the system by running
Code: Select all
ifconfig eth0
and looking for
Code: Select all
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.
Code: Select all
sudo apt-get install wakeonlan

You can now do
Code: Select all
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
Code: Select all
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.
Maximum Gerbil
Posts: 4154
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: Wake On LAN

Postposted on Tue Feb 24, 2009 12:11 pm

Thanks for detailing that. I've always wanted to get WoL to work right, but haven't really ever looked into it.
Gerbil God
Posts: 21396
Joined: Thu Apr 01, 2004 4:53 pm
Location: Orlando, FL

Re: Wake On LAN

Postposted on Sun Mar 01, 2009 12:18 am

good stuff man, thanks for the post
Posts: 46
Joined: Fri Jun 27, 2008 7:07 am

Return to Linux, Unix, and Assorted Madness

Who is online

Users browsing this forum: No registered users and 2 guests