Skip to content

Instantly share code, notes, and snippets.

@Kambaa
Last active November 18, 2023 10:30
Show Gist options
  • Save Kambaa/cf10460bcec4184bf1f8b3cba3af3d0d to your computer and use it in GitHub Desktop.
Save Kambaa/cf10460bcec4184bf1f8b3cba3af3d0d to your computer and use it in GitHub Desktop.
Enable Wake On LAN on Proxmox/Debian

From:

systemd.link

Link-level configuration is possible through systemd-networkd#link files. The actual setup is performed by the net_setup_link udev builtin. Add the WakeOnLan option to the network link file:

add this file with the contents below(don't forget to edit your MAC address accordingly) /etc/systemd/network/50-wired.link

[Match]
MACAddress=aa:bb:cc:dd:ee:ff

[Link]
NamePolicy=kernel database onboard slot path
MACAddressPolicy=persistent
WakeOnLan=magic

reboot and test it.

OLDER GIST:

From:

Enable Wake On LAN on Proxmox/Debian

Wake on LAN is very useful functionality if your hardware supports it. Here is a good tutorial on the steps required to enable WOL on a device. This typically needs to be enabled in the BIOS first and the steps below will enable it in Linux https://www.lifewire.com/wake-on-lan-4149800

  1. After enabling WOL in the BIOS, boot into Linux and login
  2. Run the following commands in a terminal window
# install ethtool
 sudo apt install ethtool -y
# list network devices
 ip addr
  1. Look for the device that has a local IP address (192.168 or 10.10)
  2. Note the device name and the MAC address for use later when sending the magic packet
  3. Continue with the following commands to check if the device supports WOL
# replace eno1 with the device name to test
 sudo ethtool eno1
  1. Find the Supports Wake-on line
  2. If it contains a g it supports WOL, continue with the following commands
# enable wol on the device
 sudo ethtool -s eno1 wol g
# edit the network interfaces configuration
 sudo nano /etc/network/interfaces
  1. Paste the following below the iface line for the network device
ethernet-wol g
  1. Press CTRL+O, Enter, CTRL+X to write the changes
  2. Shutdown the device
  3. Test to see if WOL is working by sending a magic packet
  4. If everything is setup correctly the device should awaken from it's slumber and boot up
  5. Log back into the device and run the following command to verify the Wake-on value has updated to g on boot
# replace eno1 with the device name to test
 sudo ethtool eno1

NOTE: If the WOL flag doesn't stick with the configuration above, replace the "ethernet-wol g" value in /etc/network/interfaces with "post-up /usr/sbin/ethtool -s eno1 wol g", replacing eno1 with the name of the interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment