Waking MacMini from sleep remotely via 3g/Internet

Discussion in 'Mac mini' started by cappers, Nov 3, 2015.

  1. cappers macrumors member

    Joined:
    Aug 8, 2011
    #1
    Anyone have any suggestions the best way to wake my MiniMac remotely when I am outside my LAN. I have tried a few aps but none seem to work as promised. Plenty do when I am on my home WiFi network (Fing being the best), but cant figure out a way to do it when outside my network.
    I want to use Plax (or similar), but want to allow my Mini to sleep and wake on demand.
    I have a WD mycloud drive attached to my router, which sleeps and wakes as soon as I go into the 'my cloud 'app form my iphone (its own app) when I am out of my network, so why cant I do it with my Mini.
    My settings on my mac allowing wake for network access etc all seem to be as they should, as it wakes from within my wifi network (well most of the time).

    I am using a BT Infinity hub 4 router

    Anyone any ideas?
    Thanks
     
  2. page404 macrumors regular

    page404

    Joined:
    Mar 5, 2013
    Location:
    The Netherlands
    #2
    I've downloaded SimpleWOL on my iPhone. You need to know your outside IP address though. I do not have a fixed IP address so I wrote a little linux script that sends my outside IP to a little webpage on my hostingprovider every hour.
    And in your router you need to forward the port (e.g. port 9) to your Mac Mini.
     
  3. cappers thread starter macrumors member

    Joined:
    Aug 8, 2011
    #3
    Thanks for your reply
    And in your router you need to forward the port (e.g. port 9) to your Mac Mini

    Im not too tech savvy which it comes to routers and port forwarding. Is there a simple explanation? (or Linux script writing!)
    Also, I guess also if I cannot write a Linux script or do as you have indicated, it cannot be done?
     
  4. page404 macrumors regular

    page404

    Joined:
    Mar 5, 2013
    Location:
    The Netherlands
    #4
    I think there is an explanation here for you: http://portforward.com/english/routers/port_forwarding/BT/BTHomeHub/Wake_on_LAN.htm

    Basically, you tell your router that all data that comes from outside on a certain port, must be sent to a specific IP address internally. So if your Mac Mini has ip 10.0.1.1 and you want to accept port 9 info on that machine, the rule is:
    outside IP = 0.0.0.0 (everything)
    outside port = 9
    inside IP = 10.0.1.1
    inside port = 9

    Outside and inside port may be different.
    Not necessary. If you have a fixed IP you only have to look it up once (e.g. on https://www.whatismyip.com/). If you have a dynamic IP it seldom changes, for instance after a reboot of your modem. I have a dynamic IP so I wrote myself a little script.
    If you ever feel like it, check http://www.psinke.nl/blog/create-a-diy-dynamic-dns-service/
     
  5. cappers thread starter macrumors member

    Joined:
    Aug 8, 2011
  6. cappers thread starter macrumors member

    Joined:
    Aug 8, 2011
    #6
    Basically, you tell your router that all data that comes from outside on a certain port, must be sent to a specific IP address internally. So if your Mac Mini has ip 10.0.1.1 and you want to accept port 9 info on that machine, the rule is:
    outside IP = 0.0.0.0 (everything)
    outside port = 9
    inside IP = 10.0.1.1
    inside port = 9

    Can you let me know where you input this as I had a look at it last night and kind of getting my head round it, but cant see exactly where this goes.

    Many thanks
     
  7. page404 macrumors regular

    page404

    Joined:
    Mar 5, 2013
    Location:
    The Netherlands
    #7
    at the bottom of the page I mentioned before, there is an explanation. I don't know the exact layout of your router configuration pages, but you should look for "port forwarding". Probably in Advanced, or LAN settings, or WAN settings or similar.
     
  8. cappers thread starter macrumors member

    Joined:
    Aug 8, 2011
    #8
    Yes I did see that but could not find anywhere to input outside inside etc.
    Many thanks anyway
     
  9. Celerondon macrumors 6502a

    Celerondon

    Joined:
    Oct 17, 2013
    Location:
    Southern Cal
    #9
  10. cappers thread starter macrumors member

    Joined:
    Aug 8, 2011
    #10
    Thanks for the update, but looks like my Mac needs to be connected with a network cable. It is connected on the wifi network
     
  11. cappers thread starter macrumors member

    Joined:
    Aug 8, 2011
    #11

    Finally worked it out, well almost. Sorted out port forwarding on my router.
    I can get it to sleep remotely, but not wake. Seems all my ports are correct on forwarding as it sleeps ok on demand via internet, but does not wake!
     
  12. Celerondon macrumors 6502a

    Celerondon

    Joined:
    Oct 17, 2013
    Location:
    Southern Cal
    #12
    Okay great cappers! That sounds like progress. How did you decide which ports to forward? Did you select 9, 9 & 7, or some other combination of ports? Also, did you forward to a range of addresses or one specific address?
     
  13. cappers thread starter macrumors member

    Joined:
    Aug 8, 2011
    #13
    I found something on interweb about how to access plex remotely over the internet and found a step by step guide how to open the relevant ports for that, and realised that wake / sleep is port 9, so did the same for that and I was shocked to see it worked....except for waking, it is a bit hit and miss.
    Happy with the progress though!
     
  14. Celerondon macrumors 6502a

    Celerondon

    Joined:
    Oct 17, 2013
    Location:
    Southern Cal
    #14
    Can you use both ports cappers? I would try port 7 or both 7 & 9 if possible.

    Just don't give up like my friend Jimi did. You are almost finished with this process.
    Jimi got so sick of port configuration hassles that he said:

    "Now if 6 turned out to be 9

    I don't mind, I don't mind..." :cool:
     
  15. ActionableMango macrumors 604

    ActionableMango

    Joined:
    Sep 21, 2010
    #15
    You also need to set up your computer with a static IP address or the port forwarding will eventually fail when your computer is assigned a different IP address via DHCP.
     
  16. cappers thread starter macrumors member

    Joined:
    Aug 8, 2011
    #16
    Yes Ive done that so all good there.
    Will give port 7 a go and let you know!
     
  17. cappers thread starter macrumors member

    Joined:
    Aug 8, 2011
    #17
    Almost there. Opened port 7, and can wake it it but not after it has been sleeping for a while, only after a short period. like a deep sleep or similar
     
  18. DaakuMaujii macrumors member

    DaakuMaujii

    Joined:
    Oct 25, 2015
    #18
  19. cappers thread starter macrumors member

    Joined:
    Aug 8, 2011
    #19
    Sorry can you explain what you mean by when you SSH into the machine. How would you do this remotely form an ios device?
     
  20. DaakuMaujii macrumors member

    DaakuMaujii

    Joined:
    Oct 25, 2015
    #20
    SSH is a way to get remote access to the machine using the Terminal. You have to enable 'Remote Login' in the Sharing preference panel. By default, only users from the Administrator group can gain remote access, but you can always add other users to the list. Mac OS X probably won't allow users without any password set, but be sure to add users who have a good strong password.

    To gain access to the machine, you'll have to make sure the system can be reached from the outside. Set up your firewalls and routers to forward port 22 (default port for SSH) to your MacMini. I can recommend changing the default port to something else in the /etc/ssh/sshd_config file, uncomment the line with #Port 22 and replace 22 with a high number (e.g. 23412). Otherwise your machine will get hit often by wannabe hackers in an attempt to breach the system (hence the good strong password recommendation).

    I assume you know the external IP of your home Internet connection or have set up some type of dynamic DNS. Personally, I have a dynamic external IP address that doesn't change often, still I have a script set up to contact my external web host occasional to log the external IP address in case it changes.

    Anyhow, use any of the free SSH clients on iOS. Just search for ssh in the App Store. You'll only need it to log on to the system, no need to bother with all the fancy features of paid apps. Using the app should be pretty obvious; supply the hostname/ip address, set the correct port if you changed it from the default, supply the user credentials of the user you enabled remote access for on the MacMini and connect to the system. It may take a couple of seconds for the MacMini to wake up and accept the connection. Once it is connected, just type exit to terminate the secure connection. Your MacMini will remain on for the duration you have set the MacMini to fall asleep during no user activity.

    I personally no longer use iOS to wake up my device. I actually keep it running 24/7 these days. If you don't have access to iOS, you can alway uses Terminal on Mac OS X to SSH into the machine using the command ssh -p <port> <hostname|ipaddress>. If you have a Windows machine, I recommend PuTTy.
     
  21. cappers thread starter macrumors member

    Joined:
    Aug 8, 2011
    #21
    Thanks for taking the time for that, very useful, will give it a go
     

Share This Page