Wake-on-LAN

From MythTV Official Wiki
Revision as of 09:15, 5 January 2008 by Jddj (Talk | contribs)

Jump to: navigation, search


If you have a network card that supports wake-on-lan (wol), you can powerup your mythbox by sending it a 'magic packet' over the network. Here's what i did (i use an Epia M10k with Fedore Core 4):

Setting up

First, find out whether your network card supports wol:

# 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: MII
       PHYAD: 1
       Transceiver: internal
       Auto-negotiation: on
       Supports Wake-on: pumbg
       Wake-on: g
       Current message level: 0x00000001 (1)
       Link detected: yes

The 'g' in Supports Wake-on: pumbg indicates that wake-on-lan by using a 'magic packet' is indeed supported. Next, you need to make sure that wake-on-lan support is enabled in the BIOS (although, this does not seem to be necessary for my motherboard). In addition, you need to tell your network card to enable wake-on-lan:

# ethtool -s eth0 wol g

Since after rebooting Wake-on will be reset, you might what to add it to /etc/rc.local:

# echo 'ethtool -s eth0 wol g' >> /etc/rc.local

Now turn off you mythbox and send it a 'magic packet'.

Sending 'magic packet' to wake up your mythbox

You will need a wake-on-lan client to send 'magic packets' over your network. First, determine the MAC address of the machine you what to power on:

# ifconfig

Turn off your mythbox and from another computer execute the following command (replacing the MAC address with the one you just found). I used a wake-on-lan client from Sourceforge.

$ wol 00:4F:49:07:0B:5F

If all went well, your mythbox will boot up now! There are other clients for Windows and Mac OS X as well.

Password 'protection'

Wake-on-lan has a SecureON password feature. Here's an example of how to use ethtool and wol with SecureON (note that the password contains 6 hexadecimal numbers):

# ethtool -s eth0 wol g sopass 11:22:33:aa:bb:cc 
$ wol --passwd=11-22-33-aa-bb-cc 00:4F:49:07:0B:5F

Wake-on-LAN supported but just won't wake up

At this writing, the Marvell Gigabit Ethernet controller on the Asus A8V and some other motherboards, using skge driver under Debian Etch may not wake at all while connected at Gigabit speeds to a Gigabit switch. The same hardware may wake correctly when shutdown with Windows in a dual-boot system.

A variety of workarounds have been suggested, from modifying the halt binary to using the NIC at 100 Mbps speeds, to placing calls to ethtool in various startup/network/shutdown scripts, but the simplest path to solution is probably to disable the motherboard network controller in BIOS and replace with a known-good PCI Gigabit NIC (such as the US Robotics 7902 Gigabit NIC).

Useful links

  1. http://ahh.sourceforge.net/wol/ (wake-on-lan client + additinal information)
  2. http://dag.wieers.com/packages/wol/ (wol packages for RedHat and Fedora)
  3. http://www.die.net/doc/linux/man/man8/ethtool.8.html (man page for ethtool)
  4. http://www.sourceforge.net/projects/gkernel/ (gkernel package that contains ethtool)