Overview
This is a quick tutorial on how to enable WOL on your your Linux machine.I know that cloud has been out there for a while now, there are lots of cheap or even free processing providers, but if you ever need to use your own old PC as a remote server this is something you will be interested in. Why use your PC as a server? Because it doesn’t cost you anything and you can configure it any way you want. Also there is no need to leave it ON, you can always start it remotely using WOL. Please note that wol does not work with wireless, with some exceptions(very rare).
Bios setup
If you havent already, go to your BIOS, and turn on WakeOnLAN. Be aware, not all motherboards support WOL
Network setup
Find your network device that you will use. Most of the times it will be eth0.
Startup script
Create a new startup script. You need to be root or use sudo.
Run at boot
Make the script executable and make sure it runs at startup. Depending on your distribution there are various ways to make it run at boot. I am using update-rc.d for this example, but it could be chkconfig …
Test the script
Next run the script and make sure you don’t have any errors. Make sure you note down the mac address of the network device. You cand see it in the output of ifconfig command or ping the server from another computer and check the arp table: arp
Wake computer
You can now shut down the server and wake it up from another computer using wakeonlan. You can find wakeonlan tool on almost any distribution repository(apt-get install wakeonlan -y …)
Please replace 01:23:45:67:89:ab with your MAC addess you have from step 5.
You might want to wake your computer from internet, in that case you need to set up some settings on your home router.
-
First you need to enable port forwarding and forward port 9 to your server
-
Second make sure you set up DynamicDNS, so you will always know your router’s address. Depending on your ISP plan you might get a different IP everytime your rooter disconnects . No-IP is a very good DynDNS provider and it’s also free.