Understanding "Wake on LAN"

Q'center app, Helpdesk app
Post Reply
Jaspos
Starting out
Posts: 12
Joined: Wed Jan 04, 2017 5:00 pm

Understanding "Wake on LAN"

Post by Jaspos »

Hi there

I not sure if Wake on Lan will do what I need (the manual isn't much help) and I have seen other posts in the forum but none 100% explains how it works/whether it will do what I want it to.

Here is what I would LIKE to do:
1) schedule the NAS to go in to some kind of low power/sleep overnight
2) have the NAS wake as soon as any of the connected PCs on the network are switched on in the morning

I have an old Buffalo NAS which does this, but I can't seem to get my Qnap to do the same. Here is what I am trying

1) I have set the NAS to sleep or shutdown at 1am (this works fine)
2) I have set the NAS to wake-on-LAN, but when I switch on a PC, I simply get a message from Qfinder saying it can't find any Qnaps on the network (ie nothing is "woken" - except the Buffalo drive, which wakes just fine)

So my question is - should this work, or is sleep/shutdown not the correct thing to do?

FYI when I "shutdown" the NAS it no longer shows on the network switch (no green light) - but when on "sleep" there is a green light on the network switch (but the orange LAN light on the NAS is NOT lit)

Here is key info/settings
TS-253A
Connected to ethernet network with 2 x Win 10 PCs
QTS v 4.2.2

Power settings:
EuP mode - disabled
Wake on Lan - enabled
Power recovery: Resume server to previous status
Power schedule > Enable schedule (tick) >> Sleep Daily @ 1am

Look forward to any help, thanks!
User avatar
dolbyman
Guru
Posts: 35272
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: Understanding "Wake on LAN"

Post by dolbyman »

to wake the unit by WOL, you have to send a "magic packet" to it, those are broadcast packages addressed to the MAC of the device

https://en.wikipedia.org/wiki/Wake-on-LAN#Magic_packet
User avatar
razormoon
Easy as a breeze
Posts: 465
Joined: Fri Feb 13, 2015 5:05 am
Location: Denver, CO

Re: Understanding "Wake on LAN"

Post by razormoon »

Jaspos wrote:Hi there

I not sure if Wake on Lan will do what I need (the manual isn't much help) and I have seen other posts in the forum but none 100% explains how it works/whether it will do what I want it to.

Here is what I would LIKE to do:
1) schedule the NAS to go in to some kind of low power/sleep overnight
2) have the NAS wake as soon as any of the connected PCs on the network are switched on in the morning

I have an old Buffalo NAS which does this, but I can't seem to get my Qnap to do the same. Here is what I am trying

1) I have set the NAS to sleep or shutdown at 1am (this works fine)
2) I have set the NAS to wake-on-LAN, but when I switch on a PC, I simply get a message from Qfinder saying it can't find any Qnaps on the network (ie nothing is "woken" - except the Buffalo drive, which wakes just fine)

So my question is - should this work, or is sleep/shutdown not the correct thing to do?

FYI when I "shutdown" the NAS it no longer shows on the network switch (no green light) - but when on "sleep" there is a green light on the network switch (but the orange LAN light on the NAS is NOT lit)

Here is key info/settings
TS-253A
Connected to ethernet network with 2 x Win 10 PCs
QTS v 4.2.2

Power settings:
EuP mode - disabled
Wake on Lan - enabled
Power recovery: Resume server to previous status
Power schedule > Enable schedule (tick) >> Sleep Daily @ 1am

Look forward to any help, thanks!
Your NAS will not 'wake' by simply trying to access it. I'm guessing that your old Buffalo had some form of agent installed on your client that sent the magic packet.
You can add an extra item in power schedule to power the NAS on in the morning or you can install one of many wake on lan apps as some have features on how/when they wake your device.
:!: TVS-871-i7-16G 5.0.0.1932 Build 20220129, KODI, WSE 2019
:?: 1 x KINGSTON SNV325S2 as 2mb block cache, WDC WD40EFRX as RAID5, 1 x WDC WD40EFRX as iSCSI
:idea: APC PRO 1500 S
:-0 WIKI SUPPORT

"Nothing is impossible. Only expensive, illegal or both."
Jaspos
Starting out
Posts: 12
Joined: Wed Jan 04, 2017 5:00 pm

Re: Understanding "Wake on LAN"

Post by Jaspos »

Thanks to both for the swift reply.

I was aware of the phrase "magic packet" - but as my old Buffalo drive used to wake when I started my PC I had assumed (it appears erroneously!) that my PC was automatically sending this magic packet on start-up.

Are you able to provide any guidance on any wake-on-lan apps (a quick google search provides few options, plus some scripts if I can find the time to investigate) but any recommendations of any apps/code working with Qnap would be most welcome.

Thanks again!
User avatar
dolbyman
Guru
Posts: 35272
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: Understanding "Wake on LAN"

Post by dolbyman »

maybe the old NAS did not actually shut off , but went into standby

So when the windows computer accesses shares on startup, the drives would spin up
P3R
Guru
Posts: 13192
Joined: Sat Dec 29, 2007 1:39 am
Location: Stockholm, Sweden (UTC+01:00)

Re: Understanding "Wake on LAN"

Post by P3R »

Jaspos wrote:2) have the NAS wake as soon as any of the connected PCs on the network are switched on in the morning
It's not rocket science but will take some work to setup an automatic wakeup. You could configure a script to send a Wake-on-LAN (WoL) magic packet to the NAS on PC startup.
2) I have set the NAS to wake-on-LAN, but when I switch on a PC, I simply get a message from Qfinder saying it can't find any Qnaps on the network (ie nothing is "woken" - except the Buffalo drive, which wakes just fine)
You have WoL in Qfinder Pro under the Tools menu.

Under the menu QFinder Pro, Settings you could also configure a wake-up by double-clicking on the NAS entry.
FYI when I "shutdown" the NAS it no longer shows on the network switch (no green light) - but when on "sleep" there is a green light on the network switch (but the orange LAN light on the NAS is NOT lit)
No the LAN LED on the front of the unit shouldn't be lit but the small LED on the back by the connected network port and the light on the switch should be also when it's shutdown if you have WoL enabled in the Power settings as you do. At least I know it works that way on a TS-853A so it's very surprising that a TS-253A is different. :shock:
RAID have never ever been a replacement for backups. Without backups on a different system (preferably placed at another site), you will eventually lose data!

A non-RAID configuration (including RAID 0, which isn't really RAID) with a backup on a separate media protects your data far better than any RAID-volume without backup.

All data storage consists of both the primary storage and the backups. It's your money and your data, spend the storage budget wisely or pay with your data!
Jaspos
Starting out
Posts: 12
Joined: Wed Jan 04, 2017 5:00 pm

Re: Understanding "Wake on LAN"

Post by Jaspos »

Apologies to all for the slow response. But following all the help I wrote a quick batch script that sends a WOL magic-packet via Powershell. In have set this to run after PC log-on, and now all works as needed.

Thanks to all!
Fransor
New here
Posts: 2
Joined: Mon Feb 27, 2017 2:15 am

Re: Understanding "Wake on LAN"

Post by Fransor »

Jaspos wrote:Apologies to all for the slow response. But following all the help I wrote a quick batch script that sends a WOL magic-packet via Powershell. In have set this to run after PC log-on, and now all works as needed.

Thanks to all!
Jaspos, pls let us know the scrip you are using in the Powershell, to turn it on and also to turn it into sleep mode. Thx in advance!
Jaspos
Starting out
Posts: 12
Joined: Wed Jan 04, 2017 5:00 pm

Re: Understanding "Wake on LAN"

Post by Jaspos »

Ok, here's the Powershell script saved as a .ps1 file

Code: Select all

# This is the MAC address of the NAS to wake
$Mac = "Your QNAP NAS Mac address"

# This creates the MAC address as a byte
$MacByteArray = $Mac -split "[:-]" | ForEach-Object { [Byte] "0x$_"}
# This creates the Magic Packet:
# First add start sequence
# Then do the MAC address 16 times
[Byte[]] $MagicPacket = (,0xFF * 6) + ($MacByteArray  * 16)


# Send the packet
$UdpClient = New-Object System.Net.Sockets.UdpClient
$UdpClient.Connect(([System.Net.IPAddress]::Broadcast),7)
$UdpClient.Send($MagicPacket,$MagicPacket.Length)
$UdpClient.Close()
I then have a .bat file, IN SAME FOLDER AS THE PS1 FILE, that runs this script, and I call this .bat file at PC logon via the Task Scheduler

Code: Select all

@ECHO OFF
PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%~dpn0.ps1'"
NB I don't have a script to put the NAS to sleep, I simply set this in the QNAP control panel for a time I want (in my case 1am)
Fransor
New here
Posts: 2
Joined: Mon Feb 27, 2017 2:15 am

Re: Understanding "Wake on LAN"

Post by Fransor »

Works fine :DD
Thank you!
Post Reply

Return to “NAS Management”