How To Enable Wake On LAN

  • Operation confirmed with
    • Ubuntu 18.10 with 4.18 kernel.
    • Manjaro 18.0 with 4.19 kernel.
  • Confirmed version of Realtek LAN Driver is 8.046.00.

You can make WOL enabled on both two LAN port.

This guide helps you to set WOL on your system.

It is recommended to update your system before following the guides.


Ubuntu or Debian Based Linux DISTRO

# Upgrade system packages
$ sudo apt update && sudo apt full-upgrade
 
# Install packages for build a module and working with WOL
$ sudo apt install build-essential libelf-dev ethtool

Manjaro or Arch Linux Based Linux DISTRO

# Upgrade system packages
$ sudo pacman -Syu
 
# Install packages for build a module and working with WOL
# Press "Enter" to install all the packages when it prompts
$ sudo pacman -S base-devel linux419-headers ethtool

Especially in Arch Linux distros, you should check TLP options and have to set WOL_DISABLE option to N.

$ sudo vi /etc/default/tlp
...
WOL_DISABLE=N
...

Then reboot your system.

$ reboot

Download the latest Realtek LAN driver.
Download LINUX driver for kernel up to 4.15. It isn't downloaded directly on that page, you should enter your email address to get a temporary download page.
The driver described as “for kernel up to 4.15”, but this works on 4.18 or 4.19. Maybe works on the future kernels as well.

Then extract that.

Open a Terminal and go to the extracted directory.
Then enter the commands below.

$ sudo ./autorun.sh

Provided script file unloads the current module and build, install, load the new module automatically.


Manjaro or Arch Linux Based Linux DISTRO

If you use Arch Linux based system, you should uninstall currently exist old module to apply the new r8168 driver.

# Remove exist old r8168 module
$ sudo pacman -R linux419-r8168

Then reboot your system.

$ reboot

Enable WOL on both network interface.

Generally in H2, the network interfaces are named as enp2s0 and enp3s0.
Check ethernet interfaces of the system.

$ ip link
 
# results
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether c4:82:4e:55:73:13 brd ff:ff:ff:ff:ff:ff
3: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether c4:82:4e:55:73:14 brd ff:ff:ff:ff:ff:ff

If it isn't enp, change to yours properly of the commands below.

$ sudo ethtool -s enp2s0 wol g
$ sudo ethtool -s enp3s0 wol g

Check it's been enabled.

$ sudo ethtool enp2s0 | grep Wake
 
# results
Supports Wake-on: pumbg
Wake-on: g

Check that g character exists which means it wakes up by the magic packet.

Create the file /etc/systemd/system/wol@.service as root with the following content.

$ sudo vi /etc/systemd/system/wol@.service
[Unit]
Description=Wake-on-LAN for %i
Requires=network.target
After=network.target
 
[Service]
ExecStart=/bin/sh -c "ethtool -s %i wol g"
Type=oneshot
 
[Install]
WantedBy=multi-user.target

Enable that for the two network interfaces.

$ sudo systemctl enable wol@enp2s0
$ sudo systemctl enable wol@enp3s0

Start the services.

$ sudo systemctl start wol@enp2s0
$ sudo systemctl start wol@enp3s0