Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a PC that has a Windows 8 partition and an Ubuntu 13.04 partition. I am trying to get wake-on-lan to work. Everything works fine on the Windows 8 partition: I can wake-on-lan from both the sleep state and the shutdown state. However, when I shutdown Ubuntu using:

sudo shutdown -h now

I cannot wake the PC through my LAN. Is this because the network interface is getting turned off? What command can I use or how can I reconfigure Ubuntu so that wake-on-lan still works?

Also, if I do not use the -h option in the shutdown command, the PC does not actually shutdown; it just freezes up on me.

Using ethtool, I found that it says:

Supports Wake-on: pumbg
Wake-on: g
...
Link detected: yes

My etc/network/interfaces says this:

auto eth0
iface eth0 inet dhcp
      up ethtool -s eth0 wol g

EDIT: I have found that if I shut down the PC by simply holding the power button, then wol works. If I shutdown using the command line or through the Ubunutu GUI, then it does not work. So I think the issue is not that it is not being setup properly, but that something is overriding it or shutting it off when I shut down properly. Are there are any scripts that get run at shutdown?

I have added

NETDOWN=no

to both etc/default/halt and etc/init.d/halt

share|improve this question
    
Possible Duplicate? askubuntu.com/questions/210890/wake-on-lan-under-ubuntu-12-04 –  Mitch Sep 11 '13 at 5:08
    
@Mitch No, I really don't think so. How does that question answer my question? –  mushroom Sep 11 '13 at 9:49
    
I didn't say that it answers your question, merely a chance for you to look at it. –  Mitch Sep 11 '13 at 9:56
    
@Mitch The ethtool mentioned in that question seems very useful. See my edits for more info on my problem. –  mushroom Sep 12 '13 at 2:57
    
What have you done to configure the interface? Have you changed your /etc/network/interfaces file? –  jkurtisr32 Sep 13 '13 at 1:38
show 3 more comments

2 Answers 2

this is how I got mine working (just done this this morning)

I created a file as root/sudo in /etc/init.d/ called wakeonlanconfig with the following in it

#! /bin/bash
ethtool -s eth0 wol g
exit

then I set the permissions on this file to

sudo chmod a+x wakeonlanconfig

then to make sure it executed on startup I did

sudo update-rc.d -f wakeonlanconfig defaults

and rebooted the machine, powered it down again and then from another machine on the network used the wakeonlan command to startup it up again

wakeonlan <mac address of machine to be woken up>

hey presto machine booted up, hope this helps

share|improve this answer
    
You should be able to make the WOL setting permanent by adding the setting to your /etc/network/interfaces file rather than creating a new init script. This method also works though –  jkurtisr32 Sep 14 '13 at 13:11
add comment

Your commands are close, but try this in command line:

sudo ethtool -s <NIC> wol g

or add this to your /etc/network/interfaces file:

auto eth0
iface eth0 inet dhcp
    up ethtool -s eth0 wol g

'g' enables wake via "Magic Packet"

Looks like if you are shutting down using the following command:

sudo shutdown -h now  

then you will also need to edit your /etc/default/halt file. Add the following line:

NETDOWN=no

and see if that works. That should prevent the -h (halt) from shutting down the network interfaces.

share|improve this answer
    
See updates. I use g now. Still doesn't work if I shut down through CLI, but apparently works if hold down power button. –  mushroom Sep 14 '13 at 18:02
    
See edit. I am determined to solve this one, haha –  jkurtisr32 Sep 14 '13 at 21:51
    
It actually did not work. I added that to both /etc/default/halt and /etc/init.d/halt. Thanks for your persistence. –  mushroom Sep 14 '13 at 23:47
    
No problem, dude. Can you confirm that running the command sudo ethtool -s eth0 wol g then shutting down does not help WOL work? –  jkurtisr32 Sep 16 '13 at 0:44
    
Yep. Confirmed. Only works when I hold down power button or when I shutdown from Windows 8. –  mushroom Sep 16 '13 at 1:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.