Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

g-boac

macrumors 6502
Original poster
Oct 7, 2007
291
1
How can I remotely wake a sleeping Mac?

For example, if I have .mac/Mobile-Me "Back to My Mac" set up on my home iMac and work MacBook, and I am on the road, is there a way for me to wake the sleeping iMac remotely, either via "Back to My Mac", or a Terminal command?

thanks,
Mark
 
You can if wired and you have another computer or server running on the same network. I'm not sure if wakeonlan works from another subnet. I have done it before, but I have a linux server always running and ssh into it and issue the wake command.
 
You can also set up a port forward (or 'PAT') mapping of incoming traffic on your router on UDP port 9 to the broadcast address of your subnet, if your router supports that. Then you can use the wakonlan utility over the Internet.
 
You can if wired and you have another computer or server running on the same network. I'm not sure if wakeonlan works from another subnet. I have done it before, but I have a linux server always running and ssh into it and issue the wake command.
Hi James,

If I understand you right, I would have to have a computer (or server) that's on the same network that is awake; if I was at work, or on the road, I would be on a different network, and thus unable to issue the wake command?

My Time Capsule is always on, am I able to contact the Time Capsule, and issue the wake command through it to the iMac?

thanks,
Mark
 
You can also set up a port forward (or 'PAT') mapping of incoming traffic on your router on UDP port 9 to the broadcast address of your subnet, if your router supports that. Then you can use the wakonlan utility over the Internet.
Hi Beerfloat,
I have an AEBS at home connected to the iMac at home, and a Time Capsule at work. Does it support this? And I'm having a little bit of trouble following what you're suggesting I do, can you elaborate a bit on what I'm trying to achieve wit this PAT mapping and UDP?

thanks,
Mark
 
Hi Beerfloat,
I have an AEBS at home connected to the iMac at home, and a Time Capsule at work. Does it support this? And I'm having a little bit of trouble following what you're suggesting I do, can you elaborate a bit on what I'm trying to achieve wit this PAT mapping and UDP?

thanks,
Mark

Can't say for sure that it works on an AEBS. Same for the wireless. Some do, but chances are a lot better with wired networks.

Normally you would send a WoL packet on a LAN as a broadcast UDP on port 9. So basically you'd be sending the packet to 255.255.255.255:9 and all devices on your subnet will receive it, including your sleeping Mac. You can also specify a more limited broadcast address like, say, 192.168.1.255. You could even send it to a unicast address, but when the computer has been asleep for a while its IP address tends to disappear from ARP caches and that'll stop working. So basically, we wanna send it to a broadcast address.

Almost all routers will allow you to set up a list of static forwarded ports from the outside interface to the inside interface. But not all will allow you to set a broadcast address as internal target.

Say your external IP address is 10.1.1.1 and your MAC is on an internal LAN with IP address 192.168.1.20. What you'll need to do is set up a port forward 10.1.1.1:9 to 192.168.1.255:9.

Then use wakeonlan or a utility like that from the outside like so:
wakeonlan -i 10.1.1.1 00:de:ad:be:ef:40 (ie MAC address of your card)

If your router supports it, I would map some higher port number on the outside to 9 on the inside. Don't necessarily want outside port scanners to know what you're doing.

So say have a mapping 10.1.1.1:23456 to 192.168.1.255:9
wakeonlan -i 10.1.1.1 -p 23456 00:de:ad:be:ef:40
 
It's impossible to wake a computer over wireless. Why? The AirPort card shuts off when the computer sleeps. Unlike the ethernet port, the card requires significant power to remain connected to the network.
 
It's impossible to wake a computer over wireless. Why? The AirPort card shuts off when the computer sleeps. Unlike the ethernet port, the card requires significant power to remain connected to the network.

I was worried that'd be the case with airports, but it's not impossible per se. Any Intel wireless card models 3945 and up can do this.
 
I was worried that'd be the case with airports, but it's not impossible per se. Any Intel wireless card models 3945 and up can do this.
These are not built into any Macs as part of their native chipsets, are they?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.