WOL doesn't work

I know the Realtek NIC ( RTL8111/8168/8411) is not the best choice, but in the motherboard datasheet is reported that it’s WOL compatible.
I created in the file /etc/network/interfaces.d/enp2s0 with

auto enp2s0
iface enp2s0 inet dhcp
    ethernet-wol g

Nonetheless, WOL doesn’t work.

Do I need to install something?

Please supply system and OS information to help with finding you an answer.

Is the NAS’s NIC powered on and ready to process a signal at the time the WOL command is issued?

Motherboard is an ASRock FM2A85X-ITX, BIOS P1.60 (last BIOS available).
In the BIOS I don’t find a specific option for WOL.
The only one that is related to boot on NIC is for PXE and if it is active, it always waits for the OS to arrive at boot. So, it should be kept deactivated.
The NIC LEDs are off.

Either something is missing in Debian, or it’s the motherboard that doesn’t work.

You can use the ethtool command in the shell for information about you NIC, and Wake On Lan (as root or sudo) :

ethtool <interface_name> | grep Wake-on

You should see something like that :

Supports Wake-on: pumbg
Wake-on: d

The letters indicates which type of Wake On Lan is supported and active. According to Arch Wiki :

  • p : PHY
  • u : unicast
  • m : multicast
  • b : broadcast
  • g : magic packet
  • d : disabled

Boot from PCIe / Integrated NIC may need to be activated in the BIOS, but if there is no such feature, you can use the NIC firmware (you might need both).

With most NICs, you can activate the classic WOL with :

ethtool -s <interface_name> wol g

You might want to make it persistent at reboot with a systemd.link, in case it gets overwritten in some way (see previous Arch Wiki link)