I've followed the instructions on https://help.ubuntu.com/community/WakeOnLan but i'm having difficulty getting it working. My BIOS is enabled for wake on lan and i've been able to do it using windows hibernate/sleep with the same NIC.
5 Answers
If the cause is WoL settings not being persistent after reboot as explained in the previous answer, there is a simpler solution, which is posted here: https://askubuntu.com/a/1051894/883129
- Make sure you have
ethtool
andwakeonlan
installed. - Create
/etc/network/if-up.d/wol_fix
file with the following content:
where [card] is the name of your ethernet adapter, such as#!/bin/sh /sbin/ethtool -s [card] wol g
eth0
,enp4s0
etc. (you can check this withifconfig
command). - Then run:
sudo chmod +x /etc/network/if-up.d/wol_fix

- 355
-
After trying a lot of options, this answer was the only that really worked. – Ivan Nov 25 '20 at 19:58
Ubuntu allows Netplan for configuration. Look for the interface entry in /etc/netplan/*.yaml
and enable wakeonlan
. E.g.
network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: true
wakeonlan: true
Run 'netplan apply' after changes. To see the current setup 'netplan get all'
The filename can differ, check for 01-netcfg.yaml
and others. One can also create a new one.

- 263
- 2
- 7
-
Out of the suggested solutions in this thread, this was the only one that worked for me on Ubuntu Server 20.04 – Gecko Mar 02 '22 at 14:26
-
Ok so my ubuntu 22.04 system netplan does not recognize the command ethernets: What do I do? – nigus21 Dec 16 '22 at 21:36
I recently upgraded to Linux Mint 20. After re-installing the "wakeonlan" package I noticed it was not working. It turned out that upon shutdown, the wakeonlan option was being disabled. Here's how I worked around it.
On the computer you want to be able to wake up remotely...
Become root...
sudo su
Install the wakeonlan program on the computer you want to be able to wake up remotely.
apt install wakeonlan
Find your ethernet adapter, mine was called 'enp10s0' (usually called 'eth0').
ifconfig -a
Check the ethernet adapter to see what "Wake-on" is set to. See below link for diffent options and what they mean. https://www.thomas-krenn.com/en/wiki/Wake_On_LAN_under_Linux
ethtool enp10s0
Non-interactive creation of script which will set the "Wake-on" option to "g" which means "Wake on MagicPacket". For the next step (systemd) to work correctly, you must have the she-bang line included on the first line of the file.
cat >> /root/wol_fix.sh <<EOF
#!/bin/bash
ethtool -s enp10s0 wol g
EOF
Set correct permissions for the fix script.
chmod 755 /root/wol_fix.sh
Non-interactive creation of script which will run on boot to run the fixing script.
cat >> /etc/systemd/system/wol_fix.service <<EOF
[Unit]
Description=Fix WakeOnLAN being reset to disabled on shutdown
[Service]
ExecStart=/root/wol_fix.sh
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
EOF
Reload the systemd manager configuration.
systemctl daemon-reload
Enable to wol_fix service script.
systemctl enable wol_fix.service
NOTE: must reboot for the on-boot script to take effect. Or you can run the /root/wol_fix.sh script manually this time only before your next shutdown or reboot.
reboot
On computer you want to use to remotely wake up your other computer...
# [another_computer]$
Non-interactive creation of script to wake up computers on network. The "255" means only broadcast to a specific subset of the IP range on the local network.
cat >> /home/$USER/wakeuppc.sh <<EOF
wakeonlan -i 192.168.1.255 <MAC ADDRESS>
EOF
Add execute permisson for the wakeonlan caller script.
chmod +x /home/$USER/wakeuppc.sh

- 19
-
https://askubuntu.com/questions/1253519/trying-to-configure-wake-on-lan-with-ethtool-on-ubuntu-20-04#comment2303889_1253797 was helpful for me. I still can't get
wakeonlan -i 192.168.1.255 <MAC ADDRESS>
to do anything though. No effect. – Ryan Jun 24 '21 at 13:46 -
Thanks for the hint to the tlp.conf
.
This was the reason why my WOL was not working.
Be sure to uncomment the WOL_DISABLE
setting and set it to NO:
# Disable wake on LAN: Y/N.
# Default: Y #
WOL_DISABLE=N

- 135

- 11
- 2
-
1Kindly add qualifiers as to why this solves the problem. In this case, TLP is a utility to control ThinkPad power related features, which is important to include in an answer. – Xaldew Feb 03 '23 at 12:29
-
I don't have a Thinkpad nor a laptop, but this solved it for me, I have no clue though why it solved it nor why it was installed in the first place. – ferdymercury Feb 03 '23 at 14:31
I had similar problem... I tried all the possible solutions and noone worked for me. Finally I discovered that my problem was related to the TLP. In its config, file tlp.conf in /etc/ folder, there is the deactivation of the wol service so after I changed there the wol service started working again.

- 11
-
-
https://askubuntu.com/questions/1142470/trouble-with-wake-on-lan-ubuntu-16-04 – ferdymercury Oct 13 '22 at 10:50
-
Kindly add qualifiers as to why this solves the problem. E.g., TLP is a utility to control ThinkPad power related features; if you are using a ThinkPad laptop, this setting might disable WoL. – Xaldew Feb 03 '23 at 12:31