Skip to content

Instantly share code, notes, and snippets.

@shayfrendt
Created December 30, 2009 04:00
Show Gist options
  • Save shayfrendt/265831 to your computer and use it in GitHub Desktop.
Save shayfrendt/265831 to your computer and use it in GitHub Desktop.
How to set up waking up a remote computer utilizing wake-on-lan from your local command line interface

Setup Steps

1. Enable wake-on-lan on the motherboard of the remote computer you’d like to wake up
2. Enable wake-on-lan within your router configuration for that same remote computer
3. Enable sshd within your router configuration

4. Add the following aliases to your .bash_profile, you’ll wanna have ’em later as shortcuts

alias router="ssh [email protected]"
alias wake="echo '/usr/sbin/wol -i 192.168.1.255 00:11:22:33:44:55' | pbcopy"

Make sure to update the ip address from “192.168.1.1” and the MAC address from “00:11:22:33:44:55” to their real values on your router and remote computer, respectively.

5. Open up Terminal from another computer

6. Run “wake” to copy the required command to your clipboard (you’ll use the contents in a moment):

wake

7. Run “router” to login to your router using ssh:

router

8. Paste from the clipboard to the router command line:

Command should look something like

/usr/sbin/wol -i 192.168.1.255 00:11:22:33:44:55

Thine remote computer shall arise!

Dependencies

My Stack

  • OSX 10.6.2 – utilizes Terminal to send “router” and “wake” commands
  • Windows Vista – computer I’m waking up
  • Linksys WRT150N Wireless Router
  • DD-WRT Firmware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment