# How to Wake-on-lan?

## RangerDude

How do I wake my workstation over lan?

My network card is ready and connected to the MB.

I just need to know how to send the wake-up string from gentoo.

----------

## weltraumfahrer

Hi,

emerge /usr/portage/net-misc/etherwake/etherwake-1.08.ebuild

Frank

----------

## RangerDude

Thanks!

Why is it masked? Is it unstable or something?

----------

## weltraumfahrer

Hi,

> Why is it masked? Is it unstable or something?

It won't unpack by the ebuild:-(

I've installed it from source.

wget http://www.scyld.com/pub/diag/ether-wake.c

gcc -O -Wall -o ether-wake ether-wake.c

strip ether-wake

mv ether-wake /usr/sbin

That's it.

Frank

----------

## dma

ethtool lets you configure the machine you want to wake:

```
*  sys-apps/ethtool

      Latest version available: 1.7

      Latest version installed: 1.7

      Size of downloaded files: 70 kB

      Homepage:    http://sourceforge.net/projects/gkernel/

      Description: Utility for examining and tuning your ethernet-based network interface
```

```
       wol p|u|m|b|a|g|s|d...

              Set Wake-on-LAN options.  Not all  devices  support  this.   The

              argument  to  this  option  is a string of characters specifying

              which options to enable.

              p  Wake on phy activity

              u  Wake on unicast messages

              m  Wake on multicast messages

              b  Wake on broadcast messages

              a  Wake on ARP

              g  Wake on MagicPacket(tm)

              s  Enable SecureOn(tm) password for MagicPacket(tm)

              d  Disable (wake on nothing).  This option clears  all  previous

                 options.

       sopass xx:yy:zz:aa:bb:cc

              Set the SecureOn(tm) password.  The argument to this option must

              be 6 bytes in ethernet MAC hex format (xx:yy:zz:aa:bb:cc).

```

----------

## Ronald Dehuysser

Has anybody had any luck with the wol (wake on lan) configuration with ethtool?

The driver I'm using for my NIC is e100, build into the kernel, so not loaded as a module. The output I get when using ethtool eth0 is:

```
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

        Current message level: 0x000020c1 (8385)

        Link detected: yes
```

When I run the command: 

```
ethtool -s eth0 wol u
```

 I receive the following:

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

  not setting wol
```

Since the NIC I'm using isn't too old I'd think it would support wol... or am I wrong?

Thanks in advance,

Ronald

----------

## timmfin

To use the WOL feature (which I have never used) you have to attach a cable from the ethernet card to your motherboard's WOL port. Have you done this?

Tim

----------

## Ronald Dehuysser

Thanks for your fast reply, Tim. 

The problem is that my NIC is on my motherboard so I activated the Wake-on-Lan feature in my BIOS. When I try to set te WOL feature with ethtool I still receive 

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

  not setting wol
```

If this is of any help: I have a GigaByte GA8IEXP motherboard.

Any other suggestions?

Cheers,

RonaldLast edited by Ronald Dehuysser on Tue Feb 10, 2004 1:25 pm; edited 1 time in total

----------

## To

I'll try this when I get back home, and I'll post something about it.

Tó

----------

## fleed

 *Ronald Dehuysser wrote:*   

> 
> 
> When I run the command: 
> 
> ```
> ...

 

try ethtool -s eth0 wol g instead (or any of the other wol options) to see if it works.

----------

## Ronald Dehuysser

Tried it with almost all the WOL options, same result...

Thanks for the fast reply,

This forum is great!!

----------

## Ronald Dehuysser

In this little howto I will describe how to set up your machine so you can wake it over your local network. To make everything comprehensable I have made these conventions:

- the pc you want to start up is the server

- the pc from which you will start up the other pc is the client 

Before you start you should enable the wake-on-lan option in your bios. If your nic is onboard, that's all you have to do. However if you have an ethernet card plugged into a pci slot, you also should put a cable from your network card to your motherboard which will send the "turn on" command. Also be sure you use the correct driver for your nic.

First thing to do is to emerge ethtool on the server:

```
server # emerge -p ethtool

server # emerge ethtool 
```

Next thing to do is to check if the nic of your server supports wake-on-lan:

```
server # ethtool eth0

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: Twisted Pair

        PHYAD: 1

        Transceiver: internal

        Auto-negotiation: on

        Supports Wake-on: puag

        Wake-on: g

        Link detected: yes
```

At the bottom you will find the different wake-on-lan options. I suggest using the g option, which is a Magic Packet, because the software we will use on the client supports only the g option. Now set the Wake-on option by using this command:

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

Last thing to do is to find out the hardware address of your nic. 

```
server # /sbin/ifconfig

eth0      Link encap:Ethernet  HWaddr AD:35:87:20:6F:9E

          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:6576 errors:0 dropped:0 overruns:0 frame:0

          TX packets:7082 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:5491525 (5.2 Mb)  TX bytes:913475 (892.0 Kb)

          Interrupt:20 Base address:0x8c00 Memory:ea009000-ea009038
```

Write down all the stuff behind HWaddr or put it into a text file and copy it over to the client.

That's all you have to do on the server.

Next thing on our list is to emerge wakeonlan on our client:

```
client # emerge -p wakeonlan

client # emerge wakeonlan
```

Now put the hardware address in a file called server (or the name of your server), unless you can remember this number.

```
client # echo AD:35:87:20:6F:9E > server
```

Make sure your server is turned off (it won't be of much use else) and type in the following command on your client:

```
client # wakeonlan -f server
```

or for those of you who can remember the hardware address:

```
client # wakeonlan AD:35:87:20:6F:9E
```

That's it, your server should start immediately!

Cheers,

Ronald

----------

## Kazaza

a little question.

Where exactly am I supposed to enable the function enable_wol?

cause the steps above is not enough...

when I do a check with ethtool I get this:

```
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: 8

        Transceiver: internal

        Auto-negotiation: on

        Current message level: 0x00000001 (1)

        Link detected: yes
```

As you can see there is nothing about wol in there, and I know I have configured my bios and the hardware correctly... the card is a Dlink DFE 530tx and the cable for wol is connected

So how do you set gentoo up for enabling the wol function?

----------

## KpR2000

How about the ports for wakeonlan? What ports have to be exactly accepted by the firewall incoming and outgoing?

Thanks in advance.

Greetings

----------

## jpc82

Thanks Ronald Dehuysser,  Your little howto worked perfect for me.

----------

## jpc82

I spoke to soon, it worked once, but would not come up after a second shutdown.

----------

## jpc82

Is there a way to make wake on lan the default setting?

When I reboot the wol setting from ethtool is set to disabled.

----------

## Rem

 *jpc82 wrote:*   

> Is there a way to make wake on lan the default setting?
> 
> When I reboot the wol setting from ethtool is set to disabled.

 

Hi, bumped onto this topic while searching for wol myself.

I just added the command to activate wol by adding it to /etc/conf.d/local.start. That way it comes up every boot, and you won't have to do it manually.

Well, I'm glad it works, even works on my nforce2 nic.

----------

## mte

hi,

```

# ethtool eth0

Settings for eth0:

        Supports Wake-on: g

        Wake-on: g

        Link detected: yes
```

this is on the pc i want to wake.

on the other pc i run wol -f hwaddr (where hwaddr is the name of the file where the hw address of the pc i want to wake is).

And nothing happens. I get no errors as well. I have a nforce2 onboard network adapter and using the forcedeth module. How to troubleshoot this?

thanks,

Matej

----------

## Rony

Patch for sis900 is at

http://www.brownhat.org/sis900.html

After patching, WOL works like a charm on my M863G V5.1C !!

 *Quote:*   

> Linux Barton 2.6.15-gentoo-r5 #3 Mon Feb 13 17:50:58 SGT 2006 i686 mobile AMD Athlon(tm) XP-M 2800+ AuthenticAMD GNU/Linux

 

Thanks for the very clear howto!!

 :Laughing: 

----------

## Akaihiryuu

I've got a Linksys LNE100TX v4 card (with WOL connector) in my older K6 system.  I have the WOL cable connected, the light on my switch corresponding to this computer does stay on when the computer is off.  However, 1) I can't find any WOL option in the BIOS.  I can swear it had an option when I first got it, I upgraded the BIOS at some point though and I haven't seen the option since.  And 2) ethtool does not work on this computer.  It is not able to get any information from the card at all, it just says operation not supported.  Any ideas?  This is an older board that is primarily APM but does have some limited ACPI functionality.  However, I am not able to get it to power off on shutdown unless I use APM, ACPI does not work for that on this system for some reason.  Maybe the WOL function I'm looking for is actually in the ACPI section?  The board is an Epox EP-MVP3G5 (MVP3 chipset) if that helps.  I have WOL working on every computer but this one.  I know that this computer is too old to be able to use WOL through the PCI bus, thus the use of the WOL cable, but that is hooked up correctly.  ethtool works fine with every NIC I have except this one.  It's a tulip card.

----------

