Make wake on LAN persistent after reboot

On Bazzite 41, wake on LAN does not seem to be enabled by default. The output of sudo ethtool enp3s0 | grep Wake-on initially looks like this:

Supports Wake-on: pumbg
Wake-on: d

And after enabling it with sudo ethtool -s enp3s0 wol g, the above command results in this:

Supports Wake-on: pumbg
Wake-on: g

When I put my system to sleep and try WOL, it works as expected. However, this setting is not persistent after a reboot. Does this have something to do with the immutable nature of Bazzite? Is there a way to make this setting change persistent?

Apologies in advance, I’m not very skilled with Linux in general, and I’m totally new to immutable distros. I feel like I might be missing something really simple.

After looking into it more, is it possible that I should be adding ETHTOOL_OPTIONS="wol g" to a configuration file somewhere?

It seems like the right place to configure this is /etc/sysconfig/network-scripts/ifcfg-<interface>. However, neither that file nor the network-scripts folder existed. I created both and added the above line to the blank file. On reboot, the file was still there but the setting wasn’t active. Should I be adding it somewhere else? Or does this config file need other options as well in order to work?

Aha–I may have solved this problem. Apparently ifcfg files were depricated awhile back and the correct tool now is Network Manager via the command line with nmcli. I found the instructions on StackExchange but I’ve included them below for posterity in case someone else has this issue.

Find the connection name:

nmcli connection show

Check to see what the current wake-on setting is:

nmcli connection show "connection-name" | grep wake-on
802-11-wireless.wake-on-wlan:           0x0 ()

Modify the connection:

nmcli connection modify "connection-name" 802-11-wireless.wake-on-wlan 8

For me, this successfully changed the wake-on setting to multicast and that change was persistent after reboot. I assume this will enable wak-on, but I will test and report back.

One correction to my previous post. The line below:

Should actually be:

nmcli connection modify "connection-name" 802-11-wireless.wake-on-wlan magic

With a value of 8, my system would immediately wake back up after going to sleep. With a value of magic, everything works perfect.

Anyways, this is solved.