How to Wake-On-LAN / Wake-On-WAN on ubuntu


Install required tool:

$ sudo apt install ethtool

Get ethernet interface

$ ip a

Let’s assume it’s enp1s0

Check if the WOL is available:

$ sudo ethtool enp1s0

Set WOL on:

$ sudo ethtool --change enp1s0 wol g

After sudo ethtool enp1s0 the Wake-on: d should be changed to Wake-on: g

But this will be reset after reboot, so:

Make it permanent via service

Get the ethtool executable’s full path by running which ethtool

Create a service file sudo touch /etc/systemd/system/wol.service and put next content in it using vim:

Description=Enable Wake On Lan

ExecStart=/usr/sbin/ethtool --change enp1s0 wol g


Enable service:

$ sudo systemctl enable wol.service
$ sudo systemctl start wol.service

// check the status
$ sudo systemctl status wol.service

Test WOL

Install wakeonlan package:

$ sudo apt install wakeonlan

// call for action
$ wakeonlan C0:C7:E7:1E:14:77

// or
$ wakeonlan -i -p 9 C0:C7:E7:1E:14:77

// 7 & 9 (mostly 9) are default UDP ports used for WOL

Enable Wake-On-WAN

Make 9 (or 7) UDP port forwarding via router to the device using port mapping.

Use mobile apps by adding your network external IP and device MAC address:
(I personally prefer:


You can setup a VPN using OpenVPN and use test step, mentioned above

Leave a Reply