Just a quick reminder for myself: You need to enable wake-on-lan on the nic in most linux distributions via ethtool.
If your nic supports WOL, it probably needs to be enabled in your computers BIOS first.
Most WOL tools use the “MagicPacket(tm)” method, so the right command to enable it on the nic “eth0″ would be
ethtool -s eth0 wol g
This is not a persistent setting and it is gone after a reboot. Most tips around recommend creating a runlevel script for executing this command after boot or before shutdown.
I’ve added the command as a hook in my network scripts:
auto eth0 iface eth0 inet dhcp pre-down ethtool -s eth0 wol g
You can also use post-up. I like this method because i tend to forget about my runlevel scripts and so i keep the network stuff in one place 😉
If you are a debian user, you maybe need to stop your system from turning off the nic on HALT. To do so, add