There are multiple settings in the MSI bios that need to be changed: “ERP Ready” must be disabled and “Resume by PCI-E Device” must be enabled.
The package ethtool must be installed:
Debian/Ubuntu:
sudo apt install ethtool
Arch:
sudo pacman -S ethtool
Find the network interface name and MAC address of the machine using:
ip link
Use the network interface name with ethtool to check the the wake settings :
sudo ethtool eth0 | grep Wake
The Wake-on mode must be on g:
sudo ethtool -s eth0 wol g
Check the Wake-on mode has changed:
sudo ethtool eth0 | grep Wake
To keep the Wake-on mode set to g after a reboot, a crontab can be used:
sudo crontab -e
Insert this line to the crontab to set the Wake-on mode to g after a reboot:
@reboot /usr/bin/ethtool -s eth0 wol g
The WOL is now fully set up on the client.
To wake this machine from another machine on the local network, the wakeonlan command is used with the MAC address found earlier:
wakeonlan mac-address