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 192.168.1.255 (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/

About Barry Schiffer

Barry is a senior technical consultant with 13 years of IT experience. He has gained both a broad and deep knowledge in the sphere of IT. Throughout the years, Barry has developed into a specialist in the field of Microsoft Windows, Server Based Computing, desktop and server virtualisation.Barry is co-founder and member of the Board of the Dutch Citrix User Group. He also writes several blogs on his website www.barryschiffer.com and he is a Computable Expert.
Tagged , , . Bookmark the permalink.

11 Responses to Using a Synology Disk Station for Wake On Lan

  1. PMOSES says:

    Thanks heaps mate. Very helpful. Just what I needed!

  2. erwinsie says:

    Hi Barry, can you help me with:

    In the php file find the IP Subnet and change that to your IP subnet, probably 192.168.1.255 (always ends on 255).
    -> i found my subnet is 255.255.255.0 ? 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.
    -Win-

  3. Ivan Chi says:

    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

    • Win says:

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

      • Ivan Chi says:

        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.

  4. Economy says:

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

  5. Scare says:

    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.

  6. Awesome! Really appreciate it! Users must not forget to port forward their router.Thanks!

  7. Andre Boelee says:

    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?

    • Dr Tosh says:

      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.

Leave a Reply