Wake-on-LAN
Verify BIOS/UEFI Settings
Most motherboards require that Wake-on-LAN be enabled in the BIOS or UEFI settings. To check this:
- Restart the server and enter the BIOS/UEFI settings (usually by pressing a key like
Delete,F2, orF10during boot). - Look for an option labeled "Wake-on-LAN," "Power On by PCI-E/PCI," or something similar. This setting needs to be enabled.
- Save and exit the BIOS.
Confirm and enable Wake-on-LAN Setting with ethtool
First identify which interface to assign for wake-on-lan.
ifconfig
Then identify if the interface has wake-on-lan enabled:
# sudo apt install ethtool
sudo ethtool <interface>
You should see Wake-on: g. If it's set to d, you'll need to enable it again:
sudo ethtool -s <interface> wol g
Make setting persistent
sudo nano /etc/netplan/01-network-manager-all.yaml
Set configuration:
network:
version: 2
ethernets:
<interface>:
dhcp4: false
wakeonlan: true
addresses:
- 192.168.80.91/24
routes:
- to: default
via: 192.168.80.1
nameservers:
addresses:
- 8.8.8.8
- 1.1.1.1
renderer: NetworkManager
sudo netplan try # To diagnose any issues in yaml file
sudo netplan apply
Running wakeonlan
You can now:
sudo systemctl suspend
the server machine. And from another machine in the network you can:
wakeonlan <MAC>
to wake the server.