pop-os / pop

A project for managing all Pop!_OS sources
https://system76.com/pop
2.42k stars 84 forks source link

Wake-on-LAN (WoL) doesn't work #866

Open elrnv opened 4 years ago

elrnv commented 4 years ago

Distribution (run cat /etc/os-release):

NAME="Pop!_OS"
VERSION="19.10"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Pop!_OS 19.10"
VERSION_ID="19.10"
HOME_URL="https://system76.com/pop"
SUPPORT_URL="http://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=eoan
UBUNTU_CODENAME=eoan
LOGO=distributor-logo-pop-os

Related Application and/or Package Version (run apt policy $PACKAGE NAME):

ethtool:
  Installed: 1:4.19-1
  Candidate: 1:4.19-1
  Version table:
 *** 1:4.19-1 500
        500 http://us.archive.ubuntu.com/ubuntu eoan/main amd64 Packages
        100 /var/lib/dpkg/status

Issue/Bug Description: Here is the situation: WoL is enabled with ethtool, it is also enabled in BIOS/UEFI. If I shutdown using the physical switch, the NIC (network card) stays on (LED is on), and WoL works as expected (system boots on magic packet). If I shutdown with sudo shutdown now or poweroff, then NIC is also shut down, and WoL doesn't work. I tried some of the suggestions online for Ubuntu, but none have solved the issue, so I suspect it has something to do with how Pop! is configured.

For reference, My ethernet controller is Intel I211 Gigabit. The driver is the latest igb driver v5.3.5.42. Kernel 5.3.0-7629-generic. Since WoL works through physical shutdown, I don't think it's a hardware issue.

sudo ethtool enp4s0 | grep "^\sWake-on" reports

Wake-on: g

Steps to reproduce (if you know):

  1. Enable Wake-on-LAN or network boot in BIOS/UEFI.
  2. Install ethtool sudo apt install ethtool
  3. Determine the network interface which will be used for WoL with ip link or ifconfig, call it <eth>
  4. Run sudo ethtool -s <eth> wol g to enable wake on lan on said device
  5. Verify that wake-on-lan is indeed enabled by checking the output of sudo ethtool <eth> | grep "^\sWake-on", which should report
    Wake-on: g
  6. Shutdown the computer using sudo shutdown now, poweroff or through the GUI.
  7. Looking at the ethernet port, no lights are on, indicating that the ethernet port is shut down.
  8. To further verify that WoL doesn't work, send the magic WoL packed using a package like wakeonlan from another computer on the same LAN: the computer fails to boot.

Expected behavior: The ethernet port should show an LED indicating that it is on after shutdown. Sending the magic packet should trigger a boot.

KentBrockman commented 4 years ago

I have the same issue elrnv describes above. My release (/etc/os-release) and ethtool version is identical as above, so I won't repeat those. My setup is slightly different - I'm running a Windows/Pop!_OS dual boot and WOL works fine when I set the Windows drive as primary boot device, so I don't believe this is a hardware problem. Can confirm when shutting down via OS the light on the ethernet port (this is the device I wake from) is ON from Windows but OFF from Pop!_OS.

The only details to add: Wake-on for my link reverts back to this on startup:

        Supports Wake-on: pg
        Wake-on: d

I can reset it to g using sudo ethtool en6s0 wol g but that configuration is lost on reboot.

I'm using wakeonlan to send the wake packet:

> wakeonlan --version
/usr/bin/wakeonlan version 0.41 calling Getopt::Std::getopts (version 1.12 [paranoid]),
running under Perl version 5.28.1.
  [Now continuing due to backward compatibility and excessive paranoia.
   See 'perldoc Getopt::Std' about $Getopt::Std::STANDARD_HELP_VERSION.]
Rav8es commented 3 years ago

I’m having the same problem. I am forced to use the following script:

sudo nano /etc/systemd/system/wol.service

[Unit] Description=Configure Wake On LAN

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

[Install] WantedBy=basic.target

sudo systemctl daemon-reload sudo systemctl enable wol.service sudo systemctl start wol.service

——

I can confirm this was also an issue found in previous versions of Ubuntu and Kubuntu, but the issue is no longer present.

wbrickner commented 1 year ago

This systemd soln works for me on latest LTS (the issue still exists).