3

Sorry to post another Wake-on-LAN question but sifting through the other posts I've found (both on this site and others) I can't seem to resolve my problem. I am trying to setup wake-on-LAN for a Ubuntu 16.04 machine and despite half a day of tinkering I still can't get it to wake up after sending the magic packet. So far I've done the following:

  1. Enabled wake-on-LAN in my BIOS
  2. Enabled wake-on-LAN (persistently) in the NIC
  3. Changed the /etc/default/halt and /etc/default/tlp settings (see below).
  4. Confirmed that the "magic" packets I'm sending are making it to the machine.

I'm hoping someone here will either spot something I'm doing wrong or have some suggestion that may open up a new avenue of investigation; at this point I'm out of ideas. Thanks for your help!

Motherboard: Asrock Xtreme4 with onboard LAN

Long listing of debugging/detail information (comments above the commands explain what I am trying to show/do):

#
# Networking devices; trying to wake-on-lan from the main ethernet 
# device 'enp0s31f6'
#
root@Ruby:/var/log# ifconfig
enp0s31f6 Link encap:Ethernet  HWaddr 70:85:c2:5e:48:c7
          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::57be:f8e8:ad34:811d/64 Scope:Link        
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2018 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1036 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:296222 (296.2 KB)  TX bytes:171521 (171.5 KB)
          Interrupt:16 Memory:df200000-df220000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:234 (234.0 B)  TX bytes:234 (234.0 B)


#
# Ubuntu release information for machine being configured for WOL.
#
root@Ruby:/var/log# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"

#
# Detail information on the main ethernet device.  The 'g' character shows
# in both 'Supports Wake-on' and 'Wake-on' lines.  This same output is 
# consistent across system reboots (i.e., I don't have the issue with 'Wake-on'
# being changed to something like 'd' after reboot; this always shows up as
# 'g').
#
root@Ruby:/var/log# ethtool enp0s31f6
Settings for enp0s31f6:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: on (auto)
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000007 (7)
                           drv probe link
        Link detected: yes


#
# Modified the halt defaults and added 'NETDOWN=no' as seen below.
#
root@Ruby:/var/log# cat /etc/default/halt
# Default behaviour of shutdown -h / halt. Set to "halt" or "poweroff".
HALT=poweroff
NETDOWN=no


#
# Updated the power settings configuration to NOT disable WOL.  Not sure if
# this is really needed or not as this computer is not a laptop (simply following
# recommendations from online posts).
#
root@Ruby:/var/log# cat /etc/default/tlp | grep WOL
WOL_DISABLE=N


#
# Verified that magic packets are being received on the expected network device
# when sent from another linux machine.  Output from the command used to send the
# packets was:
#
#    $ wakeonlan -i 192.168.1.255 '70:85:c2:5e:48:c7'
#    Sending magic packet to 192.168.1.255:9 with 70:85:c2:5e:48:c7
#
# I ran this 3 times and produced the capture output below on the target machine (i.e.,
# the computer I'm trying to start up via WOL):
#   
root@Ruby:/var/log# tcpdump -i enp0s31f6 'udp and port 9'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp0s31f6, link-type EN10MB (Ethernet), capture size 262144 bytes
13:23:53.869476 IP hackpi.57568 > 192.168.1.255.discard: UDP, length 102
13:23:55.384924 IP hackpi.59471 > 192.168.1.255.discard: UDP, length 102
13:23:57.214933 IP hackpi.49245 > 192.168.1.255.discard: UDP, length 102


#
# When testing the wake-on-LAN settings I stop the machine with 
# 'shutdown -h now' then after the lights turn off I try to send the magic
# packet with the command previously shown (see tcpdump capture comments
# above).  No dice, machine never boots.
#
root@Ruby:/# shutdown -h now

Bios WOL Enabled:

BIOS Configuration Picture

  • I have the same problem, and the same troubleshooting logs ; in my BIOS, I enabled "Power on by PME": "Allows you to turn on the system through a PCI/PCIE/Onboard LAN device". – Basj Nov 17 '19 at 23:28
  • 1
    Great looking BIOS setup screen. My text based dell is green with envy. – WinEunuuchs2Unix Nov 17 '19 at 23:34
  • I had the same problem, now solved with a new motherboard, everything worked out-the-box with the new one: https://superuser.com/questions/1402275/is-it-normal-that-the-leds-of-the-network-adapter-are-off-when-the-computer-is-o/1504568#1504568 – Basj Nov 24 '19 at 09:34

2 Answers2

2

I'm 100% sure that you have not enabled Wake-on-LAN.
Option that you shown us is PXE boot.
On manual to your motherboard page 77 you need to enable PCIE/PCI Devices Power On
Also in same manual on page 88 stays that it is PXE boot.

So you need to change setting in your BIOS/UEFI and all should work.
If not, read read again this ubuntu manual and check that systemd is not turning WOL bits off.

If it not helped please post new informations please.

UNIm95
  • 704
0

The Arch Linux bible on WOL has many chapters. Making settings persistant is often overlooked in Ask Ubuntu answers:

systemd.link

/etc/systemd/network/50-wired.link

[Match]
MACAddress=aa:bb:cc:dd:ee:ff

[Link]
NamePolicy=kernel database onboard slot path
MACAddressPolicy=persistent
WakeOnLan=magic

systemd service

/etc/systemd/system/wol@.service

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

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

[Install]
WantedBy=multi-user.target

udev

/etc/udev/rules.d/81-wol.rules

ACTION=="add", SUBSYSTEM=="net", NAME=="enp*", RUN+="/usr/bin/ethtool -s $name wol g"

cron

@reboot /usr/bin/ethtool -s interface wol g

TLP can disable WOL by default

When using TLP for suspend/hibernate, the WOL_DISABLE setting should be set to N in /etc/default/tlp to allow resuming the computer with WoL.