After allowing Wake On LAN in the BIOS (example), we need to setup the OS to allow Wake On LAN.

Take Ubuntu 24.04 Desktop as an example. (The interface name enp5s0 may differ across different machines.)

$ nmcli d
DEVICE   TYPE      STATE                   CONNECTION
enp5s0   ethernet  connected               netplan-enp5s0
lo       loopback  connected (externally)  lo
docker0  bridge    connected (externally)  docker0
$ sudo nmcli c modify netplan-enp5s0 802-3-ethernet.wake-on-lan magic
$ sudo reboot
$ sudo ethtool enp5s0 | grep Wake-on # should show `Wake-on: g`

Take Proxmox VE 7.3 as an example. (The interface name enp7s0 may differ across different machines.)

# vim /etc/network/interfaces # and add the following:
auto enp7s0
iface enp7s0 inet manual
        post-up /usr/sbin/ethtool -s enp7s0 wol g

Note: The network interface name (e.g., enp5s0, enp7s0) may change if hardware is added or removed. If this happens, you may need to update your configuration accordingly.

To send the wake-on-lan packet from another machine, you can use the following command, where <mac_address> is the MAC address of the machine you want to wake up with the format XX:XX:XX:XX:XX:XX.

wakeonlan <mac_address>

Please note that above will only work with wired network within the same local network.

If you want to send the wake-on-lan packet from another machine over the internet, you can use the following command:

wakeonlan -p <port> -i <public_ip> <mac_address>

The target machine will need to have a static IP address and a port forwarding rule set up on the router (no running services are required on the target machine).

References:

Posted:

Comments are configured with provider: disqus, but are disabled in non-production environments.