Wake on LAN settings for XenServer 5.5

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).

 

Esther Barthel
Solutions Architect at cognition IT

Esther has been working in different roles and functions as an IT consultant ever since she finished her Masters degree in Computer Science in 1997. She has worked as a web developer, database administrator, and server administrator until she discovered how Server-Based Computing ( SBC ) combined servers, desktops, and user experience in one solution. Esther has been specializing in virtualization solutions such as SBC, VDI, application, and server virtualization for over eight years now and is currently working as a Senior Consultant at PepperByte, where she designs and implements Citrix® solutions for both small-business and large-enterprise infrastructures scaling from 100 to 15,000 users.
In january 2014 her first book Citrix XenApp 6.5 Expert Cookbook was published by Packt Publishing.

Esther is awarded as a Citrix Technology Professional (CTP) from 2015 - 2017.
Esther is awarded as a Microsoft Most Valuable Professional (MVP) in 2017.

Esther is a Citrix Certified Expert – Virtualization (CCE-V), Citrix Certified Professional – Mobility (CCP-M), Citrix Certified Professional – Networking (CCP-N) and RES Software Certified Professional (RCP).

3 thoughts on “Wake on LAN settings for XenServer 5.5

  1. Pingback: VirtuEs.IT

  2. Pingback: Esther