Table of Contents
Wake-on-LAN (or WOL) is a standard by which a machine can be powered on remotely via a network connection. This is done by sending a so-called magic packet to the network card of the remote machine. When properly configured, the remote machine will then boot.
Configure the BIOS
The Wake-on-LAN option must be enabled in the BIOS. Unfortunately these settings are not standardized. Check the motherboard documentation. Browse the BIOS menu. The option may not be called Wake-on-LAN, but something like 'Power On By PCI Device'. This varies greatly from board to board and some experimentation may be needed.
Configure the network card
Assuming the first network port is connected, use
ethtool to check the card settings:
# ethtool eth0 | grep -i wake-on Supports Wake-on: pg Wake-on: d
The supports line shows all options that are supported on the card. The option to look for is g, which means wake on magic packet. If the g option is not present, you are out of luck.
The Wake-on line shows the current options in use. If this shows d, it means wake-on is currently disabled.
To enable wake-on, use
# ethtool -s eth0 wol g
This will most likely not survive a reboot, so to switch this option on again at the next boot, add the command to
echo "Setting Wake-on-LAN to Enabled" /usr/sbin/ethtool -s eth0 wol g
Finally, we need to note the MAC address of the network card we just prepared:
# ip addr show eth0 | grep -i ether link/ether 20:cf:30:1f:e3:a4 brd ff:ff:ff:ff:ff:ff
Waking up the machine
Now we need a special command on a different machine to send a magic packet. The
wol command is available from slackbuilds.org. This can be called by a regular user. At a minimum it needs the MAC address of the remote machine; for example:
$ wol 20:cf:30:1f:e3:a4
On a multihomed host, like a router, use the host option to specify the hostname or ip address of the remote host. This will broadcast the magic packet on the correct subnet:
$ wol -i hostname 20:cf:30:1f:e3:a4
- Originally written by Frank Donkers