Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] wakeonlan
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
anigel
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 1894
Location: Un petit bled pas loin de Limoges ;-)

PostPosted: Sat May 06, 2006 8:13 am    Post subject: [HOWTO] wakeonlan Reply with quote

Nowadays, most of our computers do support the wake-on-lan feature (called WOL), which allows you to "wake up" a computer from network. Very practical to save power, with possibility to work from away, without keeping your computer up always.

A relatively recent work has been done on this problem, which bring a nearly perfect support for this feature (I didn't encounter any problem anyway), directly in the init scripts of our loved distribution. I'll try to help you this way !

1. Preparation

First, you must own compatible hardware, and set the wake-on-lan feature in your BIOS (it's often called "Power on PCI Device", or "Wake on PCI Device"). Some older PCI cards need to be conected to your mainboard, using a 3 connector special cable, not very expensive. Check your hardware's documentation.

2. Upgrade your baselayout

Stable version of sys-apps/baselayout is now > 1.12. Feel free to jump to next step, the following is just for remind purpose.

We will have to upgrade baselayout to at least version 1.12.x ; take care, this is a really essential package :

Code:
echo "sys-apps/baselayout ~x86" >> /etc/portage/package.keywords
emerge baselayout -uDNav


The upgrade should be fast. Then, take care to your config files updates : 2 files require to be updated correctly, for WOL to work : /etc/conf.d/rc and /etc/init.d/shutdown.sh. If you already had made custom changes to theses files, just take care to integrate new features in the merger file.

3. Configuration

Now, let's edit /etc/conf.d/rc, and more particularly the RC_DOWN_INTERFACE, which should be "no", to prevent Linux to completely shutdown the network chip on poweroff. Instead, it will let it in a sort of "sleeping state" :

Code:
# RC_DOWN_INTERFACE allows you to specify if RC will bring the interface
# compeletly down when it stops. The default is yes, but there are some
# instances where you may not want this to happen such as using Wake On LAN.

RC_DOWN_INTERFACE="no"


The last step to configure WOL is to ask the network card to react to "magic packets" (the network packets which will bring your computer up). In order to do this, I use ethtool.

Code:
emerge ethtool -av


As soon as emerge finished, you can ensure that WOL is available for your card in Linux with the next command line :

Code:
ethtool eth0

If you get something like "Cannot get driver information: Operation not supported", than you probably won't be able to get WOL working on this card. Sorry.

If you are a bit more lucky, you will get something like this :

Code:
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pg
        Wake-on: d
        Current message level: 0x000000c5 (197)
        Link detected: yes

The line "Supports Wake-on: pg" confirms that the card should be able to wake up by network ring. We must just remember to launch ethtool each time the machine is stopped, before shutdown, to ensure that the network chip will be in "wait" mode.

Code:
echo "ethtool -s eth0 wol g" >> /etc/conf.d/local.stop


The "server" side is nearly completed. Before rebooting, just take care to write down your MAC Address. We will need it to wake up your womputer from another machine. This is the 6 hexa digits following "HWaddr" when you run ifconfig.

Code:
ifconfig
eth0      Link encap:Ethernet  HWaddr 00:75:F2:7E:15:B9
          inet addr:xxx.xxx.xxx.xxx  Bcast:xxx.xxx.xxx.255  Mask:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:25859 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12172 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:35119097 (33.4 Mb)  TX bytes:937123 (915.1 Kb)
          Interrupt:16


In my case : 00:75:F2:7E:15:B9.

Now, reboot your machine, and then you can shutdown it.

4. Wake-up ! Time for breakfast !

You need another piece of software to send "magic packet" on the network. I personnaly use wakeonlan, but any other WOL software should be able to do this job, even from other OS.

Code:
emerge net-misc/wakeonlan -av



5. Let' test !

Pray, and just launch wakeonlan, followed by the MAC address you just wrote a few minutes ago.

Code:
wakeonlan 00:75:F2:7E:15:B9


And, hopefully, your computer should wake up and boot.

PS : My english is far from perfect, I hope this document is clear enough. Feel free to comment it, it can always be improved ;).

EDIT (2006-09-10) : Added the ethtool test, to ensure that both card and its driver do support WOL.

_________________
Il y a 10 sortes d'individus en ce bas-monde : ceux qui causent binaire, et les autres.


Last edited by anigel on Thu Nov 02, 2006 1:53 pm; edited 4 times in total
Back to top
View user's profile Send private message
!equilibrium
Bodhisattva
Bodhisattva


Joined: 06 Jun 2004
Posts: 2109
Location: MI/BG/LC

PostPosted: Sat May 06, 2006 6:40 pm    Post subject: Reply with quote

thanks very much, very useful !!
_________________
Arch Tester for Gentoo/FreeBSD
Equilibrium's Universe

all my contents are released under the Creative Commons Licence by-nc-nd 2.5
Back to top
View user's profile Send private message
rkaerner
n00b
n00b


Joined: 02 Apr 2005
Posts: 40
Location: Weilheim, near Munich

PostPosted: Thu May 11, 2006 1:45 pm    Post subject: Re: [HOWTO] wakeonlan Reply with quote

anigel wrote:
Then, take care to your config files updates : 2 files require to be updated correctly, for WOL to work : /etc/conf.d/rc and /etc/init.d/shutdown.sh.

Hello anigel.
Before I start to give my machine a not stable baselayout just let mes ask what kind of change in the second file has to be done. YOu named this file in the quoted sentence, but ou never came back to this file in your clearly structured howto.

thanks and regards,
Ralph
Back to top
View user's profile Send private message
htranou
Tux's lil' helper
Tux's lil' helper


Joined: 08 May 2006
Posts: 96

PostPosted: Thu May 11, 2006 5:23 pm    Post subject: Reply with quote

I guess the change has been moved to local.stop instead of editing directly shutdown.sh
Back to top
View user's profile Send private message
anigel
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 1894
Location: Un petit bled pas loin de Limoges ;-)

PostPosted: Sat May 13, 2006 7:35 pm    Post subject: Re: [HOWTO] wakeonlan Reply with quote

rkaerner wrote:
Before I start to give my machine a not stable baselayout just let mes ask what kind of change in the second file has to be done. YOu named this file in the quoted sentence, but ou never came back to this file in your clearly structured howto.


Hi,

In fact, the new shutdown.sh script was changed to take care of the new option added to /etc/conf.d/rc: RC_DOWN_INTERFACE. If we set this option to "no", then the new shutdown script will remove the -i option of the halt command, used to properly poweroff your system. This option poweroff the network card too, but we don't want to ;) .

In fact, I didn't came back on this file, since there is just no modification to do in it. You just have to take care to install the new version, coming with the new baselayout, and that's all !

Thanks for your input,
_________________
Il y a 10 sortes d'individus en ce bas-monde : ceux qui causent binaire, et les autres.
Back to top
View user's profile Send private message
hardcore
l33t
l33t


Joined: 01 Nov 2003
Posts: 626
Location: MSU, MI

PostPosted: Sat May 20, 2006 9:33 am    Post subject: Reply with quote

Great Howto!

As an aside, does anyone know how to wakeup by ip address?
_________________
Nothing can stop me now, cuz I just don't care.
Back to top
View user's profile Send private message
vanten
n00b
n00b


Joined: 08 Jan 2006
Posts: 44
Location: Sweden

PostPosted: Sun May 21, 2006 12:50 am    Post subject: Reply with quote

Yeah thanks for a great howto. a RWU wiki would be great. IF this shouldent work from a remote network
_________________
.: GNU/Linux :: Gentoo :: Fluxbox :.
.: BSD :: OpenBSD :: Fluxbox :.
Back to top
View user's profile Send private message
hardcore
l33t
l33t


Joined: 01 Nov 2003
Posts: 626
Location: MSU, MI

PostPosted: Sun May 21, 2006 6:10 am    Post subject: Reply with quote

hardcore wrote:
Great Howto!

As an aside, does anyone know how to wakeup by ip address?


After looking around, the answer is to use a static ip address to the wol nic, then forward a port to port 9 on the nic. Hope this helps anyone else with the same question.
_________________
Nothing can stop me now, cuz I just don't care.
Back to top
View user's profile Send private message
gtbX
Tux's lil' helper
Tux's lil' helper


Joined: 11 Oct 2003
Posts: 126

PostPosted: Tue Jun 27, 2006 4:16 pm    Post subject: Reply with quote

Nice Howto

A note to forcedeth users (nForce built in ethernet): due to a bug in the forcedeth driver, you need to reverse the order of your MAC address when you run wakeonlan:

Code:
wakeonlan B9:15:7E:F2:75:00
if your MAC address is 00:75:F2:7E:15:B9. Hopefully this will be fixed in newer kernels

http://www.nvnews.net/vbulletin/showthread.php?t=70384
Back to top
View user's profile Send private message
bilco105
n00b
n00b


Joined: 07 Jan 2006
Posts: 2

PostPosted: Mon Jul 17, 2006 9:24 am    Post subject: Reply with quote

I don't beleive this works over the internet does it?
Back to top
View user's profile Send private message
rkaerner
n00b
n00b


Joined: 02 Apr 2005
Posts: 40
Location: Weilheim, near Munich

PostPosted: Mon Jul 17, 2006 4:45 pm    Post subject: Reply with quote

Well I'm not sure, because it doesn't work for me. I did everything in this howto, put the WOL-Cable on my nic and take a look at my BIOS... but nothing happens inside my LAN. Maybe I need to change from a 10Mbit-Hub to a switch or something like that.

To wol a computer via Internet you must forward the ports that are needed to the computer you want to wake up directly. Me, myself and I configured the router in my LAN to be connectable via external login via ssh. Connected to my router from everypoint of the world, I just have to start the wakeup. Should work, because I'm in my LAN in that moment.

My only problem at the moment is that I don't know where to search the failure. My client seemes to be okay, from technical view everything is done to get waked up. Could be my hub, could be the halfduplex on the card, could be the card or the bios.

Maybe someone with older equipment could give me a hint.

Pentium III Coppermine 733 MHz
D-Link (via-rhine chipset) working on halfduplex
10 MBit hub 10Base-T with possibility to use 10Base-2)
Fritz!Box phone (patched and useable with ssh, wakeonlan an something more)
Back to top
View user's profile Send private message
wah
Guru
Guru


Joined: 25 Feb 2005
Posts: 453
Location: Raleigh, NC, USA

PostPosted: Mon Jul 17, 2006 4:51 pm    Post subject: Reply with quote

Wonderful How-To! I have been looking for something similar for a while, and this just happened to be the key! Thanks!

gtbX wrote:
Nice Howto

A note to forcedeth users (nForce built in ethernet): due to a bug in the forcedeth driver, you need to reverse the order of your MAC address when you run wakeonlan:

Code:
wakeonlan B9:15:7E:F2:75:00
if your MAC address is 00:75:F2:7E:15:B9. Hopefully this will be fixed in newer kernels

http://www.nvnews.net/vbulletin/showthread.php?t=70384

I have a forcedeth NIC in my Abit-Fatality-AN8-SLI board, and I do not have to flip the MAC for WOL - I am using gentoo-sources-2.6.16-r9 (AMD64). So I can verify at least in that kernel version it works properly.

Cheers,
W.
_________________
- AMD64 3000+, MSI K8N-SLI, Nvidia Geforce 6600 PCIE, 2GB OCZ Dual-Channel PC3200,2x160GB SATA
- Registered Linux User #418541
Back to top
View user's profile Send private message
gtbX
Tux's lil' helper
Tux's lil' helper


Joined: 11 Oct 2003
Posts: 126

PostPosted: Mon Jul 17, 2006 5:15 pm    Post subject: Reply with quote

Thats odd. I just tried it again on my Gigabyte K8N-Pro, and it still needs the reversed order. (Using gentoo-sources-2.6.16-r13, 64bit)
Back to top
View user's profile Send private message
wah
Guru
Guru


Joined: 25 Feb 2005
Posts: 453
Location: Raleigh, NC, USA

PostPosted: Mon Jul 17, 2006 5:25 pm    Post subject: Reply with quote

gtbX wrote:
Thats odd. I just tried it again on my Gigabyte K8N-Pro, and it still needs the reversed order. (Using gentoo-sources-2.6.16-r13, 64bit)

Hmmm...I just checked the specs on our two boards and they're similar, but on the LAN section yours indicates:
Code:

CICADA8201 Gigabit LAN PHY chip

Where mine reads
Code:

NVIDIA Gigabit Ethernet via NF4 Ultra

Both run on the NF4 chipset, so I'm not too sure what the difference is here. That is definitely odd.

W.
_________________
- AMD64 3000+, MSI K8N-SLI, Nvidia Geforce 6600 PCIE, 2GB OCZ Dual-Channel PC3200,2x160GB SATA
- Registered Linux User #418541
Back to top
View user's profile Send private message
lucida
Apprentice
Apprentice


Joined: 20 Feb 2003
Posts: 191

PostPosted: Sat Aug 26, 2006 6:58 pm    Post subject: Reply with quote

encounter same problem recently.

2.6.17-r6 x86
DFI LanPary Ultra-D(NF4 Ultra)

I have to use the reversed mac to wake the computer.
Back to top
View user's profile Send private message
anigel
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 1894
Location: Un petit bled pas loin de Limoges ;-)

PostPosted: Wed Aug 30, 2006 9:27 pm    Post subject: Reply with quote

bilco105 wrote:
I don't beleive this works over the internet does it?

Sorry for the delay of my answer (holidays, etc... :wink:).

Theorically, WOL is able to work on any protocol. I mean, you can encapsulate th magic packet in any kind of stream. The trick, to get wol working through the net, is to choose an unused tcp port, on your router / firewall (for instance TCP/60000), and set up things to forward everything arriving from the net on this port, directly to your workstation.

Then, you must find a magic packet generator able to put the magic packet inside a data stream, and send it to your workstation, using your IP, and the chosen TCP port. This way, your workstation should receive the signal, and just wake up.

But (yes, there is a "but"...), I can't tell you more on this subject, since I didn't practice this implementation of WOL.
_________________
Il y a 10 sortes d'individus en ce bas-monde : ceux qui causent binaire, et les autres.
Back to top
View user's profile Send private message
heavyt
Guru
Guru


Joined: 03 Mar 2003
Posts: 498
Location: Matrix (Washington,DC)

PostPosted: Fri Sep 01, 2006 1:43 pm    Post subject: Reply with quote

If you want it to work over the internet and you have a router (with DD-WRT frimware) then read this howto wiki How to set up remote WOL (Wake On LAN)
Back to top
View user's profile Send private message
RayVad
n00b
n00b


Joined: 10 Nov 2005
Posts: 67
Location: Netherlands

PostPosted: Sun Sep 03, 2006 9:09 pm    Post subject: Reply with quote

Stil not functioning here.
I got two systems with Intel Pro 100 onboard network cards(both WOL support enabled in BIOS). Both using the e100 module.
Both can't be started from WOL, except when switched-off before completely shutdown or removing the powercord.

Both systems are using a N440BX(PIII- 500Mhz) chipset:

00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX – 82443BX/ZX/DX Host bridge (AGP disabled) (rev 03)
00:0d.0 SCSI storage controller: LSI Logic / Symbios Logic 53c875 (rev 37)
00:0d.1 SCSI storage controller: LSI Logic / Symbios Logic 53c875 (rev 37)
00:0f.0 Ethernet controller: Intel Corporation 82557/8/9 [Ethernet Pro 100] (rev 05)
00:12.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 02)
00:12.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:12.2 USB controller: Intel Corporation 82371AB/EB/MB PIIX4 USB (rev 01)
00:12.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 02)
00:14.0 VGA compatible controller: Cirrus Logic GD 5480 (rev 23)

Anyone?

rkaerner: Did you find a solution?
Back to top
View user's profile Send private message
anigel
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 1894
Location: Un petit bled pas loin de Limoges ;-)

PostPosted: Sun Sep 10, 2006 9:42 am    Post subject: Reply with quote

RayVad wrote:
I got two systems with Intel Pro 100 onboard network cards(both WOL support enabled in BIOS). Both using the e100 module.
Both can't be started from WOL, except when switched-off before completely shutdown or removing the powercord.


Sorry : I tried this on a server, with e100 network chip, and I get the same results. Seems that WOL isn't supported yet on this card.
_________________
Il y a 10 sortes d'individus en ce bas-monde : ceux qui causent binaire, et les autres.
Back to top
View user's profile Send private message
RayVad
n00b
n00b


Joined: 10 Nov 2005
Posts: 67
Location: Netherlands

PostPosted: Mon Sep 11, 2006 9:08 pm    Post subject: Reply with quote

To bad to hear :(
But i'll try another NIC (3com) in it with a cable and see if that works. Will let you know.

Is there another driver to use instead of the e100?
Back to top
View user's profile Send private message
glin
n00b
n00b


Joined: 23 Sep 2003
Posts: 12

PostPosted: Fri Sep 22, 2006 9:52 pm    Post subject: Suspen2 problem Reply with quote

Hi, thanks for great how-to.

WOL now works if I normaly (e.g. shutdown -h now) turn off my computer. I don't even have to use "ethtool -s eth0 wol g" command and it still work.

Problem is, that I usualy use suspend2 suspend to disk (hibernate), and after hibernate, WOL dosn't work :-(.
I tried PowerDown method 4 and 5. I tried add following to common.conf in /etc/hibernate:
Code:
OnSuspend 20 /usr/sbin/ethtool -s eth1 wol g

(yes, I use eth1, not eth0, it's not typo)

The lines in common.conf for Down interface are commented:
Code:
### network
# DownInterfaces eth0
# UpInterfaces auto


And still WOL after hibernate doesn't work.
I use hibernate-script-1.93-r4 and suspend2-sources-2.6.17-r5.

Any suggestion how to make WOL work after hibernate?
Back to top
View user's profile Send private message
moe
Veteran
Veteran


Joined: 28 Mar 2003
Posts: 1289
Location: Potsdam / Germany

PostPosted: Mon Oct 09, 2006 4:15 pm    Post subject: Reply with quote

@glin Ive had the same problem, and in my setup wol is only working if I stop the interface:
Code:
### network
DownInterfaces eth0
UpInterfaces auto

My ethernetcard is an Intel Pro 100 (e100), which is onboard..

HTH Maurice
_________________
Signaturen sind doof.
Back to top
View user's profile Send private message
glin
n00b
n00b


Joined: 23 Sep 2003
Posts: 12

PostPosted: Thu Oct 12, 2006 11:25 am    Post subject: Reply with quote

moe wrote:

Code:
### network
DownInterfaces eth0
UpInterfaces auto



This doesn't work for me :(
Back to top
View user's profile Send private message
RayVad
n00b
n00b


Joined: 10 Nov 2005
Posts: 67
Location: Netherlands

PostPosted: Wed Nov 22, 2006 11:39 am    Post subject: Reply with quote

Quote:

My ethernetcard is an Intel Pro 100 (e100), which is onboard


Same here. 3 machines all with Intel Pro100 (Ethernet controller: Intel Corporation 82557/8/9 [Ethernet Pro 100] (rev 05)) networkcards onboard. Seems to be impossible to get those onboard cards to work with WOL. Although it should be supported.
Anyone got such cards working with WOL?

All 3 boards got 440BX chipsets (Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled) (rev 03))
Back to top
View user's profile Send private message
Dun
Apprentice
Apprentice


Joined: 17 Apr 2004
Posts: 172
Location: Amsterdam (NL) / Venice (IT)

PostPosted: Sat Dec 30, 2006 4:44 pm    Post subject: Reply with quote

Code:

slave ~ # lspci
00:00.0 Host bridge: Intel Corporation 82845 845 (Brookdale) Chipset Host Bridge (rev 11)
00:01.0 PCI bridge: Intel Corporation 82845 845 (Brookdale) Chipset AGP Bridge (rev 11)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 05)
00:1f.0 ISA bridge: Intel Corporation 82801BA ISA Bridge (LPC) (rev 05)
00:1f.1 IDE interface: Intel Corporation 82801BA IDE U100 (rev 05)
00:1f.2 USB Controller: Intel Corporation 82801BA/BAM USB (Hub #1) (rev 05)
00:1f.3 SMBus: Intel Corporation 82801BA/BAM SMBus (rev 05)
00:1f.4 USB Controller: Intel Corporation 82801BA/BAM USB (Hub #2) (rev 05)
02:06.0 Ethernet controller: Intel Corporation 82557/8/9 [Ethernet Pro 100] (rev 0d)
02:07.0 Ethernet controller: Intel Corporation 82557/8/9 [Ethernet Pro 100] (rev 0d)
02:08.0 VGA compatible controller: ATI Technologies Inc Rage XL (rev 27)


Wake On Lan works out of the box without any change in /etc/conf.d/rc file.

Moreover if I set RC_DOWN_INTERFACE to no WakeOnLan doesnt work anymore. Dont know why :)

Cya!

[update] Driver compiled statically - Kernel version: 2.6.18-r6
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum