Logicalwebhost Cheatsheet

Linux & Open Source Cheatsheets & Howto's

Skip to: Content | Sidebar | Footer

Wake on LAN (WOL) howto

You can send a command to a computer when it’s off to turn it on, if it’s ethernet port and BIOS are set to use Wake on LAN (WOL), so you can keep a computer off and turn it on remotely when you want to, like if you’re remote and want to login to your home network, turn a computer on, get some info. off it and then turn it back off. This HowTo is based on Debian/Ubuntu variants, but the pricinciples are the same no matter the OS, you just send a command and if the remote computer’s set up right, it just turns on.

Set up REMOTE computer

1. Boot your remote computer up and enter the BIOS

2. Every computer is different, but if equipped with this featured, you should see something that says Wake on LAN, enable that

3. Save the settings and boot the computer

4. Figure out the MAC address of it’s ethernet port adapter, it should be something like: 00:1a:bc:e2:ac:17 , you can do this on Linux by doing

sudo ifconfig

You need to write MAC address down, you’ll need it to configure your laptop next

Now you have to enable the feature in the OS, on Ubuntu/Debian you do that like:


cd /etc/init.d/
vi wakeonlanconfig

Okay, you created a new file, now put stuff in it:

#!/bin/bash
ethtool -s eth0 wol g
exit

and make it executable like:

chmod a+x /etc/init.d/wakeonlanconfig

and make it run automatically on boot:

update-rc.d -f wakeonlanconfig defaults

5. Now shutdown that computer and grab your LAPTOP, we’ll set that up now

Setup your LAPTOP to turn on the remote computer

1. Get the MAC address you wrote down from your remote computer

2. Install some software to do this, Windows has its own version, this next piece works for Ubuntu/Debian variants


apt-get install wakeonlan

now issue the command (with REMOTE computer shutdown, replace the MAC shown with the one you wrote down):

wakeonlan 0a:21:25:37:81:bb

Write a comment

You need to login to post comments!