Wake on LAN not working

Hi,

I did a clean install of EndeavourOS on my PC and now wake on LAN is not working anymore. It used to work with Manjaro without a problem. I have not change anything in the BIOS.

I followed all instructions on https://wiki.archlinux.org/index.php/Wake-on-LAN . These have been the instructions to get it working on Manjaro too. But now it is not working.

After boot I get:

ethtool enp39s0 | grep Wake
	Supports Wake-on: pumbg
	Wake-on: d

Then I set it:

ethtool -s enp39s0 wol g
ethtool enp39s0 | grep Wake
	Supports Wake-on: pumbg
	Wake-on: g

But when I reboot it is disabled again.

Default network driver is r8169. But I also followed the suggestion to boot with r8168 once to get it working. Blacklisting r8169 etc. But that did not help.

I also created the file /etc/systemd/network/50-wired.link as suggested in the arch wiki:

[Match]
MACAddress=00:d8:61:9d:02:43

[Link]
NamePolicy=kernel database onboard slot path
MACAddressPolicy=persistent
WakeOnLan=magic

I didn’t have to do that with Manjaro. But it didn’t help anyways.

I also configured NetworkManager to support WOL according to the wiki. But that did not help. Now I have disabled NetworkManager. But it did not help.

Now I am lost. I know that it should work. Any idea how to get this going again?

PS
Motherboard: MPG X570 GAMING EDGE WIFI (MS-7C37)

That would work if you use systemd-networkd to manage your network.

What about the systemd service, https://wiki.archlinux.org/index.php/Wake-on-LAN#systemd_service , or one of the other options?

This said, Network Manager should manage this itself, it has a WoL option right there in the network settings…

image

I assume you’ve tried changing that from Default to Magic (assuming Magic is correct for your setup)?

Oh, it’s also worth trying kernel 5.4 in case this is a 5.9 regression.

This is what I did. I disabled NetworkManager and enabled systemd-networkd:

3# systemctl status systemd-networkd
â—Ź systemd-networkd.service - Network Service
     Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2020-10-25 14:53:07 CET; 2min 26s ago
TriggeredBy: â—Ź systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
   Main PID: 391 (systemd-network)
     Status: "Processing requests..."
      Tasks: 1 (limit: 77076)
     Memory: 2.4M
     CGroup: /system.slice/systemd-networkd.service
             └─391 /usr/lib/systemd/systemd-networkd

Okt 25 14:53:07 rakete systemd[1]: Starting Network Service...
Okt 25 14:53:07 rakete systemd-networkd[391]: Enumeration completed
Okt 25 14:53:07 rakete systemd[1]: Started Network Service.
Okt 25 14:53:10 rakete systemd-networkd[391]: eth0: Interface name change detected, eth0 has been renamed to enp39s0.
Okt 25 14:53:10 rakete systemd-networkd[391]: enp39s0: IPv6 successfully enabled
Okt 25 14:53:10 rakete systemd-networkd[391]: enp39s0: Link UP
Okt 25 14:53:13 rakete systemd-networkd[391]: enp39s0: Gained carrier
Okt 25 14:53:13 rakete systemd-networkd[391]: enp39s0: DHCPv4 address 192.168.132.74/24 via 192.168.132.1
Okt 25 14:53:15 rakete systemd-networkd[391]: enp39s0: Gained IPv6LL

I tried that and because it was not working I moved to systemd-networkd.

It does not depend on the kernel. I even built the Manjaro kernel and tried that one. It does not work either.

I installed wol-systemd. This installs the service for wake on lan which excuted ethtool dutring boot:

# /usr/lib/systemd/system/wol@.service
[Unit]
Description=Wake-on-LAN for %i
Requires=network.target
After=network.target

[Service]
ExecStart=/usr/bin/ethtool -s %i wol g
Type=oneshot

[Install]
WantedBy=multi-user.target

That runs fine:

5# systemctl status wol@enp39s0.service 
â—Ź wol@enp39s0.service - Wake-on-LAN for enp39s0
     Loaded: loaded (/usr/lib/systemd/system/wol@.service; enabled; vendor preset: disabled)
     Active: inactive (dead) since Sun 2020-10-25 14:53:17 CET; 5min ago
    Process: 3931 ExecStart=/usr/bin/ethtool -s enp39s0 wol g (code=exited, status=0/SUCCESS)
   Main PID: 3931 (code=exited, status=0/SUCCESS)

Okt 25 14:53:17 rakete systemd[1]: Starting Wake-on-LAN for enp39s0...
Okt 25 14:53:17 rakete systemd[1]: wol@enp39s0.service: Succeeded.
Okt 25 14:53:17 rakete systemd[1]: Finished Wake-on-LAN for enp39s0.

But nevertheless, directly after boot, WOL is disabled:

2# ethtool enp39s0 | grep Wake
	Supports Wake-on: pumbg
	Wake-on: d

it looks like the value is overwritten again after wol@enp39s0.service has run.

2 Likes

This is so weird. Something is messing up the wol settings at the end of the boot process and most likely also during shutdown.

Directly after boot I see that the wol@enp39s0 service was excecuted successfully:

4# systemctl status wol@enp39s0
â—Ź wol@enp39s0.service - Wake-on-LAN for enp39s0
     Loaded: loaded (/usr/lib/systemd/system/wol@.service; enabled; vendor preset: disabled)
     Active: inactive (dead) since Sun 2020-10-25 15:33:22 CET; 44s ago
    Process: 4100 ExecStart=/usr/bin/ethtool -s enp39s0 wol g (code=exited, status=0/SUCCESS)
   Main PID: 4100 (code=exited, status=0/SUCCESS)

Okt 25 15:33:22 rakete systemd[1]: Starting Wake-on-LAN for enp39s0...
Okt 25 15:33:22 rakete systemd[1]: wol@enp39s0.service: Succeeded.
Okt 25 15:33:22 rakete systemd[1]: Finished Wake-on-LAN for enp39s0.

But the status of the network device is not reflecting this.

9# ethtool enp39s0 | grep Wake
	Supports Wake-on: pumbg
	Wake-on: d

When I now start the wol@enp39s0 service again:

systemctl start wol@enp39s0

The settings are correct:

11# ethtool enp39s0 | grep Wake
	Supports Wake-on: pumbg
	Wake-on: g

Something is reverting what wol@enp39s0` is doing during boot. And I am afraid that something similar happens during shutdown so that the results of the manual wol@enp39s0 run are not surviving.

Any idea how I can find out which sersvice or script is messing with the network device? NetworkManager is deinstalled.

It sounds like it could be a power management thing… have you installed TLP or something similar?

1 Like

@mbod
What is your network device.
lspci -v

Edit: Sorry , I see you are using the r8169 module.

Edit2: Did you try uninstalling the r8168 package and just use the kernel module r8169.

This was it. tlp was installed and active. I disabled it and WOL works immediately.
Thank you, @jonathon. You made my day.

But why is the tlp package installed and active in the first place? This is a desktop PC. I did not install tlp. And /var/log/pacman.log has no entry for tlp. I believe this has come with the initial installation of EndeavourOS. Can that be? If yes, I believe this is a bug.

3 Likes

My view is that power saving is useful on all computers, not just laptops. Also, some might view disabling WoL by default as a good thing (e.g. more secure).

There’s a TLP setting in /etc/tlp.conf to leave WoL alone:

# Disable wake on LAN: Y/N.
# Default: Y

#WOL_DISABLE=Y

Distros distribute the software they think is worth distributing. Defaults are down to the maintainers. :man_shrugging:

1 Like

Yes. I understand that. They could even install libreoffice out of the box if they like it. But installing tlp and disabling wake on LAN is a different story. Especially when the tlp config is not customized. The default tlp config says: "TLP comes with a default configuration already optimized for battery life,". Desktop PCs have no battery life to worry about.

I think this is worth while a discussion about EndeavourOS defaults.

2 Likes

Hey there!

I just wanted to write to say that I was running into the exact same problem as @mbod today - thank you for taking the time to write up your experience so thoroughly. I installed EndeavourOS for the first time today and was completely puzzled as to why my WOL behaviour seemed to be completely different from a Manjaro installation on the same machine. Even more curious, I could make hibernate work perfectly if I did echo disk > /sys/power/state, so I was certain that I had my swap and kernel resume parameters set correctly - but as soon as I ran systemctl hibernate, sadness ensued. It seemed like the issue must be a service that systemd was triggering that was triggering the issue, but it was very hard to find (as I’m sure you found out too).

I’ll throw my two cents in here and also say that saving power is a great idea, but enabling TLP by default on a desktop machine was a bit of a surprise. Maybe the EndeavourOS installer could ask a couple questions of the user during installation to get a better feel as to whether or not enabling TLP is a good idea? (e.g. “Is this a laptop, desktop, or server?”)

1 Like

Welcome Aboard!

1 Like

I dont understand to active wake on lan, when boot returned wake on D :cry: