This article deals with Wake-on-LAN (wol, wake on lan), what it is, how it can be used from an Arch Linux computer, and its general uses. Basically put, Wake-on-LAN, otherwise known as 'wol' is the ability to switch on a computer that is connected to a network (be it the internet or intranet). This can be a very useful ability.

It is important to note that Wake-on-LAN applies to the computers being physically connected (ie, not wireless).

Does my motherboard support Wake-on-LAN?

For Wake-on-LAN to work, the target computer motherboard must support this feature. Generally speaking, the Wake-on-LAN (non)ability of the target motherboard will be specified by the hardware manufacturer. Sometimes, this ability is evident by browsing through said motherboard's BIOS and looking for something like 'PCI Power up'. Most modern motherboards should support Wake-on-LAN.

Ensure that Wake-on-LAN is enabled and survives a reboot

A common problem with the Wake-on-LAN in computers running Linux is that the network drivers have Wake-on-LAN switched off by default. To manually switch on the Wake-on-LAN feature on your driver, you'll need ethtool:

# pacman -S ethtool

First query the driver to see if it's defaulted to 'on' by using ethtool:

# ethtool eth0 | grep Wake-on
Supports Wake-on: pg
Wake-on: d

Note: We need a 'Wake-on' value of 'g' for WOL to work.

To enable the wol feature in the driver, simply run the following

# ethtool -s eth0 wol g

This command does not last beyond the next reboot. If using netcfg, one can make this setting persistent by adding the following to

/etc/network.d/PROFILE

POST_UP='/usr/sbin/ip link set eth0 mtu 4000'

If for some reason, you find that after using the command to switch your network drivers Wake-on-LAN feature on, the computer shuts down normally but then starts again, experiment with combinations of [u/b/m]g

Across your intranet/network (router)

When you send the MagicPacket signal to the target computer via a specific port, the signal passes through your router. The router must be instructed to forward any signal heading for that specific port to the internal IP of the target PC.

It is recommended that for multiple computers connected to one computer, to assign a different port forward to each internal IP

For port forwarding help, please consult http://portforward.com/ (though this website has some Windows specific content, it has a very large database of router web interfaces)

Across the internet

Assuming that you know the external IP of the target machine, and that the router ports on both sides have been forwarding correctly, then this should be exactly as the syntax states.

Usually it is necessary to forward your wol port (typically UDP 9) to the broadcast address on your network, not to a particular IP. Most routers do not allow you to forward to broadcast, however if you can get shell access to your router (through telnet, ssh, serial cable, etc) you can implement this workaround:

ip neighbor add 192.168.1.254 lladdr FF:FF:FF:FF:FF:FF dev eth0

(The above command assumes your network is 192.168.1.0/24 and use eth0 as network interface). Now, forward UDP port 9 to 192.168.1.254. This has worked for me on a Linksys WRT54G running Tomato, and on the Verizon FIOS ActionTec router.