Failing to make Wake on Lan persistent using nmcli, systemd or cron

Hello everyone,

I’ve been fiddling around with Wake-on-lan today, and everything is working just fine!

One slight issue though. I would like to make wol persistent on the computer.

To enable wol we enable it in BIOS and run:

sudo ethtool -s *interface* wol g

in userspace to enable wol on next boot.
We check

sudo ethtool *interface* | grep Wake-on

and get:

	Supports Wake-on: pumbg
	Wake-on: g

Effectively I’d like to execute this every time the computer powers on. Here’s what i’ve tried:

Setting up a cron-job

I’ve added the following cron-job to root’s crontab:

@reboot /sbin/ethtool -s *interface* wol g

I reboot, and run

sudo ethtool *interface* | grep Wake-on

we get

	Supports Wake-on: pumbg
	Wake-on: d

i.e wol is disabled.

Setting up a service

I wrote a quick systemd service, but, worried i may have written something wrong i then grabbed the wol-systemd AUR package to replace it. It looks
like this:

[Unit]
Description=Wake-on-LAN for %i
Requires=network.target
After=network.target network-online.target

[Service]
Restart=on-failure
RestartSec=10s
ExecStart=/usr/bin/ethtool -s %i wol g
Type=simple

[Install]
WantedBy=multi-user.target

I enabled the service with

systemctl enable wol@*interface*.service

and rebooted. Again

sudo ethtool *interface* | grep Wake-on
	Supports Wake-on: pumbg
	Wake-on: d

with

systemctl status wol@*interface*
○ wol@*interface*.service - Wake-on-LAN for *interface*
     Loaded: loaded (/usr/lib/systemd/system/wol@.service; enabled; preset: disabled)
     Active: inactive (dead) since Wed 2025-03-12 12:18:42 CET; 9min ago
   Duration: 9ms
 Invocation: 22a932d483cc45178dc457b7b5bcddb9
    Process: 1169 ExecStart=/usr/bin/ethtool -s *interface* wol g (code=exited, status=0/SUCCESS)
   Main PID: 1169 (code=exited, status=0/SUCCESS)
   Mem peak: 1.4M
        CPU: 9ms

mar 12 12:18:42 Icarus systemd[1]: Started Wake-on-LAN for *interface*.
mar 12 12:18:42 Icarus systemd[1]: wol@*interface*.service: Deactivated successfully.

No errors, it seems to execute successfully, and indeed

systemctl start wol@*interface*

yields

sudo ethtool *interface* | grep Wake-on
	Supports Wake-on: pumbg
	Wake-on: g

but the switch doesn’t occur when rebooting. Why?

Using NetworkManger

I also tried using NetworkManager. I’ve set

nmcli c modify "2b146309-34bd-36a4-a075-c836ca1f9eb5" 802-3-ethernet.wake-on-lan magic

so we have

nmcli c show "2b146309-34bd-36a4-a075-c836ca1f9eb5" | grep wake-on-lan
802-3-ethernet.wake-on-lan:             magic
802-3-ethernet.wake-on-lan-password:    --

Again, rebooting,

sudo ethtool *interface* | grep Wake-on
	Supports Wake-on: pumbg
	Wake-on: d

Conclusion

Alas, all three methods seem to have failed me, and i can’t quite make heads or tails of why. I feel I’m missing something obvious, but it’s not clear to me. Any hints would be appreciated!

Best regards,
wnabee

[EDIT: formatting]

1 Like

I’m afraid I have no hints.

Some system information might help others identify possible contributors to the problem.

This is usually a minimum Support requirement.

Regards.


System Information

Output of this command (formatted according to forum requirements) may be useful for those wishing to help:

inxi --filter --verbosity=8

or the short form:

inxi -zv8

Those with privacy concerns, note that when -z, or --filter is used, all personally identifiable information is filtered out from the resulting inxi output. :eyes:

don’t use the power button on my main computer at home. I wake it up with voice.

I don’t know if this will help, but I’ve been doing it like this for at least 2 years.

@reboot sleep 6 && iw phy0 wowlan enable magic-packet disconnect

second delay. I tested it a lot and set it to 6 seconds.

You have nothing to lose, so why not try it out and see if you can get it right? crontab.

ggl :: iw phy0 wowlan enable

❱ inxi -nz
Network:
  Device-1: Intel I211 Gigabit Network driver: igb
  IF: enp5s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: Intel Wi-Fi 6E AX210/AX1675 2x2 [Typhoon Peak] driver: iwlwifi
  IF: wlp6s0 state: up mac: <filter>

This setting was tested when I purchased the following.
I am not using it now. Intel Wi-Fi 6E AX210