One of the create extra features on most NICs nowadays is the support for Wake On LAN. An option to wake up your system by sending a signal to your Network Interface Card (NIC). This signal can be a so called Magic Packet.
All you need for this option is a Motherboard that supports Wake-On-LAN (WOL) or Power Management Events (PME); which has to be enabled in the BIOS. And a NIC that also supports WOL. Even though WOL is Operation System independent, it’s behavior is usually configured from within the OS.
I want to be able to use WOL as a startup method for my XenServer systems, Therefore I looked at the options Linux has to offer to enable a NIC to listen for special WOL packets and boot up the system.
This post offers instructions to enable the WOL support with XenServer 5.5.
WOL (DOS) client tool
To be able to sent the Magic Packet to the NIC of my XenServer, I use a DOS WOL.EXE tool on my Windows 7 Management client.
* Using WOL.exe:
wol.exe [mac-address]
Which uses the following additional syntax:
- mac-address: The MAC-address of the NIC that needs to receive the Magic Packet. (No seperators are used).
WOL (XenServer/Linux) Server settings
For enabling the special WOL features for the NIC on a XenServer you can use ethtool. A Linux command to modify the NIC parameters and part of the XenServer installation.
* Using ethtool:
ethtool -s [nic-id] wol g
Which uses the following additional syntax:
- nic-id: The identifier of the NIC for which the WOL features are activated (the first NIC in a Linux system is known as eth0, the second NIC as eth1, etc.).
The g parameter is used to make the NIC listen for the Magic Packet.
ethtool only activates the WOL listener for the NIC once.
Permanently set WOL Server settings in XenServer
As the WOL listener feature for the NIC with ethtool is not a permanent change for the NIC, it needs to be run on every startup or shutdown of the system to keep it working. In order to make the WOL settings permanent you can perform the following commands on you XenServer to add the command to the startup settings of the XenServer.
* Edit the /etc/rc.d/rc.local file
Open the rc.local file with the nano editor by typing the following command:
nano /etc/rc.d/rc.local
* Add the ethtool command:
Add the following line under the ‘touch /etc/boottime stamp’ line in the file:
ethtool -s [nic-id] wol g
Which uses the following additional syntax:
- nic-id: The identifier of the NIC for which the WOL features are activated ( first NIC is known as eth0, second NIC as eth1, etc.).
Use [Ctrl+X] to exit the editor and save the changes.
You’ll need one more reboot to activate the WOL settings for the NIC of your system and be able to start up your system by sending the Magic Packet to the MAC address of the activated NIC with a WOL client tool (like wol.exe).
The following sources have be used to create this post:
How to Wake On LAN on XenServer
ethtool – Linux command – Unix command
Gammadyne’s Free DOS Utilities
Pingback: VirtuEs.IT
Pingback: Esther
No. But now i will. Thanks for that.