Mac OS X: Wake Up Servers Using Wake-on-LAN ( WOL ) Command Utility

by on June 9, 2013 · 3 comments· LAST UPDATED June 9, 2013

in , , ,

I know how to send WOL command using Linux or FreeBSD wake command. But, how do I send Wake on LAN (WOL) frames to hosts on a local Ethernet network using Apple OS X operating systems to wake up my servers or nas devices?

Tutorial details
DifficultyIntermediate (rss)
Root privilegesNo
RequirementsPerl
Estimated completion time5 minutes
You need to use wakeonlan Perl script that generates and transmits a Wake-On-LAN (WOL) "Magic Packet", used for restarting machines that have been soft powered-down (ACPI D3-warm state).

Download wakeonlan

Open a terminal and type the following curl command:
$ cd /tmp
$ curl http://gsd.di.uminho.pt/jpo/software/wakeonlan/downloads/wakeonlan-0.41.tar.gz -o out.tag.gz

Untar the tar ball with the help of tar command, enter:
$ tar xvf out.tag.gz
Sample outputs:

x wakeonlan-0.41/
x wakeonlan-0.41/README
x wakeonlan-0.41/Makefile.PL
x wakeonlan-0.41/META.yml
x wakeonlan-0.41/SIGNATURE
x wakeonlan-0.41/Changes
x wakeonlan-0.41/MANIFEST
x wakeonlan-0.41/examples/
x wakeonlan-0.41/examples/lab001.wol
x wakeonlan-0.41/wakeonlan

Install Perl script

Type the following mkdir command:
$ mkdir ~/bin/
Copy /tmp/wakeonlan-0.41/wakeonlan to ~/bin/ directory with the cp command:
$ cp /tmp/wakeonlan-0.41/wakeonlan ~/bin/

How do I send WOL on OS X?

The syntax is:
$ ~/bin/wakeonlan server-mac-address-here
For example, if nas01 server has 00:08:9b:c4:30:30 mac address, enter:
$ ~/bin/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

Other options

 
    -i ip_address
        set the destination IP address
        default: 255.255.255.255 (the limited broadcast address)
    -p port
        set the destination port
        default: 9 (the discard port)
    -f file
        uses file as a source of hardware addresses
 

Apple computer wake for network access (WOL) setting

If you want other users to be able to access your Apple OS X based computer’s shared resources, such as shared printers/files/folders or iTunes playlists, even when your computer is in sleep mode. Open System Preferences > choose "Energy Saver preferences". This set options that control your computer’s energy use including WOL for all Mac Based server and client systems:

Fig.01: OS X setting WOL

Fig.01: OS X setting WOL

Make sure you select the option "Wake for network access" so that other users can wake up your computer using WOL magic packet.

References
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 3 comments… read them below or add one }

1 meow June 10, 2013 at 2:45 pm

Or you can just install brew or macports to have wol

Reply

2 Simon May 30, 2014 at 10:07 am

Well that was easy, thank you!

Using to WOL HP Proliant DL380

Reply

3 ManT November 24, 2014 at 9:31 am

I was under the assumption that wake-up / power-on is not possible when a Mac machine has been “powered-off” or “hibernated”. It is only possible to wake-up a Mac machine from “Sleep”.

This got me interested but somehow the link for the utility provided on this page is not working: http://gsd.di.uminho.pt/jpo/software/wakeonlan/downloads/wakeonlan-0.41.tar.gz

Can someone provide me the right link?

thanks in advance.

Reply

Leave a Comment

Tagged as: , , ,

Previous Faq:

Next Faq: