How to activate WOL Wake-on-Lan on openSUSE Tumbleweed

TLDR

You need to create a new service and activate it. You don´t use sudo in the service. After this you can wake up the computer using a smartphone or another computer.

Context

I wanted to activate wake-on-lan (wol) on openSUSE Tumbleweed as I recently formated my desktop computer and installed openSUSE on dual-boot with Aurora Linux.

I had managed to configure wol on Aurora, and I use it a low when I want to remotely access my computer. As I don't want to have it always-on, I send a "magic package" to my desktop using Home Assistant, and it wakes up. A couple of seconds later, I can access it using Termux on Android through my Home VPN.

One thing for me to remember is: Always take notes. This time I could not remember how I activated WOL on Aurora, and I was sure I had written a post on that (but I see I didn´t)

Anyway, here is how this works for openSUSE Tumbleweed.

Steps

1. Create a new service

sudo nano /etc/systemd/system/wol.service

and paste the following

[Unit]
Description=Enable Wake-on-LAN
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/bin/sleep 10
ExecStart=/usr/sbin/ethtool -s enp42s0 wol g
RemainAfterExit=yes

[Install]
WantedBy=default.target

NOTE: Here my network adapter is enp42s0. You can find yours using

ip a

and finding the adapter. Then replace enp42s0 with yours. (one example would be eth0)

2. Enable the service

sudo systemctl enable wol.service

This will get an output similar to:

> sudo systemctl enable wol.service 
Created symlink '/etc/systemd/system/default.target.wants/wol.service'  '/etc/systemd/system/wol.service'.

3. Start the service

systemctl start wol.service 

you may as well use sudo. IN this case (without sudo) you get a prompt to enter the password.

I didn´t get any output from this command.

4. Check the service status

sudo systemctl status wol.service 

This gets you such an output

> sudo systemctl status wol.service  wol.service - Enable Wake-on-LAN
     Loaded: loaded (/etc/systemd/system/wol.service; enabled; preset: disabled)
     Active: active (exited) since Sun 2025-08-03 18:08:31 CEST; 7s ago
 Invocation: d41db84f8a1d4350a5370190a6afff83
    Process: 574240 ExecStart=/usr/bin/sleep 10 (code=exited, status=0/SUCCESS)
    Process: 574287 ExecStart=/usr/sbin/ethtool -s enp42s0 wol g (code=exited, status=0/SUCCESS)
   Main PID: 574287 (code=exited, status=0/SUCCESS)
        CPU: 12ms

Aug 03 18:08:21 titan-tw systemd[1]: Starting Enable Wake-on-LAN...
Aug 03 18:08:31 titan-tw systemd[1]: Finished Enable Wake-on-LAN.

And that's it. Now you can wake up your computer. To test it, you can shut it down or put it to sleep and send the magic package. I do that using Home Assistant. There is also the "Wake on Lan" app on Andrid by Florian Möhle

Additional Information

I tried the info I found in the openSUSE forums, but I got the following error:

> sudo systemctl start wol.service 
Job for wol.service failed because the control process exited with error code.
See "systemctl status wol.service" and "journalctl -xeu wol.service" for details.
daco@titan-tw /r/m/d/a/h/d/.c/s/user [1]> sudo systemctl status wol.service 
× wol.service - Enable Wake-on-LAN
     Loaded: loaded (/etc/systemd/system/wol.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Sun 2025-08-03 18:06:06 CEST; 9s ago
 Invocation: 02556686f09a41fa8b02e65edd347073
    Process: 572630 ExecStart=/usr/bin/sleep 10 (code=exited, status=0/SUCCESS)
    Process: 572644 ExecStart=/usr/bin/sudo /usr/sbin/ethtool -s enp42s0 wol g (code=exited, status=203/EXEC)
   Main PID: 572644 (code=exited, status=203/EXEC)
        CPU: 10ms

Aug 03 18:05:56 titan-tw systemd[1]: Starting Enable Wake-on-LAN...
Aug 03 18:06:06 titan-tw (sudo)[572644]: wol.service: Unable to locate executable '/usr/bin/sudo': Permission denied
Aug 03 18:06:06 titan-tw (sudo)[572644]: wol.service: Failed at step EXEC spawning /usr/bin/sudo: Permission denied
Aug 03 18:06:06 titan-tw systemd[1]: wol.service: Main process exited, code=exited, status=203/EXEC
Aug 03 18:06:06 titan-tw systemd[1]: wol.service: Failed with result 'exit-code'.
Aug 03 18:06:06 titan-tw systemd[1]: Failed to start Enable Wake-on-LAN.

The error was the use of sudo in the service. I removed it and it worked.

I leave this as reference for my future self.