Cannot persistently enable Wake-on-LAN

Hi

I have a fresh install of EndeavourOS (Gnome) on a new PC. I’ve tried various ways to persistently enable WOL, but I cannot make it work after a reboot. Right now, it looks as if it is enabled after a reboot:

sudo ethtool eno1 | grep Wake-on
>     Supports Wake-on: pumbg
>     Wake-on: g

And from the network manager:

However, it does not work. If I then run sudo ethtool -s eno1 wol g I can suspend and wake the PC until the next reboot.

I’ve tried various ways of making it persistent from https://wiki.archlinux.org/title/Wake-on-LAN (systemd.link, a systemd service and a cron task) but none of them works for me. I also found this topic (Wake on LAN not working - #4 by mbod) on the forum, which looks similar, but I don’t have tlp installed, so this unfortunately does not solve my problem. However, it might be a similar issue, that some other service on the system disables WOL after e.g. my systemd service (or the Cron task may run before the network interface is up? I’m not sure), but I cannot figure out which one.

How do I proceed from here?

Wake on LAN also needs to be enabled in the BIOS. Have you done this?

Yes, it is enabled in bios. If I run sudo ethtool -s eno1 wol g and then suspend the machine, I can wake it up.

suspend is not poweroff. You need to make sure that during poweroff, the network card is still with power. The arch wiki says:

“Make sure that ErP is disabled, otherwise your Ethernet card will not be powered and will not be able to receive any wake-up packets sent from another device.”

https://wiki.archlinux.org/title/Wake-on-LAN

I think you misunderstand me. I can run the command above and have no problems waking my PC up after I suspend it.

My problem is, that none of the methods I have tried to make it persist after a reboot works. So I have to manually rerun the ethtool command each time i restart the machine, which is annoying.

ok. So when you use the service provided by the wol-systemd what does the status say after boot?

E.g. my LAN device is enp7s0. I run wol@enp7s0.service on every boot and it says:

╰─# systemctl status wol@enp7s0.service 
○ wol@enp7s0.service - Wake-on-LAN for enp7s0
     Loaded: loaded (/usr/lib/systemd/system/wol@.service; enabled; preset: disabled)
     Active: inactive (dead) since Sat 2023-03-11 13:40:26 CET; 2h 14min ago
    Process: 3914 ExecStart=/usr/bin/ethtool -s enp7s0 wol g (code=exited, status=0/SUCCESS)
   Main PID: 3914 (code=exited, status=0/SUCCESS)
        CPU: 1ms

Mär 11 13:40:26 rakete systemd[1]: Starting Wake-on-LAN for enp7s0...
Mär 11 13:40:26 rakete systemd[1]: wol@enp7s0.service: Deactivated successfully.
Mär 11 13:40:26 rakete systemd[1]: Finished Wake-on-LAN for enp7s0.

I get basically the same response. But alas, it seems to be working after i disabled the wol-systemd service and enabled it again. I’m not sure what exactly was the problem, but I consider the problem solved for now.

❯ sudo systemctl status wol@eno1.service
○ wol@eno1.service - Wake-on-LAN for eno1
     Loaded: loaded (/usr/lib/systemd/system/wol@.service; enabled; preset: disabled)
     Active: inactive (dead) since Sat 2023-03-11 18:35:35 CET; 1min 10s ago
    Process: 753 ExecStart=/usr/bin/ethtool -s eno1 wol g (code=exited, status=0/SUCCESS)
   Main PID: 753 (code=exited, status=0/SUCCESS)
        CPU: 1ms

mar 11 18:35:35 flow systemd[1]: Starting Wake-on-LAN for eno1...
mar 11 18:35:35 flow systemd[1]: wol@eno1.service: Deactivated successfully.
mar 11 18:35:35 flow systemd[1]: Finished Wake-on-LAN for eno1.

Thank you for your time mbod!