Remote Wake-Up of a Home Computer

TL;DR ✨

The situation is simple. Someone is somewhere out in the world, while their computer at home is switched off. The first option is to call someone who could stop by and turn it on, but that cannot always be relied upon. That is why Wake-on-LAN (WOL) exists. This feature makes it possible to wake a sleeping computer remotely while it remains connected to mains power.

Before WOL can be used, it is first necessary to find out whether the motherboard supports remote wake-up.

From the archive

This article was first published on 2017-06-19. It is also a snapshot of its time, so some details and recommendations may no longer reflect the current situation.

The situation is simple. Someone is somewhere out in the world, while their computer at home is switched off. The first option is to call someone who could stop by and turn it on, but that cannot always be relied upon. That is why Wake-on-LAN (WOL) exists. This feature makes it possible to wake a sleeping computer remotely while it remains connected to mains power.

Before WOL can be used, it is first necessary to find out whether the motherboard supports remote wake-up.

First, enter the BIOS and check that WOL is enabled (Enable):

WakeOnLan BIOS setting Taken from: https://www.howtogeek.com/70374/how-to-geek-explains-what-is-wake-on-lan-and-how-do-i-enable-it/

Then log in to the PC and enter the ifconfig command in the terminal:

ifconfig—interface on the PC

This reveals the designation of the PC's Ethernet port.

Now enter the command that displays details about the Ethernet port. In this particular case:

sudo ethtool eth2

(If ifconfig listed, for example, eth0, the command above will be sudo ethtool eth0.)

ethtool—command-line output The most important part is "Wake-on:". The letter indicates how WOL is enabled.

The possible output values are listed here:

pWake on PHY activity
uWake on unicast messages
mWake on multicast messages
bWake on broadcast messages
aWake on ARP
gWake on MagicPacket™
sEnable SecureOn™ password for MagicPacket™
dd Disable (wake on nothing).

The goal is to wake the PC using magic packets, so the following command is required:

ethtool -s eth2 wol g

Next, determine this computer's MAC address. In the ifconfig output it appears under "HWaddr"—in this case: 6c:62:6d:eb:4a:a3

Install the wakeonlan or wol program on another machine with the command:

sudo apt-get install wakeonlan
sudo apt-get install wol

The command for waking the remote computer will then look like this:

wakeonlan 6c:62:6d:eb:4a:a3

The WOL command can also be secured appropriately, for example with a password following this pattern:

# ethtool -s ethX wol g sopass 11:22:33:aa:bb:cc
$ wol --passwd=11-22-33-aa-bb-cc 00:4F:49:07:0B:5F

With these instructions, a PC can easily be switched on within the internal network—that is, from another computer on the internal network while at home.

To switch on a home PC when there is a MikroTik on the roof, it is enough to have the provider configure port forwarding to the antenna's IP address for the Winbox/SSH/Telnet port. This provides remote access to the antenna; under System – Scripts, add the following script to be run:

tool wol interface=ether1 mac=6c:62:6d:eb:4a:a3

MikroTik WOL script Then simply run the script and the PC at home will start.