Updated on | #mac, #network, #cronjob | 0 User comments

Wake Up On Lan, Wake-on-LAN or WOL in Ubuntu or Debian

The advantage of the Wake-on-LAN (WOL) function is, that client systems can be remotely and automatically powered up in a local network by sending a special data packet, which is called "Magic Packet". Even if the computer is turned off, the network adapter is still "listening" on the network, so when the special packet arrives, the network adapter can turn on the computer. In this tutorial, I will show you how you can realize this in a Ubuntu or Debian environment.

Computers

You have to collect all PC MAC's in your Network. E.g.:

  1. PC1 00:26:18:32:26:94
  2. PC2 00:19:99:cc:90:81
  3. ...

Install Wakeonlan

You have to install WakeOnLan in Ubuntu

  1. sudo apt-get install wakeonlan

and to edit /etc/wakeonlan_mac.conf in order to insert all the MAC addresses‎:

  1. 00:26:18:32:26:94
  2. 00:19:99:cc:90:81
  3. ...

After this you can start WOL with

  1. wakeonlan -f /etc/wakeonlan_mac.conf

Create Cronjob

Go to /etc/cron.daily and create a new file:

  1. sudo nano /etc/cron.daily/wakeonlan
  1. #!/bin/sh
  2.  
  3. wakeonlan -f /etc/wakeonlan_mac.conf

After this make this file runable in order to test it:

  1. sudo chmod +x /etc/cron.daily/wakeonlan

Well, what do you think?

Comments powered by LudwigDisqus for ModX