1. Current Location: Home >  NAS >  The NAS is usually shut down to save power. I wake it up remotely when outside. Wake-on-LAN has three pitfalls.

The NAS is usually shut down to save power. I wake it up remotely when outside. Wake-on-LAN has three pitfalls.

NAS wake-on-LAN remote boot process: The external network mobile phone sends magic packets, the router UDP9 forwards and IP MAC binding, the NAS shuts down the network card and automatically turns on after receiving the packet. There are three thresholds for the external network.

The Feiniu NAS at home is usually turned off. It's not that it's not easy to use, it's that it's too expensive - I've calculated the electricity bill for a year if I hang it up 24 hours a day. The few watts of the optical hard drive plus the system overhead will cost dozens of dollars a year. But there are always times when people suddenly want to transfer a file or watch a movie when they are outside, but it is too stupid to run home and turn on the phone. Later I dug out an old thing: Wake-on-LAN, network wake-up. The network card is not completely powered off in the shutdown state, but is still listening to the LAN broadcast. When it receives a packet in a specific format, it notifies the motherboard to turn on. I have connected this set. Now when I am outside, I click on my phone and the NAS stands up on its own. This article records the entire process and three rollovers.

Give an expectation first: WOL is only responsible for waking up the machine. After waking up, you are outside and have to rely on the remote access connection to get in and work. Tailscale is out of power, so I need to re-post that article Let’s talk about intranet networking. The call comes from the article Talking about how the NAS can stand up on its own after a power outage, they are all good partners. This article only focuses on the "waking up the machine" section.

Make it clear first: WOL is not a panacea. There are three shutdown states:

Don't think that WOL can wake up machines that are "power off and shut down" right from the beginning. That's not the case. There are actually three states of NAS shutdown::

state Memory Network card power supply Can WOL wake me up?
sleep Powered on open The easiest, wake up in seconds
hibernate Save to hard drive Look at the machine Most of them can, just choose the motherboard individually.
Normal shutdown Total power outage It depends on the standby circuit. You need to enable it specifically in the BIOS and select a network card.

What I want is the last one: The NAS is completely shut down, but the network card still has a standby battery, waiting for the magic package. The magic bag looks like this: It starts with six bytes of FF, followed by the MAC address of the target network card sixteen times, totaling 102 bytes, and uses UDP port 9. After receiving this packet, the network card sends a boot signal to the motherboard, and the machine starts up.

There is a premise here that needs to be explained first.: Whether it can be woken up depends on whether the motherboard and network card still receive a little bit of power after shutting down. This is what the BIOS needs to take care of later, and it was also the root cause of my overturn on the first night.

First level: Turn off ErP in the BIOS so that the network card can have that power

For my N100 small host, enter the BIOS and press Del (F2 on some boards) to find the Advanced or Power Management items. Scroll to the bottom and there is an option called ErP Ready. This is the "European Union Energy Saving Regulation". It is turned on by default for many boards - if it is turned on, the power to the network card port will be cut off when the machine is shut down. The broadcast will not be heard when the network card is asleep, and it is useless to send the magic packet 10,000 times. I changed it to Disabled.

Next to it, there are two options to identify by name.: Wake on LAN, or some boards are called Wake on PCI-E, Power On By PCI-E. Check it and change it to Enabled. The difference between these three letters determines whether the network card is still alive after you shut down.

I stumbled here on my first night. I turned off ErP and turned on WOL in the BIOS, saved and exited, shut down the computer, and sent a magic package with my phone - no response. Sent again, still no response. In the end, I found that the motherboard battery was dead and the BIOS settings were not saved at all. After a reboot, they returned to default. The battery of this board has not been replaced in three years. Once the button battery voltage drops, the memory of the settings is lost. Later, I changed to a CR2032 and set it again, and it was stable. If you encounter "I was able to wake up yesterday but still wake up today", go to the BIOS and take a look to see if the settings are still there. Most likely it is the battery.

Second level: Enable Wake-on-LAN in the NAS system

After turning off the BIOS, there is another switch on the system side, don't miss it. Feiniu looks for the "Network" or "Power" related page in the settings. There is a "Wake on LAN" or "Wake on LAN" switch and hook it. Synology is more straightforward: Control Panel, Hardware and Power, find "Enable Wake on LAN" and check it. Both systems take effect after saving.

There is a pit here: This switch in the system is responsible for "keeping the network card awake at the system level." If the switch in the BIOS is not turned on, it is useless to check it in the system - the port in the underlying circuit has no power, and the upper switch is just a decoration. On the other hand, if the BIOS is turned on but the system is not turned on, the machine can wake up but the system will not recognize it after waking up. Pass both, the order doesn't matter, but neither one can be missed.

By the way, take a look at the network card driver. Check the network card name under Linux. ethtool eth0 | grep Wake , see if Wake-on is "d" or "g" in the output. "d" means disabled, "g" means magic packet (magic packet wake-up). If d is displayed, use ethtool -s eth0 wol g Open. My Realtek 2.5G network card defaults to g, which saves trouble. When encountering some batches of Intel's i225/i226, they still can't wake up even after setting up the BIOS and system. It's probably due to the network card firmware. Change the network card or connect an external WOL module, don't worry.

The third level: Check the internal network first, and then talk about the three thresholds of the external network

After all three levels have been set up, don’t rush out yet, test it first on your home LAN. This is the easiest step and can eliminate half of the metaphysical problems.

Use another device that is always on to send magic packets. The simplest thing is to install an App like Wake On Lan on your mobile phone. Search for this name in the store, fill in the MAC address of the NAS, and click send. Where does the MAC address come from? Look in the NAS background device information, or look for the IP in the router's background device list. I usually use Feiniu SSH to type ip link The string I looked at 00:11:22:33:44:55.

After uttering, listen to the sound: The machine buzzed and the hard drive started spinning. That meant the internal network was shut down. If there is no response, go back and check if the MAC address is filled in correctly - if you fill in one wrong digit, the package will be lost. I missed one entry on the second night. I missed two digits in the MAC number copied from the router's backend. I struggled for half an hour.

If the intranet can wake up, it means that the WOL link itself is open. The rest is the hardest: If you are not at home, how can the magic package enter the door from the outside? To put it bluntly, external network wake-up is three thresholds, one passed each. If it fails, the bag will not be able to get through the door.

First, your home broadband must have public IPv4. If the router's WAN port IP starts with 100.64, it is the operator's large intranet, and there is no place to send the packet. How do I check this and how do I find it from the operator? I'm here The article about remote connection to NAS at home It’s all written down, the three-step judgment method. I won’t repeat this article, by default you already have it.

Secondly, public IP addresses will drift. My home IP drifted from 117.136 to 111.72, and it changed overnight. Therefore, you need to configure DDNS to let the NAS or router report the current IP to the domain name regularly. I have this set of DDNS The article accessed from the external network As mentioned here, you can use ddns-go or the one that comes with the router. You can use the domain name to connect, which is more reliable than remembering the IP.

The third step is port forwarding, which is the most common pitfall in tutorials on the entire Internet. The magic packet is a UDP packet, usually port 9. You may have seen tutorials that forward UDP 9 to 192.168.1.255 This broadcast address - don't try it. Most home routers don't let you fill in the address ending in .255 at all, and if you fill it in, the packet will be silently discarded. The right way is to switch to unicast: Bind a static IP to the NAS in the router, for example 192.168.31.10 , and then forward UDP external port 9 to 192.168.31.10 9 ports.

Here is another serial detail: The NAS does not respond to ARP when it is shut down, the router cannot find the MAC corresponding to this IP, and the packets are still thrown away. Therefore, the static IP must be made in the "IP and MAC Binding" of the router, so that this record will always be retained in the ARP table. This step is the most critical step in whether wake-up from the external network can be successful. I stumbled here on the third night - only DHCP static allocation was done, but no ARP binding was done. All external network packets sent out were thrown away by the router as invalid traffic.

On the mobile app side, remember to change the port from the default 7 to 9 (some apps fill in 7 by default), fill in your DDNS domain name for the broadcast address, and fill in the NAS network card address for the MAC. When sending, use mobile data to send - connecting to home WiFi to test is equivalent to cheating. The package has never left the house at all, and the external network link cannot be tested.

I will tell you about the three pitfalls I have stepped into one by one.

The first pitfall is that the BIOS settings cannot be saved and the motherboard battery is dead. The symptom is "I could still wake up yesterday, but I can't wake up today". Judgment method: Restart the BIOS and see if the ErP and WOL are still the values ​​you set. It's back to default. It's a matter of battery. Replace it with a CR2032 and reset it.

The second pitfall is that only DHCP static allocation is done, and ARP binding is not done. The symptom is "the internal network can wake up, but the external network cannot". The difference lies in this step: There is no MAC record of the NAS shutdown in the router's ARP table, so the packet cannot be forwarded and is lost directly. Pin the IP and MAC of the NAS in the router's "IP and MAC Binding" or "Static DHCP", let the ARP table persist, and the external network will be connected.

The third pitfall is that the port is filled in incorrectly. The default port of some apps is 7, and you have to change it to 9 manually. The symptom is "the packet is sent, but there is no response from the NAS, and it cannot be found in the router logs." Change it to 9 and send it again, it will be effective immediately. This pitfall is small but annoying. After a long investigation, I finally found out that it is a matter of port number.

symptom Root cause of disease How to test
The internal network can wake up, but the external network cannot. Public IP or ARP binding is not done First check whether the WAN port is 100.64
I could wake up yesterday, but not today BIOS settings are cleared (battery/power outage) Enter the BIOS to see if ErP and WOL are there
Package sent but no response App port is still 7 Change it to 9 and send it again

Is it worth it?: Who should bother like this?

This is not something everyone needs, so think it through before taking action. The scene in my house is: The NAS is usually shut down and used two or three times a week, all for remote and temporary file retrieval. Turning on 24 hours a day costs me dozens of dollars in electricity bills. The key is that the hard drive is spinning 365 days a year. Wear and tear and electricity bills I've already calculated it. So waking up on demand is a necessity for me.

If you are using the NAS all day long, transferring files, running downloads, and mounting Docker, then it should be on 24 hours a day. Don't bother with WOL - shutting down and waking up is a drag, because containers and download tasks all have to wait for startup. Look at this scene The article about timer on and off It's more appropriate. That article said "let the NAS go to sleep after finishing its work every day", which is a two-way street from my "wake up on demand" approach.

my final configuration: For Feiniu NAS, ErP is turned off and WOL is turned on in the BIOS, Wake-on-LAN is enabled in the system, static IP is nailed to the NAS and ARP is bound in the router, DDNS is configured, and UDP 9 is forwarded to the NAS. Nowadays, when people are on business trips, they can click on their mobile phones and the NAS will stand up in less than 40 seconds, and they can go in and start work as soon as they tap SSH. The tens of dollars saved on electricity bills in a year are just a fraction. What is saved is the thousands of hours that the hard disk spins less, and the sleepiness of not having to get up in the middle of the night to turn on the computer.

Read More


Copyright Notice Scan to read on mobile
All Rights Reserved: 《SHUNOT》 => 《The NAS is usually shut down to save power. I wake it up remotely when outside. Wake-on-LAN has three pitfalls.》
Article URL: https://www.shunot.com/en/nas/1625.html
Unless otherwise stated, all articles are original by 《SHUNOT》. Reposting is welcome! Please indicate the original URL when reposting, thank you.

Contact Us

Online Consultation: Click here to send me a message

WeChat ID: master_135

Scan to follow