1

After preparing my P5K Motherboard to recieve WOL Magic Packets, following this tutorial, I shutdown and booted several times to Windows.

The problem happens when I shutdown from Ubuntu.
It simply won't boot.
The output of ethtool eth0 and part of lspci is on pastebin but here are the important parts:

sudo ethtool eth0

        Supports Wake-on: g
        Wake-on: g
            Current message level: 0x0000003f (63)
                                   drv probe link timer ifdown ifup

lspci

2:00.0 Ethernet controller: Atheros Communications Inc. Attansic L1 Gigabit Ethernet (rev b0)

I must say that if i boot to windows and shutdown without making any changes the WOL works correctly again.

DeLiK
  • 372
  • 1
    please repeat the ethtool command using sudo and update your answer. – Salem Sep 20 '12 at 13:06
  • ok it seems like with sudo the problem was solved. – DeLiK Sep 20 '12 at 13:26
  • After executing the command
    `sudo ethtool -s eth0 wol g`
    
    

    and shutting-down Ubuntu problem solved.. i can boot from a shutdown from Windows or Ubuntu.

    – DeLiK Sep 20 '12 at 13:29

2 Answers2

3

If the interface is managed by the system

If your network interface (eth0 in most cases) is managed via /etc/network/interfaces you could avoid running ethtool before every shutdown by following this guide.

If the interface is managed by NetworkManager

If eth0 is managed by Network Manager, the simplest way is to add the ethtool -s eth0 wol g command in an if-up.d script.

Here is a quick example that you could put in /etc/network/if-up.d/eth0-wol and make the script executable: sudo chmod +x /etc/network/if-up.d/eth0-wol :

#!/bin/sh

ETHTOOL=/sbin/ethtool
[ -x "$ETHTOOL" ] || exit 0
[ "$IFACE" != "lo" ] || exit 0

WOL="g"
"$ETHTOOL" -s "$IFACE" wol "$WOL"
exit 0
1

In some cases on Ubuntu 12.10 the output of sudo ethtool eth0 gives the following output

Cannot get wake-on-lan settings: Operation not permitted
    Current message level: 0x000000ff (255)
                   drv probe link timer ifdown ifup rx_err tx_err
Cannot get link status: Operation not permitted

What I did to solve this I activated the root account on my computer via sudo passwd root and then afterwards logged as root user executed ethtool -s eth0 wol g which solved the WOL issue in my case.

qbi
  • 19,125
Hein
  • 11
  • It's not necessary to log in as root for this. Just run sudo ethtool -s eth0 wol g. In instances where you need a root shell, you still don't need to log in as root, just use sudo -s. In instances where you need a root login shell, even then you need not log in as root, as you can use sudo -i instead. See the community documentation for details. If you have enabled the root account and wish to disable it (either because you don't need it enabled anymore or, far more likely, because you never really had to), run: sudo passwd -dl root – Eliah Kagan Feb 06 '13 at 14:12