You need to use the 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).
Method #1: Install wakeonlan using Homebrew
Open the Terminal app and type the following command:
brew install wakeonlan
Method #2: Download and install wakeonlan Perl script
Open a terminal and type the following curl command:
$ mkdir -p $HOME/bin
$ curl https://raw.githubusercontent.com/jpoliv/wakeonlan/master/wakeonlan -o ~/bin/wakeonlan
$ chmod +x ~/bin/wakeonlan
How do I send WOL on a 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
Sending magic packet to 255.255.255.255:9 with 00:08:9b:c4:30:30
-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:
Make sure you select the option “Wake for network access” so that other users can wake up your computer using WOL magic packet.
- See wakeonlan command man page for more information.
- Download Wakeonlan: Perl script for waking up computers via Wake-On-LAN magic packets
- HowTo: Wake Up Computers Using Linux Command [ Wake-on-LAN ( WOL ) ]