Dell PowerEdge 1750 Wake On LAN on Gentoo/Funtoo Linux

After my previous entry about my PowerEdge 1750 , I’ve been trying to get Wake-On-LAN working. On every other machine I own, it simply involves at most activating WOL in the BIOS, then running ‘ethtool -s eth0 wol g’ on boot, but the PowerEdge 1750 with the “Broadcom Corporation NetXtreme BCM5704 Gigabit Ethernet” network card is a bit trickier to get working correctly.

After enabling “Pre-Boot Wake on LAN” in the BIOS ( a message to press CTRL+S appears while the machine is booting which gives you the option ), and setting wol to g with ethtool, the machine still did not boot from wake on lan.

After a lot of Googling, experimenting with different kernel options, and hacking at the tg3 module source code, I discovered the problem to be related to the ACPI power management – setting acpi=off in the kernel boot parameters lets Wake on LAN work, but has the obvious side affect of disabling any power management ( running ‘shutdown’ or ‘poweroff’ just halts the machine instead of powering it down for example ).

To work around this problem, I’ve created two init scripts, one to run on startup, one on shutdown. There is also a script to set the correct ACPI setting on the PCI bus, you will need to place this script (taken and modified from Heins Technology Group ) in /usr/local/bin/s5pci.sh :

#!/bin/bash

wolKeyword="disabled"
pciNIC="$1"

wolEnabled=$(acpitool -w | grep "$pciNIC" | grep -o "$wolKeyword")
if [ "$wolEnabled" = "$wolKeyword" ]; then
  id=$(acpitool -w | grep "$pciNIC" | awk -F. '{print $1}' | sed 's/^[ t]*//')
  acpitool -W $id
fi

On Gentoo/Funtoo, place this script in /etc/local.d/wol.start ( and set the execute permission ) – the location for other distributions will differ, place it wherever custom scripts run on startup usually live – you may need to modify the pci values to match the bus names for the network card from running “lspci”:

#! /bin/bash
/usr/local/bin/s5pci.sh pci0000:01
/usr/local/bin/s5pci.sh pci0000:02

ethtool -s eth0 wol g
ethtool -s eth1 wol g

On Gentoo/Funtoo, place this script in /etc/local.d/wol.stop ( and again, set the execute permission ) – the location for other distributions will differ, place it wherever custom scripts run on shutdown usually live:

#! /bin/bash
ifconfig eth0 down
ifconfig eth1 down

After rebooting the server, Wake on LAN should work correctly. If you only have one network interface, you can remove the references to eth1 ( my PowerEdge has two LAN interfaces ).