Wake-on-LAN in Ubuntu
Reference: How to Enable Wake-on-LAN in Ubuntu 22.04
Enable Wake-On-Lan feature
Register the mac address.
To view and change the Wake-On-Lan settings, the "ethtool" package must be installed:
Find out if the network card supports wake-on-LAN:
The expression Wake-on:d
indicates that the wake-on-lan feature of the network card is supported but deactivated.
Run the following commands to enable wake-on-lan on your network card:
Some motherboard manufacturers require you to change the settings in the BIOS to enable this feature. If there is no change when you check after entering the command, it is recommended to look at the BIOS settings.
Auto Wake-On-Lan activation at startup
If the Wake-on-Lan settings are deactivated when the server is restarted; you should solve this problem with systemd. Create systemd service:
[Unit]
Description=Enable Wake-up on LAN
[Service]
Type=oneshot
ExecStart=/sbin/ethtool -s enp2s0 wol g
[Install]
WantedBy=basic.target
Replace the enp2s0
value with your own network interface value. Then reload and enable the service:
Remote Ubuntu server wake up
Now, the steps to be done on the server that will do the wake-up task.
Wake up remote server using:
where 30:5a:3a:0d:ac:0d
is the remote server MAC address