The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Networking (http://hintsforums.macworld.com/forumdisplay.php?f=14)
-   -   remote wake from sleep (http://hintsforums.macworld.com/showthread.php?t=9505)

JayBee 02-18-2003 04:45 AM

remote wake from sleep
 
Hi Guys,

I left my G4 sleeping today when I went to work. Is there any way to remotely wake it up?

I noticed that the Sys Prefs have a "wake for admin access" setting, which I'm pretty sure I left on. Does this mean I can just SSH in and the machine will wake up?

Please advise - I need my mail!

momerath 02-19-2003 08:19 PM

I wish I knew. Whenever I try to SSH to a sleeping mac, it responds with a "host is down" message. I tried searching versiontracker for a program that might remotely wake it up but was unsuccessful.

nick2588 02-19-2003 08:48 PM

Re: remote wake from sleep
 
Quote:

Originally posted by JayBee
I noticed that the Sys Prefs have a "wake for admin access" setting, which I'm pretty sure I left on. Does this mean I can just SSH in and the machine will wake up?
Are you actually sure the option is there? I thought it was removed in OS X and is only in Classic... I wonder if booting into Classic, enabeling the option, then booting back into X will allow SSH to wake your Mac?

Or prehaps a Wake-On-LAN utility could wake the sleeping Mac. I don't know exactally how you could send a Wake-On-LAN signal through the Internet

I've have this problem too, and I would like a solution as well.

momerath 02-19-2003 09:22 PM

No, the option is there in 10.2. No need to boot into classic.

mervTormel 02-19-2003 09:50 PM

there is WakeUp, which i believe can send womp (wake on magic packet) to a snoozer

http://www.coriolis.ch/article18.html

momerath 02-19-2003 10:16 PM

Excellent! This is exactly what I needed. Thanks.

JayBee 02-20-2003 03:06 AM

Hmm. Nope.

I'm looking for a method that will let me wake up my machine from work - where we're stuck in the dark ages of win95 (I'm not kidding).

SURELY there's a way to do it? Or will pinging my machine wake it (as the above link seems to imply)?

hschickel 02-20-2003 03:57 AM

Typing: "Wake On Magic Ping" (WOMP) in google gives a number of interesting hits including these 2:

http://pages.towson.edu/aczech/magicpkt/

http://gsd.di.uminho.pt/jpo/software...i-howto-2.html

Googling: "Wake On Magic Packet" (WOMP) gives even more interesting avenues.

I haven't worked through the particulars but it seems you could do this yourself with a little research.

Hugh

Phil St. Romain 03-03-2003 09:41 AM

Quote:

Originally posted by mervTormel
there is WakeUp, which i believe can send womp (wake on magic packet) to a snoozer

http://www.coriolis.ch/article18.html
Good find! :)

This works great on my LAN, but I don't see how it can be configured to work over the Internet. That ethernet address is seen only on the LAN, right?

Has anyone found a way to do remote wakeup of a Mac on a LAN via the Internet? I don't use a modem for FAXing so that's not an option.

UltraNurd 03-03-2003 03:39 PM

I use wakeonlan from a *nix terminal, but it's fairly hit and miss success-wise. Part of the problem is that if my powerbook is closed, it will fall asleep again. Not that I should be runing it with the screen closed anyway...

bluehz 03-03-2003 04:07 PM

wakeonlan works great - you could prob do it from your remote machine, but since you have not already installed wakeonlan - then you are out of luck for today... sorry

bhaveshp 03-05-2003 02:22 AM

Try DSL Reports wake up
 
Try the wake up tool at DSL Reports:

http://www.dslreports.com/wakeup

I tried it once to wake up my G4 but couldn't get it to work through my SMC router. Didn't figure out which port needs to be open.

If anyone gets this working, post back.

bluehz 03-05-2003 02:36 AM

i doubt you will ever get the DSLReports wakeup to work.

g4macuser 05-04-2003 07:54 PM

i use wake550 which keeps list of connect addresses. is there a terminal command or and applescript that i could use for waking? i have no problems using the method that i am using but i want to let a friend who is very ( and i stress very ) computer illiterate. i want to allow him to access my itunes library. i made an applescript for that. however the computer goes to sleep so i need him to be able to wake it up first but in a simple manner.

mervTormel 05-04-2003 07:58 PM

maybe some perl...

http://www.macosxhints.com/article.p...20220095929695

Phil St. Romain 05-05-2003 10:35 AM

I've been through that Hints exchange and numerous Google links searching for how to wake a sleeping Mac over the Internet and nothing has worked. The app Wake Up recommended above does a great job on a LAN, as do other apps and scripts.

If anyone knows how to do this over the Internet, please let us know.

yellow 05-05-2003 11:19 AM

FWIW, recently speaking with an Apple Engineer over an unrelated issue, he mentioned that he had no idea what type of "admin access" was actually required to make "Wake on admin access" actually work. We briefly theorized that it was a forward-thinking thing built into older OSs planning for Apple Remote Desktop (Timbuktu is not 'admin' enough to wake a slept machine remotely :)).

bluehz 05-05-2003 11:47 AM

I have tried this over the years several times waking over the internet and it has NEVER worked.... until today... I just woke my iBook and an iMac over cable modem, through router, from a website... here's the trick...

My LAN setup uses numbers in the range 192.168.1.0 to 255 - you may need to adjust numbers below to meet your own LAN. Assuming those numbers...

1. Identify the MAC addresses of your machines
You can easily find it in the Network PrefPane at the bottom of the window. You can also issue the following command in a terminal:

arp <ip address>

and it will return the Mac address of the computer (NIC) in question. For example:

arp 192.168.1.167
returns book.my.lan (192.168.1.167) at 0:45:65:fb:66:26
(note - each digit in the Mac address must be two digits - so in the example above we fill in the missing digits (char 1) with a zero and end up with this Mac address:

004565fb6626

2. Setup EnergySaver PrefPane
Open the Energy Saver PrefPane, click Show Deatils button, then the Options tab and check the box for "Wake for Network Administrative Access"

3. Identify Your Outside IP address
Identify the outside address of your LAN - you can easily find this in the router setup.

4. Setup Port Forwarding on the Router
Most online wake utilities use UDP port 9, so you need to set up your router to forward UDP port 9 to the whole internal LAN - your broadcast address. For me this means port forwarding all udp request on port 9 to 192.168.1.255. Some online wake utilities allow you to choose a port to send the packets on - if you desire - choose another port and open UDP traffic on it appropriately. The secret here is to have the port broadcast the UDP signal on that port to your whole subnet - in my case 192.168.1.255.

5. Test it out
Put the computer on your LAN to sleep then visit one of the online wake utilities. I tried these two:

DSLReports - DID NOT WORK!
http://www.dslreports.com/wakeup

Depicus Wake On Lan - WORKS!
http://www.depicus.com/wake-on-lan/woli.asp

Using the Depicus utility - here's how I did it:

Your Network Cards Mac Address: <MAC address from step 2-NO COLONS>
Your Computers IP Number: <outside IP address determined in step 3 above>
Your Subnet Mask: 255.255.255.255 # see note below
Port Number: 9

My normal subnet mask FOR MY LAN - not the WAN is 255.255.255.0, but you want to make sure and broadcast to the full range so make sure the last digit is 255 also.

I can verify this works using Comcast cable and a Linksys 4 port router. I was able to successfully wake both an iBook 2001 (stock Mac OS X 10.2.5 install and ethernet card) and an iMac 350MHz with stock ethernet card.

If you are having troubles with your IP addressing or subnet numbers - heres a nice little tool for calculating. There are others availble - search for "subnet tool"
http://www.mattjustice.com/subnet/

bluehz 05-05-2003 12:45 PM

If you want to get sneaky - you can just create this HTML file on and it will do the same thing - note it is still accessing the Depicus site to perform the action. I tried just encoding the info into the url in hope of creating a bookmark like so:

Code:

http://www.depicus.com/wake-on-lan/woli.asp?MacAddress=XXXXXXXXXXXX&IpNumber=X.X.X.X&SubnetMask=255.255.255.255&PortNumber=9&submit=WakeMeUp
... but that did not seem to work. If anyone has any suggestions for getting this to work that would be great!

Code:

<html>
<head>
        <title>Wake On Wan</title>
</head>
<body>
      <form method="POST" action="http://www.depicus.com/wake-on-lan/woli.asp">
        <table border="0" cellpadding="0" cellspacing="0" width="100%" height="102">
          <tr>
            <td width="33%" height="25" align="right">Your
              Network Cards Mac Address</td>
            <td width="5%" height="25"></td>
            <td width="62%" height="25">
            <input type="text" name="MacAddress" size="20" value="009027a322fe"></td>
          </tr>
          <tr>
            <td width="33%" height="25" align="right">Your
              Computers Ip Number</td>
            <td width="5%" height="25"></td>
            <td width="62%" height="25">
            <input type="text" name="IpNumber" size="20" value="217.204.255.55"></td>
          </tr>
          <tr>
            <td width="33%" height="25" align="right">Your
              Subnet Mask</td>
            <td width="5%" height="25"></td>
            <td width="62%" height="25">
            <input type="text" name="SubnetMask" size="20" value="255.255.255.240"></td>
          </tr>
          <tr>
            <td width="33%" height="27">
              <p align="right">Port Number</td>
            <td width="5%" height="27">
            &nbsp;</td>
            <td width="62%" height="27">
              <input type="text" name="PortNumber" size="20" value="7"></td>
          </tr>
          <tr>
            <td width="33%" height="27">
              <p align="center"></td>
            <td width="5%" height="27">
            </td>
            <td width="62%" height="27">
              <input type="submit" value="Wake On Wan" name="WakeMeUp"></td>
          </tr>
        </table>
        <p align="left"></p>
      </form>
      <p align="left">

</body>
</html>

Obviously if you wanted to you could hard wire in your values that show up as default in the form.

Phil St. Romain 05-05-2003 01:16 PM

thanks
 
Thanks bluehz! I intend to give this a try tomorrow when I'm on the road.

bluehz 05-05-2003 01:22 PM

Cool - let us know how it works. I am still dumbfounded I actually got it to work. I swear I have tried probably 100 times at various site over the last 2-3 years and never once has it worked....

Phil St. Romain 05-06-2003 02:25 PM

nope
 
bluehz, no luck! :( I think I set up port forwarding on the router to only the LAN IP address of my iMac, which is a state address. I'll try referring to the whole subnet and see if that makes a difference. I'm just noticing in your directions that you emphasize this.

bluehz 05-06-2003 02:57 PM

Re: nope
 
From what I read when machine is asleep it no longer has an identifiable IP address thats why they say you have to broadcast to your whole subnet. So every machine gets the signal to wake, but only the one with the actual matching MAC address accepts the command.

Quote:

Originally posted by Phil St. Romain
bluehz, no luck! :( I think I set up port forwarding on the router to only the LAN IP address of my iMac, which is a state address. I'll try referring to the whole subnet and see if that makes a difference. I'm just noticing in your directions that you emphasize this.

djn1 05-06-2003 05:51 PM

Quote:

Originally posted by bluehz
4. Setup Port Forwarding on the Router
Most online wake utilities use UDP port 9, so you need to set up your router to forward UDP port 9 to the whole internal LAN - your broadcast address. For me this means port forwarding all udp request on port 9 to 192.168.1.255. Some online wake utilities allow you to choose a port to send the packets on - if you desire - choose another port and open UDP traffic on it appropriately. The secret here is to have the port broadcast the UDP signal on that port to your whole subnet - in my case 192.168.1.255.
This is probably a stupid question but how do you work out what your broadcast address is? My router's internal ip is 192.168.0.1 and my machine is 192.168.0.2 but when I try to configure the router to port-forward to 192.168.0.255 it generates an error -"Invalid IP address". Am I missing something obvious?

bluehz 05-06-2003 06:32 PM

No - that is the correct broadcast address.... hmmm... wonder what thats about.... let me look into it.... hope its not a "feature of D-Link" routers since I just bought one.

EDIT
I am seeing a few reports of other not being able to set that address either, but its not necessarily brand related and no solution is listed.

How are you trying to port forward? I think the proper way in your D-Link router is via Virtual Servers settings. Not sure how helpful this is... but I just discovered that D-Link has a really nice emulator on their site, I went in and messed around with it and it let me set the address to UDP/9 192.168.0.255.... but then again it is just an emulator. Nice feature of website.
http://support.dlink.com/techtool/di...ator/login.htm

djn1 05-06-2003 06:59 PM

Quote:

Originally posted by bluehz
No - that is the correct broadcast address.... hmmm... wonder what thats about.... let me look into it.... hope its not a "feature of D-Link" routers since I just bought one.
It may be that I'm doing something wrong with one of the other router settings (though I've left most of them alone). I've put a screenshot on my iDisk (broadcast.pdf, www.homepage.mac.com/djn1) that shows the settings and the error dialog. I can't see anything wrong with the way I've done this but you might want to take a look and see if anything strikes you.

[edit] the error dialog appears after I click the modify button.[/edit]

mervTormel 05-06-2003 07:07 PM

hosts 0 and 255 are reserved.

a broadcast address is 255.255.255.255

you don't want to forward anything to the broadcast address. the incoming packets should already have the broadcast address.

i think

bluehz 05-06-2003 07:25 PM

Merv - according to the wake-on-lan crowd you HAVE to send the signal to the broadcast address for your subnet... thats the only way it will work.

http://www.dslreports.com/forum/wake...nlan~mode=shut

djn1 05-06-2003 07:37 PM

Did you notice that there were a couple of people in the first thread who reported that they couldn't set their routers to the broadcast address?

bluehz 05-06-2003 07:42 PM

Yes - I noticed that BUT I never saw an explaination or solution... ain't forums great..... hahaha..

also - did a rather extensive search and could find no info regarding it being illegal to set address to 192.168.0.255. It looks like your settings are correct as far as I can tell from PDF. I doubt this has anything to do with it, and I know nothing about it - but what is the SSID stuff that has to do with wireless. It does some sort of broadcasting and I am wondering if it has reserved the *.255 for itself. I had no problems at all setting 192.168.0.255 on my old Linksys.

djn1 05-06-2003 07:51 PM

Quote:

Originally posted by bluehz
but what is the SSID stuff that has to do with wireless. It does some sort of broadcasting and I am wondering if it has reserved the *.255 for itself. I had no problems at all setting 192.168.0.255 on my old Linksys.
I don't know :confused:

bluehz 05-06-2003 08:00 PM

I have been reading that it is customary to reserve the 192.168.0.255 address for broadcast - this is a given. You technically should never use that address for anything... for example you would never want to assign that to a machine... so I am wondering if the router is imposing some error checking basically saying "nice try - but I'm not going to let you use that address". If so that would be a bummer - because you are NOT assigning that address to anything - you are just opening the pipe for that address to get through the router so it should have no effect. Is there a free tech support phone for your router?

djn1 05-06-2003 08:07 PM

Quote:

Originally posted by bluehz
Is there a free tech support phone for your router?
I don't know - I'll check it out tomorrow - it's 1am here :yawn ;)

stetner 05-07-2003 08:38 AM

Your broadcast address depends on what your subnetmask is. (You might want to check what the router has as its mask, although I cannot see it making a difference in this case)

If your subnet mask is 255.255.255.0 and you network address is 192.168.0.0 then your broadcast address is 192.168.0.255. Valid addresses are 192.168.0.1-192.168.0.254 inclusive.

If your subnet mask is 255.255.254.0 and you network address is 192.168.0.0 then your broadcast address is 192.168.1.255. Valid addresses are 192.168.0.1-192.168.1.254 inclusive, including 192.168.0.255 as a valid address.

There is nothing inherently magic about the 0 or 255 addresses. The highest and lowest address on the network are reserved though.

whatmask is a useful utility for this (gui version:whatmask)
Code:

% whatmaskcli 192.168.0.1/255.255.255.0

------------------------------------------------
          TCP/IP NETWORK INFORMATION
------------------------------------------------
IP Entered = ..................: 192.168.0.1
CIDR = ........................: /24
Netmask = .....................: 255.255.255.0
Wildcard Bits = ...............: 0.0.0.255
------------------------------------------------
Network Address = .............: 192.168.0.0
Broadcast Address = ...........: 192.168.0.255
Usable IP Addresses = .........: 254
First Usable IP Address = .....: 192.168.0.1
Last Usable IP Address = ......: 192.168.0.254

% whatmaskcli 192.168.0.1/255.255.254.0

------------------------------------------------
          TCP/IP NETWORK INFORMATION
------------------------------------------------
IP Entered = ..................: 192.168.0.1
CIDR = ........................: /23
Netmask = .....................: 255.255.254.0
Wildcard Bits = ...............: 0.0.1.255
------------------------------------------------
Network Address = .............: 192.168.0.0
Broadcast Address = ...........: 192.168.1.255
Usable IP Addresses = .........: 510
First Usable IP Address = .....: 192.168.0.1
Last Usable IP Address = ......: 192.168.1.254

Your PDF shows that you are already mapping port 9. Could that be the problem (along with an unclear error message)?




edit: PS. ipcalc is pretty cool too

bluehz 05-07-2003 08:41 AM

stetner - do you think it may be that the router has idiotproofed the high/low addresses to prevent people from using them? Thats the only thing I can figure - I had no problem setting my router to *255 setting, but I read on the DSLreports forums about people trying to do the WOL and they too could not set address to *255. I am thinking the routers are confined to the useable addresses - just to keep people from getting in trouble.

BTW - thx for the whatmask info - I was looking for something like that to mention in my instructions on using WOL. I'm going to submit the WOL tip to the main MacOSXHints - I hope you don't mind if I include the "whatmask" info also...

I just noticed I already have the "whatmask" binary installed - do you know if that comes pre-installed with OS X or is it something I compiled and added at some point?

stetner 05-07-2003 09:36 AM

Quote:

Originally posted by bluehz
stetner - do you think it may be that the router has idiotproofed the high/low addresses to prevent people from using them?
I would hope not, but some of these low end routers do have some restrictions built in, so I guess only the manufacturer would know...
Quote:

Thats the only thing I can figure - I had no problem setting my router to *255 setting, but I read on the DSLreports forums about people trying to do the WOL and they too could not set address to *255.
Yeah, no problem here either (Netgear).
Quote:

BTW - thx for the whatmask info - I was looking for something like that to mention in my instructions on using WOL. I'm going to submit the WOL tip to the main MacOSXHints - I hope you don't mind if I include the "whatmask" info also...
Not at all, I just googled for it...
Quote:

I just noticed I already have the "whatmask" binary installed - do you know if that comes pre-installed with OS X or is it something I compiled and added at some point?
Looks like it is in fink, could have come from there. Cheers

gatorparrots 05-07-2003 10:59 AM

whatmask
 
It's not a part of the OS X 10.1 or 10.2 default installs. The likeliest source was fink:
fink list | grep whatmask
Code:

whatmask        1.1-1  Subnet calculator

Phil St. Romain 05-07-2003 02:35 PM

Re: whatmask
 
bluehz, I'm using a Macsense router with the following settings:

Private IP address: 192.168.1.1 (the router's address)
LAN subnet: 255.255.255.0

Public IP: 68.98.206.49
I've set port forwarding to use UDP and port 9 to direct to 192.168.1.255.

Using the link you shared with us, I input

Ethernet address: from my iMac
Public IP: 68.98.206.49
Subnet Mask: 255.255.255.255
Port: 9

The response page showed that a magic packet had been sent to the correct card number at the correct IP address. No wake. Any ideas?

bluehz 05-07-2003 04:46 PM

phil - your info looks good. Did you include the colons in your ethernet address or not - you should NOT include colons.

Other than that - I have no idea. I swear I sat here and did it approx 10 times on 2 diff machines... I am starting to think each router manufacture is different in terms of whether they will actually let you use the broadcast address or not. Interestingly enough - I just bought a new router I was going to install this afternoon anyway - so that will be a good test. I am going to go back and try it again with my current router (Linksys) then I am going to switch out the routers and try it again.

Which of the packet sniffing utilities would be good to watch for the packets coming into the LAN from outside? MOst of them spit out so much info - and with my untrained eye - I suspect it would fly right by me.

Phil St. Romain 05-07-2003 07:55 PM

bluehz, no colons on the ethernet address. Guess I'm just out of luck on this one. It would be nice, but, oh well . . .

bluehz 05-07-2003 11:37 PM

Just tried it again with my new router (D-Link 614+) and it also works. I had no problems setting broadcast address to 192.168.1.255.

stetner 05-08-2003 07:01 AM

Quote:

Originally posted by bluehz
Which of the packet sniffing utilities would be good to watch for the packets coming into the LAN from outside? MOst of them spit out so much info - and with my untrained eye - I suspect it would fly right by me.
'sudo tcpdump -i en0' should do the trick. That will dump all packets seen. There are ways of filtering based on expressions (see man page). I cannot remember if it is a standard apple tool though, I think it is....

bluehz 05-08-2003 09:31 AM

I think this would work to watch for incoming packets on port 9. Prints to the console - much like doing a tail on a file, but instead for TCP...
Code:

sudo tcpflow -i en0 -c port 80


All times are GMT -5. The time now is 09:06 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.