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]