November 19, 2009
Linux (FC12) wake-on-LAN woes
I just spent the last two hours or so trying to get wake-on-lan to actually work on Linux. Sadly, most of the HOWTOs (assuming the link isn't broken) aren't actually that useful. Here's what I can observe
- Wake-on-LAN is enabled in the BIOS.
- Shutting down with "poweroff" or "shutdown -h" leaves the network card powered (the link light is on).
- Sending a magic packet to the machine doesn't power it on.
- If I hit the small black button on the back of the power supply once, it makes a slight noise, and after that sending a magic packet does power on the machine.
So my best guess so far is that poweroff puts the power supply into a state from which the NIC can't wake it up. I have no idea what that state might be, nor how to change this behavior. I welcome any ideas!
Update: To be clear, I've tried all the power management setting combinations in the BIOS. Most have the behavior I describe above; the rest power down the network card as well.
Update: To forestall more comments from people who aren't reading item 4 above carefully, the network card itself reports that it'll do wake on magic packet when you ask with ethtool. It DOES do wake on magic packet, in fact, but only after I press that button on the power supply. And honestly, try to give me some credit for actually trying the one thing all the howtos on this have in common, that being ethtool.
Posted by bzbarsky at November 19, 2009 12:02 AM
You are right, it puts it into a funny acpi mode and there is little you can do about it.
I just went through this in ubuntu, after pulling my hair out for a few weeks and finally giving up...Ubuntu magically started doing the right thing(tm) to wakeonlan.
Try flicking random settings in the bios to do with what acpi version the OS sees(or other power settings), I think I was messing in the bios recently which might've fixed this.
Not trying to start any distro wars (especially since I'm an OS X user ;) — I have had much more success with Ubuntu on anything that relates to the hardware and ACPI. Maybe try a LiveCD and see if it will wake up?
It does seem weird that this should have anything to do with the OS at all, but ACPI is a horrible, horrible mess.
Did you try using ethtool? The link light staying on doesn't mean the interface is configured to actually check magicpacket. If you run ethtool on your interface, you should see something like:
Supports Wake-on: pg
The g indicates magicpacket is supported. And if magicpacket WOL is enabled, you'll see:
If not, you can enable it with something like "ethtool -s eth0 wol g"
Yes, of course I tried ethtool. It's 'g' for both "Supports Wake-on" and "Wake-on". This part clearly works, per item 4 in my list, no?
ethtool -s eth0 wol g
I need to have this run on machine startup (e.g. in /etc/rc.local) to have my ethernet card prepared for a future Wake on MagicPacket(tm). See man ethtool for more parameters.
If the box loses power for a while, this (volatile setting?) capability goes away and I can't WoL. But as long as the power supply has juice and ethtool was run before sleeping or shutdown, WoL operates fine.
I assume you've managed to get wake-on-lan to work with another operating system on the same box? Just to rule out the possibility that you have a bad combination of BIOS, motherboard and power supply.
Are you really sure that the magic packet reaches to machine to be woken up?
Because the machine to be woken up is down, there is no ARP resolution for its IP address. So normally you have to do a broadcast on the IP level and possibly even on the Ethernet level.
Paul, wake-on-lan after shutting down from Windows 7 on the same machine works fine. It also works fine if I power off by holding the power button on the front of the machine.
Manfred, please read item 4 above carefully again.
PSUs don't have much state controllable through ATX. It sounds like pressing the button is turning the motherboard off long enough to disable the ACPI mess that's causing it not to work.
I found a similar bug at http://bugzilla.kernel.org/show_bug.cgi?id=5149 . You might want to try filing a bug. (though maybe in acpi->power off instead of drivers->network.. dunno)
I'm having the very same issue issue you describe (except on Ubuntu 9.10) so I'd be interested to see a follow-up to this post if you find a solution (or even a root cause).
It's a hack-around solution, that doesn't address the underlying problem, but adding "ethtool -s eth0 wol g" to /etc/rc.local solved the problem for me...
Taylor, you should read the other comments... I tried that before ever blogging, and it didn't work in my case.