tux-debianwww.palmix.orgtux-debian


  HOME  TUTORIALS  ARTICLES  DOWNLOADS  LINKS  ITALIANO

 
WAKE UP YOUR PC FROM LAN WITH LINUX
by Francesco Palmisano

On computer network, Wake on LAN (WOL) is Ethernet standard to wake up a PC from remote knowing the MAC address.

WOL


Let's begin:

SERVER SIDE:

With your package manager install:

ethtool

Now you need to verify the support of the WOL standard by your ethernet card.

AS root give command ifconfig, to know yuor device name: usually eth0 (or ethx format).
Then give command:

ethtool eth0

and have an output like this:

Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: g
        Current message level: 0x000000ff (255)
        Link detected: yes

If on Supports Wake-on there is a "g" , WOL standard is supported.
If on Wake-on there is a "d", WOL support need to be enable by BIOS and if there is a "g" everything it's ok.

Now active the support on the system with (as root):

ethtool -s etho wol g

The configuration is reset on every reboot, so you need the meke it permanently wiht a script(Debian/Sidux/Ubuntu user):
 
With a text editor write:

#! /bin/bash
ethtool -s eth0 wol g
exit

save as wol.sh in /etc/init.d/ and give execution permissions:

chmod a+x /etc/inti.d/wol.sh

now enable on the system boot(Debian/Sidux/Ubuntu user):

update-rc.d wol.sh defaults

Good, you need to know the device MAC address with this command:

ifconfig eth0

on the output look for:

HWaddr 00:1d:xx:xx:xx:xx

this is your MAC address.

Shutdown the "Server"

CLIENT SIDE:

On your client install, with your package manager:

wakeonlan

Good, at this point you can wake up the "Server" with:

wakeonlan "MAC address" (found on server before)

IMPORTANT: The WOL standard is supported only for wired ethernet devices, not for wireless ones (WiFi).


back on topback to tutorials