Wake on LAN with SuSE Linux 10.0 |
|||||||||||||||||
With my setup
there is a problem to get Wake on LAN running. With the following setup
I observed the same problem and could solve it with the same method described below.
The SuSE boot resp. shutdown script for getting up or down the network interfaces
To get around this problem I put up and successfully tested the following mechanics:
The SuSE
Be aware of the fact that not every ethernet hardware or driver supports wake on lan.
E.g. the driver for the Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller
(which is also installed on the Asus A8N SLI Premium mainboard) has not implemented the
wake on lan enable (maybe this has changed with the most recent version of the driver).
So make shure by using
Where the shown characters mean:
And don't forget to enable "Poweron on PCI Devices" or similar in the Bios setup.
Here comes the example of a
BOOTPROTO='static'
BROADCAST=''
IPADDR='192.168.106.203'
MTU=''
NAME='ASUSTeK K8N4-E Mainboard'
NETMASK='255.255.255.0'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
UNIQUE='xxxxxxxxx'
USERCONTROL='no'
_nm_name='bus-pci-0000:00:0a.0'
POST_DOWN_SCRIPT=enable-wol
My script which is shown below brings up again the ethernet device and then uses
Below my script
#!/bin/bash
#
# $Revision: 1.3 $, $Date: 2006/08/04 15:29:14 $
#
# Copyright (C) 2006 Zoologisches Institut und Programm MGU, Uni Basel
# Lukas Zimmermann, lukas.zimmermann@unibas.ch.
# All rights reserved.
#
######################################################################
# mode of "g" is wake on MagicPacket
WOL_MODE=g
# debugging
#LOG_LEVEL=7
# change the working direcory and source some common files
#
R_INTERNAL=1 # internal error, e.g. no config or missing scripts
cd /etc/sysconfig/network || exit $R_INTERNAL
# config has at least USE_SYSLOG
test -f ./config && . ./config
test -f scripts/functions && . scripts/functions || exit $R_INTERNAL
# check the command line arguments
if [ $# -gt 0 ]; then
CONFIG=$1
shift
else
exit $R_USAGE
fi
if [ $# -gt 0 ]; then
INTERFACE=$1
shift
else
exit $R_USAGE
fi
# set the interface up and running again
debug "`printf " interface %s is getting put up again." $INTERFACE`"
if ! ip link set up dev $INTERFACE ${LLADDR:+address $LLADDR} ; then
logerror "Cannot enable interface $INTERFACE."
exit $R_NOTRUNNING
else
debug "`printf " interface %s link has successfully been put up again." $INTERFACE`"
fi
# enable the wake on lan feature
debug "`printf " enable WOL for interface %s." $INTERFACE`"
/usr/sbin/ethtool -s $INTERFACE wol $WOL_MODE
# check whether the enabling was successful
wol_status=$(/usr/sbin/ethtool $INTERFACE | grep Wake-on: | grep -v Supports \
| sed -n -e 's/^[[:space:]]*Wake-on:[[:space:]]*\([^[:space:]]*\).*$/\1/p')
if [ "$wol_status" == "$WOL_MODE" ]; then
msg='Successfully set WOL status for interface %s to \"%s\".'
message "`printf "$msg" $INTERFACE $wol_status`"
else
logerror "Enabling WOL on interface $INTERFACE did not work."
msg=' WOL status is \"%s\" but should be \"%s\".'
debug "`printf "$msg" $wol_status $WOL_MODE`"
fi
Finally you need a program which assembles and sends a MagicPacket to the network
where the machine to be waken up listens.
Such a program is e.g. Donald Becker's
ether-wake. Have a look at
his web page on the topic.
More on wake on lan with linux you can find at the Wake on LAN mini HOWTO |
|||||||||||||||||
|