Configure Wake-on-LAN on Ubuntu¶
In this doc, we will configure & persist Wake-on-LAN on a Ubuntu machine using Netplan.
Wake-on-LAN (WoL) lets us remotely power on a machine/pc using a magic packet.
To enable WoL, first we need to check if our network interface supports Wake-on-LAN:
sudo ethtool <interface-name>
## Look for Output:
# ...
# Supports Wake-on: pumbg
# Wake-on: d
# ...
g in Supports means it supports magic packet WoL.
* Wake-on: d means WoL is currently disabled.
We can temporarily enable WoL using ethtool:
But this will not presist over restart.💡 We will also have to enable WoL in the BIOS/UEFI as well before OS can utilize it.
⚙️ Enable Persistent WoL via Netplan¶
Edit/Add your Netplan config:
Replace
<interface-name>with actual interface name.
Then apply changes:
This should presist WakeOnLan. We can verify again after reboot using command:
Try Wake-on-Lan by sending a Magic Packet ✨¶
Now, let us shutdown the machine and try to boot it using WoL. Before shutdown copy the Mac address on the machine using ip a command.
Next, we can install wakeonlan utility to send our magic packet.
Then send a magic packet to target machine on the same network:
Make sure the target PC is connected to the same network and its BIOS/UEFI has WoL enabled.