# Wake On Lan

## Billybob

I have a system that I want to turn on when another machine starts booting up. I was thinking I could use WOL to do this. Just put a script in the boot sequence of the one machine to send a WOL packet to the other machine.

So I followed a quick HOW-TO on getting WOL to work. There was no WOL option in the BIOS, and the computer being new I assumed it just simply had WOL on be default. I booted the machine up and did:

emerge ethtool

ethtool eth0 (listed WOL settings)

ethtool -s eth0 wol g

ifconfig (copied down HWAddr)

poweroff

Now on the "client" machine I installed ether-wake. Then I did

./ether-wake HWADDR

but nothing happened. The "server" did not boot up.

Any help?

----------

## ToeiRei

Afaik bios has to support WOL. NICs normally have a connector to the motherboard for WOL.

Rei

----------

## Billybob

it's an onboard NIC.

----------

## Heliode

I have the same problem. The idea is that my server (Gentoo) sends a WOL signal to my desktop PC (Gentoo) in the morning, which then automatically logs on and starts playing music to wake me up. This all works fine, I just can't get my workstation to Wake On LAN  :Sad: 

Like Billybob, I also used 'ethtool -s eth0 wol g', I can see from the lights on the switch that something is send to the machine, but it just doesn't respond

I am certain the machine CAN Wake On LAN, since it does wake up if I shut it down from Windows (multiboot) so there must be something going wrong in Gentoo. I've tried both ethtool version 2 and version 3, with the same result.

Since i'd rather not use Windows if I don't absolutely have to, i'd like to get this done in Gentoo. If anyone has any idea how I can fix this, please post!

----------

## j-m

```

emerge etherwake

```

----------

## Heliode

 *j-m wrote:*   

> 
> 
> ```
> 
> emerge etherwake
> ...

 

On what? The machine to be woken up, or the machine to do the waking up? I allready have etherwake running on the server (which needs to wake the workstation). Do I also need it on the workstation? And if so, how do I use it?

Thanks in advance!

----------

## j-m

No, you don´t need it on workstation. Either BIOS and your NIC supports that or you are out of luck. Now I really don´t understand what is your problem.  :Confused:   :Question: 

----------

## Heliode

 *j-m wrote:*   

> No, you don´t need it on workstation. Either BIOS and your NIC supports that or you are out of luck. Now I really don´t understand what is your problem.  

 

Well the hardware support is there, since it somehow does manage to WOL when I shut down from Windows (which also confims that my settings in the BIOS are correct). 

Does Etherwake by default send the kind of packet that is specified by 'ethtool -s eth0 wol g' ?

----------

## j-m

 *Heliode wrote:*   

> 
> 
> Does Etherwake by default send the kind of packet that is specified by 'ethtool -s eth0 wol g' ?

 

```

net-misc/etherwake

      Latest version available: 1.09

      Size of downloaded files: 5 kB

      Homepage:    http://www.scyld.com/expert/wake-on-lan.html

      Description: This program generates and transmits a Wake-On-LAN (WOL) "Magic Packet", used for restarting machines that have been soft-powered-down (ACPI D3-warm state).

      License:     GPL-2

```

It works for me. I have never used ethtool for WOL.

----------

## Heliode

 *j-m wrote:*   

>  *Heliode wrote:*   
> 
> Does Etherwake by default send the kind of packet that is specified by 'ethtool -s eth0 wol g' ? 
> 
> ```
> ...

 

Well, as i understand it, you need a program to sort of prepare your PC to be wake-able from LAN. That is the kind of program I need. I can use etherwake (and WOL) to wake the machine when I shut it down from Windoze, but as far as i understand it, i'll have to use some kind of utility, like ethtool, to enable this feature in Gentoo.

Any pointers anyone?

----------

## j-m

No. You need no program on WOL "client". This is either supported by BIOS and NIC or no game. Etherware is a utility which send magic packet to wake the computer up, which is clearly written in its description. You should rather check ACPI support in kernel. If you "hard" power-down the machine, WOL won´t work at all.

----------

## Heliode

 *j-m wrote:*   

> No. You need no program on WOL "client". This is either supported by BIOS and NIC or no game. Etherware is a utility which send magic packet to wake the computer up, which is clearly written in its description. You should rather check ACPI support in kernel. If you "hard" power-down the machine, WOL won´t work at all.

 

I checked, and I have ACPI support in my kernel. Whats next?

----------

## wippie

Heliode: You DO need some extra on the machine you want to wake up..

i messed around with this about a year ago and got it working for a while, but i have not really tried it with newer kernels.

Back then you ned a patch to make the "kernel acpi not disables GPE events."

unfortunently, this patch only worked for kernels =< 2.6.8. (someone good at rewriting patches?)

no, i don't really know what that acpi thingy means, and i don't know if newer kernels have fixed this problem without patching.

another problem was that the nic ned to be put to wol-mode, something that could be fixed with a small code called pci-config.

this could then be put in /etc/init.d/shutdown.sh to set up the nic's.

the reason it works after a windoze shut down is that windoze automaticly set all nic supporting wol in wol-mode.

read about pci-config and putting nic's i wol-mode here

and about my patching (with Manty's patch) here

btw, if you have a pci-nic, or something else that need a wol-wire to your motherboard, you could try that the bios setup for the wol really work by short circuit 2 of the 3 pins on the wol-wire.

dunno which ones but dont worry, those pins are protected so as long as you dont keep it short circuited too long it wont break.

right pins, and it then should start immedatily! if it don't, don't bother messing with your nic cuz it wont work in the end anyway.

good luck.

----------

## korban

@wippie:

tried the pci-config tool, but my NIC is not listed by pci-config,

here is my lspci output:

```
0000:00:00.0 Host bridge: nVidia Corporation nForce3 250Gb Host Bridge (rev a1)

0000:00:01.0 ISA bridge: nVidia Corporation: Unknown device 00e0 (rev a2)

0000:00:01.1 SMBus: nVidia Corporation nForce 250Gb PCI System Management (rev a1)

0000:00:02.0 USB Controller: nVidia Corporation CK8S USB Controller (rev a1)

0000:00:02.1 USB Controller: nVidia Corporation CK8S USB Controller (rev a1)

0000:00:02.2 USB Controller: nVidia Corporation CK8S USB Controller (rev a2)

0000:00:06.0 Multimedia audio controller: nVidia Corporation nForce3 250Gb AC'97 Audio Controller (rev a1)

0000:00:08.0 IDE interface: nVidia Corporation CK8S Parallel ATA Controller (v2.5) (rev a2)

0000:00:0a.0 IDE interface: nVidia Corporation CK8S Serial ATA Controller (v2.5) (rev a2)

0000:00:0b.0 PCI bridge: nVidia Corporation nForce3 250Gb AGP Host to PCI Bridge (rev a2)

0000:00:0e.0 PCI bridge: nVidia Corporation nForce3 250Gb PCI-to-PCI Bridge (rev a2)

0000:00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

0000:00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

0000:00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

0000:00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

0000:01:00.0 VGA compatible controller: nVidia Corporation NV40 [GeForce 6800] (rev a1)

0000:02:07.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 80)

0000:02:08.0 Ethernet controller: Marvell Technology Group Ltd. Gigabit Ethernet Controller (rev 13)

```

and here my pci-config output:

```
pci-config.c:v2.05 2/23/2005 Donald Becker (becker@scyld.com)

 http://www.scyld.com/diag/index.html

Device #1 at bus 0 device/function 0/0, 00e110de.

Device #2 at bus 0 device/function 1/0, 00e010de.

Device #3 at bus 0 device/function 1/1, 00e410de.

Device #4 at bus 0 device/function 2/0, 00e710de.

Device #5 at bus 0 device/function 2/1, 00e710de.

Device #6 at bus 0 device/function 2/2, 00e810de.

Device #7 at bus 0 device/function 6/0, 00ea10de.

Device #8 at bus 0 device/function 8/0, 00e510de.

Device #9 at bus 0 device/function 10/0, 00e310de.

Device #10 at bus 0 device/function 11/0, 00e210de.

Device #11 at bus 0 device/function 14/0, 00ed10de.

Device #12 at bus 0 device/function 24/0, 11001022.

Device #13 at bus 0 device/function 24/1, 11011022.

Device #14 at bus 0 device/function 24/2, 11021022.

Device #15 at bus 0 device/function 24/3, 11031022.

```

so I can't set device 02:08.0 (lspci) to S3.

any solution?

----------

## wippie

guessing..

 *Quote:*   

> 0000:00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control 
> 
> 0000:01:00.0 VGA compatible controller: nVidia Corporation NV40 [GeForce 6800] (rev a1) 
> 
> 0000:02:07.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 80) 
> ...

 as you see, pci-config only outputs devices on bus 0, and your nic is on bus 2.

```
pci-config -u
```

tells you that you can change bus id with the -B flag, so guess you should see your nic with

```
pci-config -B 2
```

if not, what is the output of

```
lspci -vvx
```

?

----------

## Rwilson

I've got Wake on Lan working with the 2.6.11.5 vanilla kernel without any weird kernel patches. All I do is fire off "ethtool -s eth0 wol g"  before turning off the computer I want to wake up. Then, from a seperate machine, I do "etherwake HWADDRESS", HWADDRESS being the mac address of eth0 from the shutdown computer. Computer powers up and all is well. 

Give it a try and let me know how it works.

----------

## wippie

gentoo-sources-2.6.11-r5

```
# ethtool -s eth0 wol g

Cannot get current wake-on-lan settings: Operation not supported

  not setting wol

```

wol works after windoze shutdown and have had wol working under (patched) gentoo-sources-2.6.8..

i'll give the vanilla source a shot..posting results later.

----------

## wippie

tried the vanilla-source..

the same problem with both..

neither ethtool or pci-config worked, even after modifing /etc/init.d/net.eth0 to not stop the nic on shutdown.

anyone else with ideas?

btw, using 3Com Corporation 3c940 10/100/1000Base-T [Marvell] (rev 12)

on a asus a7v600 mb.

----------

## DumbAss

 *wippie wrote:*   

> tried the vanilla-source..
> 
> the same problem with both..
> 
> neither ethtool or pci-config worked, even after modifing /etc/init.d/net.eth0 to not stop the nic on shutdown.
> ...

 

I also had an 3com ethernetcard but I also didn't get it working. It worked on Windows but not on Linux. I read somewhere that the linux drivers just didn't support wol.

----------

## Stolz

I got WoL up and  runing on my system  :Smile: 

Objetive: Wake up compuer A from computer B

What I did on Computer A:

-Enable all the WoL functions on the motherboard BIOS

-Install  ethtool

```
# emerge ethtool -av
```

-Check the capacities and status of the NIC

```
# ethtool eth0

...

Supports Wake-on: g

Wake-on: d
```

It seems the NIC supports WoL (g type) but it is disabled by default

-Enable WoL

```
# ethtool -s eth0 wol g
```

In order to enable it whenever the computer shutdowns, I've added the upper line into /etc/conf.d/local.stop. (When I add it into /etc/init.d/shutdown.sh it doesn't work!! so all of you having troubles, please try using /etc/conf.d/local.stop)

-Find out the MAC addres of the NIC

```
# ifconfig | grep HWaddr

eth0 Link encap:Ethernet HWaddr 00:01:29:FE:82:5F
```

What I did on Computer B:

-Install wol

```
# emerge wol -av
```

-Wake up computer A

```
# wol 00:01:29:FE:82:5F
```

Hope it helps  :Smile: 

SOME EXTRA INFO:

 Motherboard : DFI nforce3 UT 250GB

 Kernel: 2.6.11-gentoo-r7

----------

## fvant

wol (-07.1) is masked but i got the same working result with etherwake, thanx for the howto !

----------

## Quincy

I've got a WoL problem, too. The computer i want to wake up is a little, fair old server, but it has already a WoL connector on the motherboard.

I'm using a 3Com 905B (Cyclone) on a board based on a Intel 440LX chipset. ethtool doesn't work (same problem as above: operation not supported). The module for the network card (3c59x) is loaded via modules.autoload with the option "enable_wol=1". Kernel is 2.6.12-r4 with APM support, no ACPI.

Tried to use ACPI to get system in the special sleep state, but didn't work either...

Exactly same system worked with WoL with Debian Woody for over a year and still does if i switch harddisks. There it worked with APM only perfectly.

On another system ethtool gives the same error message, but WoL works (SuSE, Kernel 2.4.x)...so i don't trust ethtool

----------

## Quincy

*bump*

----------

## AlbertLash

I pulled all my hair out trying to get wake on lan working with my Supermicro 6024h-t server with board Super X6DHT-G ( a side note about this board's bios - wol is on by default ), and followed all the tutorials I could find. Then I noticed an email saying something about Intel doing some work on the driver available from sourceforge. So I disabled the kernel module, and compiled and modprobed the fresh one, and would you believe it worked. Awesome, now I can cron shutdown, and magicpacket startup... ( automatic startup and shutdown )

----------

## flash49

Just a little side note: I have WOL working here, without setting up anything in Gentoo. (MSI K8T Neo2 with VIA K8T800Pro and onboard  RTL-8169 Gigabit Ethernet Running gentoo with the vanilla Kernel 2.6.15, ACPI enabled).  I only enabled "Wake up on PME" (Which is only an other name for Wake on Lan") in the BIOS. 

This works fine here, although ethtool doesn't show any wol setting!   :Very Happy: 

----------

