Penguin
Blame: WakeOnLanNotes
EditPageHistoryDiffInfoLikePages
Annotated edit history of WakeOnLanNotes version 5, including all changes. View license author blame.
Rev Author # Line
2 AristotlePagaltzis 1 Prerequisites for WakeOnLan:
1 DanielLawson 2
2 AristotlePagaltzis 3 * A motherboard aware of resume on ring events
4 * A [NIC] with WakeOnLan support
5 * Possibly a cable connecting the [NIC] to the [WOL] header on your motherboard (unless it's an onboard [NIC])
1 DanielLawson 6
2 AristotlePagaltzis 7 You will need to enable WakeOnLan in the machine's [BIOS], and you will need to know the [NIC]'s [MAC] address.
1 DanielLawson 8
2 AristotlePagaltzis 9 From another machine you can then use [ether-wake | http://www.scyld.com/wakeonlan.html] to send the special [Ethernet] frame:
1 DanielLawson 10
2 AristotlePagaltzis 11 <pre>
12 $ ether-wake ''$[MAC]ADDRESS''
13 </pre>
1 DanielLawson 14
2 AristotlePagaltzis 15 If you add an entry mapping [MAC] addresses to hostnames to <tt>/etc/ethers</tt>, you will also be able to simply say
1 DanielLawson 16
2 AristotlePagaltzis 17 <pre>
18 $ ether-wake <hostname>
19 </pre>
1 DanielLawson 20
2 AristotlePagaltzis 21 Pre-compiled packages of <tt>ether-wake</tt> exist for most LinuxDistribution~s. In [Debian], it's called <tt>etherwake</tt>, but the version available in [Woody] doesn't seem to support <tt>/etc/ethers</tt>.
1 DanielLawson 22
2 AristotlePagaltzis 23 Some [Linux] [NIC] drivers seem to disable the WakeOnLan function of the network card. If you can use WakeOnLan after booting into Windows, but not at all after booting into Linux, your driver is probably one of them. [ethtool | http://gkernel.sf.net/] allows you to change this. An initial query of an interface's properties will look something like this:
1 DanielLawson 24
2 AristotlePagaltzis 25 <verbatim>
26 $ ethtool eth0
27 Settings for eth0:
28 Supports Wake-on: g
29 Wake-on: d
30 Link detected: yes
31 </verbatim>
32
33 Here, MagicPacket (type g) WakeOnLan support is available but disabled (Wake-on: d). You can change this with a swift
1 DanielLawson 34
35 <verbatim>
2 AristotlePagaltzis 36 $ ethtool -s eth0 wol g
1 DanielLawson 37 </verbatim>
38
2 AristotlePagaltzis 39 This time, a query to confirm the result should produce something like this output:
1 DanielLawson 40
41 <verbatim>
2 AristotlePagaltzis 42 $ ethtool eth0
43 Settings for eth0:
44 Supports Wake-on: g
45 Wake-on: g
46 Link detected: yes
1 DanielLawson 47 </verbatim>
2 AristotlePagaltzis 48
49 Note that you'll need to change the setting anew on every boot, so stick the command in <tt>rc.local</tt> or whichever boot script is applicable.
5 ToniMarsh 50
51 If you encounter further problems check the parameters passed to the halt command in your shutdown script (/etc/init.d/shutdown.sh on gentoo).
52 The -i parameter tells halt to down all the network interfaces just before shutdown which will prevent wol from working.
3 AristotlePagaltzis 53
4 DanielLawson 54 ----
55
56 ! Which open ports do you need to open for ether-wake?
57
58 First of all, you normally use ether-wake to trigger a wake-on-lan event on a powered off computer. It is unlikely to have a firewall running at this point!.
59
60 ether-wake works by sending a special ethernet frame. Read the notes at MagicPacket for more information about this. Because this is an ethernet frame, and not actually an IP packet, it is not routable. The answer to the above question is "You can't".
61
62 There are other types of wake-on-lan triggers however, and I believe the only requirement is that it follows the format specified in the MagicPacket notes. these may or may not IP packets, and whether you need to open firewalls up to them or not will depend entirely on the local configuration.