Wake-on-LAN
If your computer supports Wake-on-LAN (WOL), you can send a “magic packet” to wake it from a powered-down state. This is primarily supported on Ethernet connections.
-
Identify network interface
Section titled “Identify network interface”Find the name of your Ethernet adapter. Look for names starting with
e(e.g.,eth0orenp3s0).Terminal window ip link show -
Install ethtool
Section titled “Install ethtool”Install the utility required to manage network hardware settings.
Terminal window sudo apt update && sudo apt install ethtool -y -
Check support
Section titled “Check support”Verify if your hardware supports the magic packet. Look for
gin the “Supports Wake-on” line.Terminal window sudo ethtool $INTERFACE_NAME -
Enable WOL (temporary)
Section titled “Enable WOL (temporary)”Enable WOL manually to test the configuration. This setting will reset after a reboot.
Terminal window sudo ethtool -s $INTERFACE_NAME wol g -
Persist with systemd
Section titled “Persist with systemd”Create a service to ensure WOL is re-enabled automatically on every boot.
/etc/systemd/system/wol.service [Unit]Description=Enable Wake On Lan[Service]Type=oneshotExecStart=/usr/sbin/ethtool -s $INTERFACE_NAME wol g[Install]WantedBy=basic.target -
Enable the service
Section titled “Enable the service”Reload systemd and enable the new service.
Terminal window sudo systemctl daemon-reload && sudo systemctl enable wol.service -
Send Wake-up packet
Section titled “Send Wake-up packet”From another device on the network, trigger the boot sequence using the target’s MAC address.
Terminal window wakeonlan $MAC_ADDRESS