3C905C-TX/TX-MでWakeOnLAN

使い古したDellのマシン(OPTI PLEX GX240)にFedora9を入れて、久々に自宅サーバー化を図っています。
自宅に置いたままで常時使用する訳でもないので、外からアクセスしたいときだけ起動できる様にするため、まずは第一歩としてWakeOnLanをenableにしようとした所、躓いてました。

元々はWindowsマシンで、BIOSからWakeOnLanの設定をしてやると、マジックパケットをぶつける事で、LANから起動できていました。で、Fedoraをインストールしてから悩まされていたのが、WakeOnLanで起動できたり/出来なかったりする症状。
ここ数日、よく調べてみると、Linuxで”shutdown -h now”で終了すると、LAN端子のリンクLEDが消えて終了する。この状態では、マジックパケットをぶつけても当然起動せず。一度、100Vの電源プラグを抜き挿ししてやると、LAN端子のリンクが戻るので、それからマジックパケットをぶつけると、WakeOnLan可能。(要は終了時にLANカードへの給電を断っている感じ。)
ググると、同じ様に悩まされている人が結構居るようでしたが、ネットを読みあさっていたら解決方法をみつけたので、とりあえずメモ。

元々、ethtoolの出力はこんな感じ。

# 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: 24
Transceiver: internal
Auto-negotiation: on
Current message level: 0x00000001 (1)
Link detected: yes

う〜ん、普通は、"Supports Wake-on: puag"等の表示で、WakeOnLanをサポートする旨の表示が有る筈なのに・・・ドライバが対応してないのか?

ちなみに、man ethtoolで調べると、

wol p|u|m|b|a|g|s|d...
Sets Wake-on-LAN options. Not all devices support this.
The argument to this option is a string of characters
specifying which options to enable.
p Wake on phy activity
u Wake on unicast messages
m Wake on multicast messages
b Wake on broadcast messages
a Wake on ARP
g Wake on MagicPacket(tm)
s Enable SecureOn(tm) password for MagicPacket(tm)
d Disable (wake on nothing). This option clears all pre-
vious options.

ということで、WakeOnLanを実行するのにマジックパケット以外でも、ARP起動や、ブロードキャスト起動などで起動可能なLANカードが有るんですね。

現在のLANカード 3C905C-TX/TX-Mで、ethtoolで設定しようとすると、以下の様なエラーで蹴られました。

# ethtool -s eth0 wol g
Cannot get current wake-on-lan settings: Operation not supported not setting wol

いろいろ調べていると、こちらのUbuntuのフォーラムに、以下の様な記載を発見

Re: Wake On Lan (WOL) doesn't work with 3c905c
I have the same 3c905c card and it works for me now. I had to take the next steps:

1.) Connected network card with mobo with wol cable

2.) Enabled wake on lan in the BIOS

3.) Created a file called "network" in /etc/modprobe.d/

4.) added a line: options 3c59x global_enable_wol=1

5.) reboot

6.) shutdown -h now

7.) Send a magic packet and the server starts...

This works for me, even though ethtool still won't work and gives you the known response!
I didn't have to recompile anything

とりあえず、手順3)〜4)を実行してリブートしシャットダウンした所、WakeOnLan起動が可能になりました。
当然、shutdown時もLANカードのリンクLEDは点灯のままです。
(ethtool eth0の出力は、このときも上記と変わらずでした。)

まずはメモとして、なぜこれで良いのか?はこのあと調べる必要ありですな。