Enabling Wake on LAN for Linux

First find you interfaces:

In this case my device has one local ethernet port. Next we need to see if that interface supports wake on lan:

sudo ethtool -s eth0 wol g but after reboot WOL would no longer work to correct for this we need to run this command sometime after the network comes up during startup. Most people now use systemd as their init (program that starts all other programs/services) but the same principle applies to any init.

First create an oneshot service:

add this text to the file and adapt the filename to your interface:

[Unit]
Description=Wake-on-LAN for %i
Requires=network.target
After=network.target

[Service]
ExecStart=/sbin/ethtool -s %i wol g
Type=oneshot

[Install]
WantedBy=multi-user.target

After that we need to get systemd to see the new service file:

To try it once:

To run this command at every boot:

Leave a Reply

Your email address will not be published. Required fields are marked *