I've setup wakeonlan on an Ubuntu 22.04 machine using iw, following this tutorial:
$ sudo iw phy0 wowlan enable magic-packet disconnect
I then control the machine over ssh with wakeonlan <MAC> and systemctl suspend, this most often works. But sometimes, after wakeonlan, the network interface is down and does not appear in ifconfig output anymore (unless -a is provided). Trying to re-enable it causes an error:
$ sudo ifconfig wlp4s0 up
SIOCSIFFLAGS Input/output error
The network manager service provides the following logs:
Feb 27 21:45:26 Z390-GAMING-X NetworkManager[33337]: <warn> [1677530726.0879] device (wlp4s0): re-acquiring supplicant interface (#1).
Feb 27 21:45:26 Z390-GAMING-X NetworkManager[33337]: <error> [1677530726.5096] device (wlp4s0): Couldn't initialize supplicant interface: GDBus.Error:fi.w1.wpa_supplicant1.UnknownError: wpa_supplicant couldn't grab this interface.
with the following logs for wpa_supplicant:
Feb 27 21:45:26 Z390-GAMING-X wpa_supplicant[835]: Could not set interface wlp4s0 flags (UP): Input/output error
Feb 27 21:45:26 Z390-GAMING-X wpa_supplicant[835]: nl80211: Could not set interface 'wlp4s0' UP
Feb 27 21:45:26 Z390-GAMING-X wpa_supplicant[835]: nl80211: deinit ifname=wlp4s0 disabled_11b_rates=0
I've tried to follow this (unmask wpa_supplicant.service) and disabling WiFi Powersave, without success. Any ideas on how to solve this are welcome. My network card is an Intel Wireless-AC 9260.
A perhaps important note: I could not setup wakeonlan with ethtool as described in Ubuntu's documentation, since I got the following output:
$ sudo ethtool wlp4s0
Settings for wlp4s0:
Link detected: yes
That is, there is no Wake-on: field as I would expect. Trying to enable it with ethtool returns an error:
$ sudo ethtool -s wlp4s0 wol g
netlink error: Operation not supported