Ubuntu Linux: Install Wake On Lan Client For Server

Posted on in Categories , , last updated May 10, 2013

How do I install wake on lan client under Ubuntu Linux desktop to wakeup Unix or Linux based servers?

You need to install wakeonlan perl script to wake up computers or servers. This utility sends magic packets to wake-on-lan enabled Ethernet adapters and motherboards. You need to use this to turn on the PC or server. Please note that this will only work if the NIC with the motherboard enabled with the WOL function in the BIOS.

Ubuntu wake on lan client installation

Open a terminal and type the following command:
$ sudo apt-get install wakeonlan
Sample outputs:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  wakeonlan
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.4 kB of archives.
After this operation, 73.7 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu/ precise/main wakeonlan all 0.41-10 [11.4 kB]
Fetched 11.4 kB in 0s (24.8 kB/s)    
Selecting previously unselected package wakeonlan.
(Reading database ... 193608 files and directories currently installed.)
Unpacking wakeonlan (from .../wakeonlan_0.41-10_all.deb) ...
Processing triggers for man-db ...
Setting up wakeonlan (0.41-10) ...

How do I use wakeonlan client?

The syntax is

wakeonlan server-mac-address-here
wakeonlan [options] server-mac-address-here

Examples

Type the following command to wakeup a nas server called nas01 with 00:08:9b:c4:30:30 as mac address, enter:
$ wakeonlan 00:08:9b:c4:30:30
Sample outputs:

Sending magic packet to 255.255.255.255:9 with 00:08:9b:c4:30:30

To use a subnet broadcast address:
$ wakeonlan -i 192.168.1.255 00:08:9b:c4:30:30
You can use another destination port:
$ wakeonlan -i 192.168.1.255 -p 2345 00:08:9b:c4:30:30
Finally, you can use a file as source of hardware and IP addresses:
$ wakeonlan -f ~$HOME/.admin-data/racks/dc05.floor03.wol

See also

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

Leave a Comment