2015-03-29 20:32:35 +01:00
|
|
|
|
---
|
|
|
|
|
title: Wake-on-LAN
|
|
|
|
|
layout: default
|
|
|
|
|
created: 2008-08-13 22:18:28 +0200
|
|
|
|
|
updated: 2008-08-13 22:18:28 +0200
|
|
|
|
|
toc: false
|
|
|
|
|
tags:
|
|
|
|
|
- know-how
|
|
|
|
|
- software
|
|
|
|
|
- linux
|
|
|
|
|
- networking
|
|
|
|
|
---
|
|
|
|
|
Preparing to go asleep
|
|
|
|
|
======================
|
|
|
|
|
|
|
|
|
|
To make Linux not shut down the network interface upon *halt*, edit the file ˋ/etc/init.d/haltˋ, find the line with the
|
|
|
|
|
ˋhaltˋ command and remove the parameter ˋ-iˋ if there. This parameter does ˋifdownˋ on all networking interfaces. As the
|
|
|
|
|
manpage for *halt* states, this is unneccessary for newer kernels - also it disables WOL.
|
|
|
|
|
|
|
|
|
|
The second step is to make sure, your card supports WOL. To find out, issue the ˋsudo ethtool eth0ˋ command. You should
|
|
|
|
|
get something like this:
|
|
|
|
|
|
2015-03-29 20:38:11 +01:00
|
|
|
|
~~~
|
2015-03-29 20:32:35 +01:00
|
|
|
|
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: 10Mb/s
|
|
|
|
|
Duplex: Half
|
|
|
|
|
Port: MII
|
|
|
|
|
PHYAD: 1
|
|
|
|
|
Transceiver: internal
|
|
|
|
|
Auto-negotiation: on
|
|
|
|
|
Supports Wake-on: g
|
|
|
|
|
Wake-on: g
|
|
|
|
|
Current message level: 0x00000007 (7)
|
|
|
|
|
Link detected: no
|
2015-03-29 20:38:11 +01:00
|
|
|
|
~~~
|
2015-03-29 20:32:35 +01:00
|
|
|
|
|
|
|
|
|
The important lines are the ˋSupports Wake-onˋ and ˋWake-onˋ ones. The "ˋgˋ" means it is enabled for MagicPacket™.
|
|
|
|
|
If not, you should manually call the command:
|
|
|
|
|
|
|
|
|
|
ethtool -s eth0 wol g
|
|
|
|
|
|
|
|
|
|
This should enable WOL for the card. If this works, you have to issue this command after every bootup as the state will
|
|
|
|
|
be back to disabled then. You might want to create a startup script.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Waking remote PCs
|
|
|
|
|
=================
|
|
|
|
|
|
|
|
|
|
The simple way is to use ˋwakeonlanˋ which only supports MagicPacket™.
|
|
|
|
|
|
|
|
|
|
For a PC in a Class C network, use a call like this:
|
|
|
|
|
|
|
|
|
|
wakeonlan -i 192.168.1.255 de:ad:be:ef:ca:fe
|
|
|
|
|
|
|
|
|
|
This would send the packet to the 192.168.1.x subnet and the PC with the specified MAC address should wake up.
|
|
|
|
|
|
|
|
|
|
**Note:** Some nVidia chipsets require the MAC address to be specified in reverse order. In the example this would
|
|
|
|
|
be ˋfe:ca:ef:be:ad:deˋ.
|