Requisiti:

Verificare che WOL sia attivato nel Bios dei pc che vogliamo accendere.

# <span style="color:#0000ff;">apt-get install ethtool wakeonlan</span>

verificare che sulla schede di rete sia abilitato WOL:

# <span style="color:#0000ff;">ethtool eth0</span>

il risultato nel mio caso è questo:

 

root@debian:/home/edmond# ethtool eth0
Settings for eth0:
Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: on
Supports Wake-on: pumbag
Wake-on: g
Current message level: 0×00000001 (1)
Link detected: yes

g” significa che WOL è abilitato

nel caso fosse su “d” significa che è disabilitato, quindi per abilitarlo:

 

# <span style="color:#0000ff;">ethtool -s eth0 wol g</span>

creare uno script chiamato wol ed inserire:

 

## /etc/init.d/wol
#
# chkconfig: 2345 99 99
# description: Force NIC into WOL mode
#
ethtool -s eth0 wol umbg
exit

quindi:

 

$ <span style="color:#0000ff;">chmod a+x wol</span>

# <span style="color:#0000ff;">cp wol /etc/init.d/</span>

# <span style="color:#0000ff;">update-rc.d wol defaults</span>

adesso per svegliare il nostro pc, basta inviare i Magic Packet:

 

$ <span style="color:#0000ff;">wakeonlan indirizzo_mac_pc</span>

<span style="color:#0000ff;"><a href="http://www.edmondweblog.com/index.php/2011/01/06/wake-on-lan-wol-su-debian-squeeze/">via</a><br /> </span>