Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Wake a remote Mac behind a router Internet
I wanted to be able to access my machine at home via SSH, but I didn't want to waste electricity to have it awake all the time and I didn't want it sitting there exposed to brute force password attempts. I came up with a way to use the wake-on-LAN feature from anywhere on the Internet, even though my Mac, like many, is behind a NAT router.

For those unfamiliar with wake-on-LAN: a specially-formed data packet containing your ethernet device's MAC address can be used to tell your computer to wake up. Most implementations of this functionality work only on your LAN. They send the packet to your TCP network's broadcast address so it goes to all the computers available on the local network. Only the one with the matching MAC address will actually wake up. However, I found a website that will send the magic packet for you to any IP address (and you could probably roll your own site using sample Perl scripts that are readily accessible via Google). So, here's how to make it work. Instructions are for the interface in 10.3 and 10.4, though this will work with any Mac OS version on any hardware that supports wake-on-LAN. And before anyone asks: yes, the computer must be connected via ethernet.

On the Mac to be woken up:
  1. Open Energy Saver preferences and, in the Options tab, enable "Wake for Ethernet network administrator access".
  2. Open Network preferences. Double-click the ethernet interface, then select the Ethernet tab. Write down the "Ethernet ID"; you'll need to have this with you when you attempt the wake. This Mac must be configured so that the IP address doesn't change. Using most home routers, the DHCP leases never expire anyway so this won't be a problem. Otherwise, the TCP/IP option "Using DHCP with manual address" is worth exploring.
On your router:
  1. Forward a port to the Mac you want to wake up. You'll need to do this anyway for whatever service you want to access (like port 22 for SSH). You do not need to open an additional port just for the wake feature.
  2. Take note of your router's external IP address. If it changes frequently, you'll need a way to keep an updated record of what it is (beyond the scope of this hint).
Now, to actually perform the wake:
  1. Go to http://www.depicus.com/wake-on-lan/woli.aspx.
  2. On the form, fill in the MAC address, IP, and port from above. I'm not sure if the MAC address needs hyphens like the example data does.
  3. For the subnet mask, fill in "255.255.255.255".
Submit the form, and your remote computer should wake up.
    •    
  • Currently 3.29 / 5
  You rated: 1 / 5 (7 votes cast)
 
[70,284 views]  

Wake a remote Mac behind a router | 20 comments | Create New Account
Click here to return to the 'Wake a remote Mac behind a router' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Wake a remote Mac behind a router
Authored by: azraq27 on Jun 10, '05 01:13:20PM
If you want to know how to keep track of you current IP, dynamic DNS has worked well for me (http://freedns.afraid.org/)

[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: GlowingApple on Jun 10, '05 05:57:05PM

I would also recommend:

www.dyndns.org
www.no-ip.com

---
Jayson --When Microsoft asks you, "Where do you want to go today?" tell them "Apple."



[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: atshoom on Jun 10, '05 02:43:43PM

there's this one too http://www.dslreports.com/wakeup



[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: Moebius on Jun 10, '05 03:51:09PM
Just download this: WakeOnLan.
It's freeware and do all work without the need to use external web sites.

[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: malarkey on Jun 10, '05 05:10:11PM

Yeah, but it looks like that's for sleeping computers on the same LAN as the one you're currently on. This hint is more for people that want to wake up their Mac remotely via the Internet like if you wanted to access your home computer from the office or a friend's house but it's asleep.



[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: jens klausen on Jul 18, '10 03:46:47PM

So it seems.
But actually it works over the internet if you manually add the host with IP-Address and Ethernet-ID.
I use it for remotely waking an iMac behind a NAT that i have to access for screensharing.



[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: Lectrick on Jun 11, '05 11:51:21PM

Believe it or not, some people are forced to use a PC at work, and this solution won't work =( The poster's idea is good.

---
In /dev/null, no one can hear you scream



[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: drei on Jun 14, '05 09:01:58AM
That's my problem as well.
But look, I found this: WOL Manager Professional

[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: bukweet on Jun 10, '05 05:03:54PM

This does not work if you are behind an Airport router, even if you're hard wired via the ethernet port.

The Airport router does not forward the "wake-up" packet.


---
bukweet



[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: padrino121 on Jun 10, '05 11:03:20PM

If the router implements port forwarding correctly any old port shouldn't allow a WOL packet into the network (read big security hole). WOL is a UDP packet sent to port 9 and with a proper router you would need to forward UDP/9 to the system you want to wake up.



[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: spirp on Jun 11, '05 06:48:18PM

Actually, that's only partially true. A wake on lan frame can be embedded in any protocol and is nothing more than a specific stream of data. It's composed of 6 bytes 0xff followed by the MAC-address (ethernet address) repeated at least 16 times, ie

ffffffffffff001122334455001122334455001122334455
001122334455001122334455001122334455001122334455
001122334455001122334455001122334455001122334455
001122334455001122334455001122334455001122334455
001122334455

to wake a computer with the MAC-address 00:11:22:33:44:55. The first six bytes are for syncronization, and the rest identifies the computer. This can, as I said, be embedded in any protocol, or, for that matter, as a raw ethernet frame. UDP-packets seems to be the most common solution though, probably because it's simplicity.

Anyway, it ought be quite difficult to detect this kind of data stream (at least without false positives), and as far as I can tell, it's possible to insert a packet (ie TCP-packet) containing the magic string through a firewall. This, of course, may or may not be the case in the hint :)



[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: Izzard on Jun 13, '05 06:18:35AM

My iBook is connected to the Internet wirelessly, but I wanted it off when I wasn't using it, too. What I do is leave the modem cable connected and enable "wake on modem ring". Then, when I want to wake the iBook up so I can SSH in to it, I ring my house.



[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: victory on Jun 19, '05 04:58:49PM

You Sir (or Madam) are brilliant.

I've never been entirely comfortable with the thought of sending WOL packets across the Internet (particularly since the mechanism was really designed for intranets and lacks any form of authentication) except with a VPN router, but the idea of using a POTS ring just to wake a sleeping Mac is perfect!

Not only is the wakeup signal (ring) kept safely 'out of band' with the SSH connection itself, but I'm thinking it may even be possible to target the Mac so that it only wakes up when specifically selected. How? By using one of those 'comm-share' boxes that allows you to re-direct incoming calls/rings by sending a touch-tone sequence during the initial ring. (These boxes are often used to share an incoming line between a phone, answering machine, fax and modem)



[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: lee12345 on Sep 02, '05 04:17:02PM

OK...i just spent 3 or 4 hours trying to figure this remote wake up problem out. Timbuktu is useless without being able to wake up my sleeping office computer. It amazes me that a product that complex CAN NOT do this (i just called and confirmed this). It has to be nearly 100% of their users have this problem. Hell, that's what the program does is remote communication.

So about an hour ago I got this modem idea...and then saw this post. Hell, this is my next thing to do when I get back to the office: hook up my old phone line to the modem. Duh.

I have iChat running and can see if my computer wakes up or not :)

---
:)



[ Reply to This | # ]
Password?
Authored by: nyanko on Jun 22, '05 03:09:41PM

This is a great thread, but I was wondering if anyone knows how to make WOL work when you have OS X set to "Require password to wake this computer from sleep or screen saver" in the Security control panel. When the password setting is on, waking the machine just shows a login screen, and it quickly falls back asleep when I have no way of entering the password from my remote connection.

I feel like I shouldn't have to give up security just so I can wake the machine...



[ Reply to This | # ]
Password?
Authored by: ADent on Jul 16, '05 03:43:57AM

Any solution to the fall back asleep after 30 seconds when a password is set - besides no password or no sleep?



[ Reply to This | # ]
Password?
Authored by: ringo999 on Aug 28, '05 03:31:06PM

isnt your MAC address protection enough?



[ Reply to This | # ]
Fix
Authored by: Citizen Nate on May 08, '07 04:10:27AM
I'm currently running a few services from my computer for others to use, so I turned off automatic sleep altogether. I needed a similar level of client security, so I decided the best way to lock my computer was to go to the login window. I downloaded WinSwitch (http://wincent.com/a/products/winswitch/) to create a shortcut to login window and Ciao (http://lorenb.com/software/ciao/) to automatically go to login window after a period of inactivity. You can use this setup while leaving your computer awake or asleep with the same client security.

[ Reply to This | # ]
Wake a remote Mac behind a router
Authored by: briank on Dec 20, '05 10:14:41PM
Here's the perl script that will send a correctly-formatted UDP packet that was alluded to in the original hint:

http://www.securiteam.com/securitynews/5XP031F0BM.html

I was successful in waking my G5 PowerMac, but neither of my iBooks appear to respond (even after shutting down the firewall, setting the correct options, plugging in the adapter, etc.)

[ Reply to This | # ]

Wake a remote Mac behind a router
Authored by: pisosse on Jul 11, '07 01:13:57AM

is it this perl script that would let you build a wake function on your own website(like dslreport, just with fixed addys in a single button) and if so.. any hints on how to incoporate it in a html/flash site?



[ Reply to This | # ]