HOWTO: Make "Wake on LAN" (WOL) Work
The following steps work for the 'buntus (tested on kubuntu 8.04) and probably all debian derived distros, mandriva et al have a different way of setting up networking, but I expect the same principles can be made to apply.
I have followed many HOWTOs to get WOL working. They didn't work. I have even posted to a few threads here on LQ about the problem. No joy. Some sites advised editing the /etc/init.d/halt script to remove the -i option when halt is finally called. This should work, but didn't, so I left that file alone. Some sites advise running ethtool -s eth0 wol g as a startup script. That didn't work either. The problem is that when linux shuts down, it completely powers off the LAN card. This saves a small amount of electricity, but the card is now truly OFF so it can no longer listen for the "Magic Packet" that is supposed to wake it up and make the computer boot. Today I found a solution that works for me: - I am assuming that eth0 is your LAN connection. - You need the following utilities to be installed: ethtool and wakeonlan - You need to know the MAC address of the LAN card in the PC you want to wake up. You can find the MAC address like this: ifconfig eth0 | grep HW - You may need to check that WOL is enabled in that PCs BIOS - You need to check that that LAN card supports WOL (not all do) with ethtool eth0 You'll need to be root to make these changes: Create a very small script called activateWOL It looks like this Code:
#!/bin/bash Now add a line to the /etc/network/interfaces file, in the part relevant to eth0 to call that script, like this Code:
auto lo /etc/init.d/networking restart What this does is re-enable the WOL capability of the card after it has been shut down. It seems stupid to have to have a script with only one command in it, but when I tried just putting post-down ethtool -s eth0 wol g in the interfaces file, it didn't work. When the PC has shut down and has kept WOL activated, I notice a little green light by the ethernet connector, even though the PC is "powered off". Now you can now wake that pc from another PC on your LAN with the command wakeonlan macaddress like this Code:
wakeonlan 00:11:2E:A0:0B:55 |
That's brilliant! It happens that just this morning, I was idly wondering what I would do if I wanted to make wol work...and then thought no more about it.
Should this be a 'how to'? |
CentOS WOL
Thanks for the tip.
One variation if you use CentOS (at least in 4.6) : -to enable wol you need to add execution of /usr/bin/activateWOL in /etc/sysconfig/network-scripts/ifup-post (I put it at the end of my ifup-post files before the exit 0 statement) -to restart network do : /etc/init.d/network restart or reboot -n you can check your settings with /sbin/ethtool eth0 Regards Matnik |
hello i have applied these changes and WOL is working fine when i used it to wake my machine from turn off mode....
But it is not working when i switches my machine to sleep mode. My machine is not responding to magic packet sent , if it is in sleep mode. Also this all happens with ubuntu only .....If i go to sleep mode through Windows 7 ultimate. Then my machine can detect the magic packet and resume all the state of machine as earlier. Can WOL for sleep/suspend/hibernate is possible in ubuntu......if yes do we require some more changes and what are those changes required. please reply. |
Quote:
Anyone suggestions?? Greetings, Pieter |
Thanks!
I had to join this forum to thank you for this post! I have tried for a little bit and after following a few different threads I found your solution that works.
Has anyone had any success making WOL work with suspend? |
Quote:
|
All times are GMT -5. The time now is 02:43 AM. |