odroid-h2:application_note:wake_on_lan

How To Enable Wake On LAN

  • Operation confirmed with
    • Ubuntu 18.10 with 4.18 kernel.
    • Manjaro 18.0 with 4.19 kernel.
    • Ubuntu 20.04 with 5.4 kernel.
  • Confirmed version of Realtek LAN Driver is
    • H2: r8168 8.046.00
    • H2 Plus: r8125 9.003.05

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.


target
# 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

target
# 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.

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

Then reboot your system.

target
$ reboot
  • In H2, the kernel 5.0 or up has the fix for the WOL working. So you can ignore this chapter if you're using kernel 5.0 or up.
  • In H2 Plus, you can ignore this procedure because you should install the dedicated driver in advance to use the Internet. But later, someday when the integrated r8125 driver is working with H2 Plus, you may have to install the Realtek driver then.

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.

target
$ sudo ./autorun.sh

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


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

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

Then reboot your system.

target
$ 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.

target
$ 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.

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

Check it's been enabled.

target
$ 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.

target
$ 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.

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

Start the services.

target
$ sudo systemctl start wol@enp2s0
$ sudo systemctl start wol@enp3s0
  • odroid-h2/application_note/wake_on_lan.txt
  • Last modified: 2020/06/12 11:00
  • by joshua