Using a Synology Disk Station for Wake On Lan

For my work I need to be able to access my home lab “server” frequently but in no way it needs to be always-on. This leaves me with the struggle of leaving it on and, for most of the time, consuming unnecessary  electricity or accept the fact that I can’t use it without proper planning.

So I was thinking of a way to have the best of both worlds, no waste of electricity but being able to use it whenever I want.

I thought of a system where I would run a script each evening shutting down the system. The script will prompt for the shutdown so when I’m still using it I am able to cancel the shutdown. This is the easy part, but how to get it on again…… What about that legacy Wake-On-Lan (WOL) protocol?

I started with just a simple WOL program on my Windows 8 company laptop and I was able to turn on the “server”. That’s cool but that doesn’t help because when I’m not at home this just doesn’t work. After a lot of thinking I though about that cool Synology Diskstation I have on my desk.

From one of the Synology forums I grabbed a script and got it working. I ‘m now actually able to turn on my server from anywhere, any time and any place.

Here is a short description of how it works.

First you need to start with setting up Synology Diskstation Web Services.

Go To Control Panel > Web Services and enable a Virtual Host.

Synology web services

Now you’ll find a new folder in your Synology File Station.

Synology indexphp

Upload index index.php file to that folder.

In the php file find the IP Subnet and change that to your IP subnet, probably (always ends on 255).

At the bottom of the php file you’ll find three lines for systems. Carefully replace the MAC Addresses of the systems you want to be able to WOL.

When you’re ready browse to http://diskstationIP:port/WOL/

Leave a Reply

  1. Hi Barry, can you help me with:

    In the php file find the IP Subnet and change that to your IP subnet, probably (always ends on 255).
    -> i found my subnet is ? am i wrong? if so how to find my subnet?

    At the bottom of the php file you’ll find three lines for systems. Carefully replace the MAC Addresses of the systems you want to be able to WOL.
    -> i saw three lines, so which one i have to replace with my synology MAC add?

    with your guide in this article, do i need to have a pc turned on 24/7 at home or as long the modem is online i can turn on my syno from any pc in the world?

    thanks so much.

  2. Thanks Barry, exactly what I need to wakeup my not-always-on NAS from my other always-on NAS. May be because my DSM 3.1 version is too old, I did not get your PHP to work at first. With some struggling I found that the Sockets extension was not loaded by default by my NAS. I tried dl() but did not work. Eventually I fixed the problem by setting the php.ini to load the Sockets extension on start up.

    Hope this will help others. Thanks once again for the great work, it has saved me a lot of effort.

    – Ivan

    • Ivan, can you be more specific? I really need to have this working before I fly overseas in two days time. Thanks

      • Reading your questions posted on June 1st, it seems Barry’s solution does not meet your need. His solution is to use a NAS to wake-up another device on the same LAN segment. You seem to be looking for a solution to wake-up your NAS from Internet instead.

  3. For many users they will also have to add a port forwarding for the port of the virtual host in their ROUTER.

  4. Thank you so much! I was an happy user of another Wake-On-Lan package but after some DSM updated it stopped to work definitively.
    I didn’t know this PHP based solution and I have to say it’s really effective and DSM version independent!
    Congratulations for the idea! And thank you again.

  5. Great application! Question: why do I have to create a virtual Host? Would it be sufficient to create a new folder in the web directory?

    • Thanks – works well. On latest version of DSM you need to press Apply when selecting enable Web Station, and then select Virtual Host after pressing apply.

  6. Hi Barry,
    Can you please let me know what application I can use to edit the .php file?
    Thank you i advance!

  7. Great, I’ll give it a try. One question: so does it works if I connect from Internet (WAN) to my Virtual Host (web server & site on my QNAP) to wake up my iMac in the SAME LAN (subnet) as the QNAP nas ?

  8. HI,

    Do you think it’s possible to modify this script, so that it send Magic Packet as soon as I access the page, on my mobile ?
    I only need to wake 1 computer, and don’t want to choose anything.

  9. Why run an entire web server just to do WOL when you could do the same thing from the CLI? Just SSH in and type:

    ether-wake -i eth0 00:01:02:03:04:05

    Works since at least DSM 4.3.

    • Hi, correct, just create a task with date back in time so it wont run automaticly. To wol a pc go into your tasks and run it manual.

      ether-wake -i eth0 00:01:02:03:04:05

  10. Hello Barry, very nice stuff!
    I’ve adapted your script so I can access over my iPhone (better screen resolution too).
    Is it OK if I can also share it?
    I’ve included attribution to you on the header files.

    • Well the smart thing would be to not open the port in the router for the WOL website. Then setup VPN for your network so you can connect to it from the outside and then turn on your PC.

  11. Pingback: Lan Stations | Amazon Supply

  12. There’s an easier way to achieve WOL from Synology. Just add a user defined script in the task scheduler:
    ether-wake -i eth0 01:02:03:04:04:06

    01:02:03:04:04:06 being the macaddress of the device you wish to wake up.
    Set the run time in the past so you can run the script manually with the run button.

    Note: to WOL your pc you may have to configure bios and the settings of your LAN adapter. This may differ for any device so you’ll have to google for it. This would be the case for any WOL method you choose. The LAN adapter needs to stay in stand by when switching off, and react to the magic packet sent with the WOL command. Also in BIOS your power options needs to be configured to be allowed to wake up by a PCI event and also the powersaveing mode needs to be set to a lower standard to prohibit the pc from completely shutting down. A lot of mainboards and LAN adapters allow this, but there are some that don’t.

    Been runnig this for a few days and works like a charm, altho the settings in BIOS and the adapter took some time to figure out.

  13. Hi Barry,
    Thanks a lot for sharing this. It works great from my Synology Diskstation and wakes up my various computers.

  14. Thanks a lot, it works very well
    Cam you tell me how I can make the text a little bigger
    That would be fine to use on my iPhone

    best regard

  15. Trying the ether-wake manually through SSH to my Sinology says operation not permitted. I wonder if this is why the script is not working also. No error reported when trying to wake up my iMac, just nothing happens (I have wake for network access switched on in OS X)

  16. planetwilson, after more digging around. I found that you need to login into root, same password as admin. Now I am able to execute ether-wake, but no response from my PC that I am trying to wake.