1

I want to enable WOL, I have it enabled in BIOS and understand I need to configure a systemd service to re-enable the setting on boot.

interface is enp3s0 (yes I checked), and script has 775 permissions

using Ubuntu 18.04 desktop

etc/systemd/system/wol.service looks like this:

[Unit]
Description=Configure Wake-up on LAN

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

[Install] WantedBy=basic.target

When I reboot, sudo ethtool enp3s0 gives me

...
Wake-on: d
...

Should be = wake-on: g

yusisushi
  • 158

2 Answers2

3

ANSWERED! you need to enable WOL in netplan, and configure a service that applies ethtool setting on reboot to specify wich (pubmg) network types wake your computer,

Ubuntu 18.04 does not use etc/network/interfaces/, but /etc/netplan/.
I didn't knew that you need to add a line in your netplan/yaml file, wakeonlan :true

      ethernets:
          enp3s0:
                  addresses: [192.168.0.99/24]
                  gateway4: 192.168.0.1
                  wakeonlan: true
                  nameservers:
                    addresses: [192.168.0.1]

I found you need to use ethtool command in combination with the netplan wakeonlan: true setting. and you need to have a service to make the ethtool command persist

in systemd/system you can add a script to specify types of WOL
I highly recommend only using g (magic packet) because if you specify pumbg you are likely to get immediate reboots after shutdown, becuase you accept ping,arp,etc... for waking!

script: etc/systemd/system/wol.service

[Unit]
Description=Configure Wake-up on LAN

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

[Install] WantedBy=basic.target

yusisushi
  • 158
1

This seems to be common enough. I was about to try put the ethtool -s dev wol g command into a script to run when the network connects but then I found in my network connections settings in gnome/cinnamon I had an option for wake on lan to select [x] magic. It now keeps the setting on reboot.

If you can't find it anywhere, this what I was about to try:

https://serverfault.com/questions/54704/how-to-get-ethtool-wake-on-lan-setting-to-stick

Hugh
  • 11
  • hi hugh. it seems they added a line in network/interfaces but 1804 uses netplan for that instead rigth? I tried adding the line under my config in netplan/yamlfile but the result was: it applied "wake-on g" after reboot, but ignored all other lines (route/ip.) and because of that I had no network connection until i reconfigured gateway route/ ip address, any idea why? example of how my netplan file looked: ethernets: enp3s0: post-up ethtool s enp3s0 s addresses: - 192.168.0.99 gateway4: 192.168.0.1 nameservers: addresses: [192.168.0.1] – yusisushi Jan 28 '20 at 22:32
  • it seems i have no idea how to format 'enters' :/ – yusisushi Jan 28 '20 at 22:39