Turn On Linux Servers Remotely Without Physical Access


Wakeonlan enables you to switch ON remote servers without physically accessing it. Wakeonlan sends magic packets to wake-on-LAN enabled Ethernet adapters and motherboards to switch on remote computers.

By mistake, when you shutdown a system instead of rebooting, you can use Wakeonlan to power on the server remotely. Also, If you have a server that don’t need to be up and running 24×7, you can turn off and turn on the server remotely anytime you want.

Overview of Wake-On-LAN

  • You can use Wakeonlan when a machine is connected to LAN, and you know the MAC address of that machine.
  • Your NIC should support wakeonlan feature, and it should be enabled before the
    shut down. In most cases, by default wakeonlan is enabled on the NIC.
  • You need to send the magic packet from another machine which is connected to the same network (LAN). You need root access to send magic packet. Wakeonlan package should be installed on the machine.
  • When the system crashes because of power failure, for the first time you cannot switch on your machine using this facility. But after the first boot you can use wakeonlan to turn it on, if the server gets shutdown for some reason.
  • WakeonLan is also referred as wol.

Check whether wol is supported on the NIC

Execute the following command in the server which you want to switch ON from a remote place.

# 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: 1

Transceiver: internal

Auto-negotiation: on

Supports Wake-on: pumbg  [ Note: check whether flag g is present ]

Wake-on: g [Note: g mean enabled. d means disabled]

Current message level: 0x00000001 (1)

Link detected: yes

If Supports Wake-on is g, then the support for wol feature is enabled on the NIC card.

Enabling wol option on the Ethernet Card

By default the Wake-on will be set to g in most of the machines. If not, use ethtool to set the g flag to the wol option of the NIC card as shown below.

# ethtool -s eth0 wol g

Install wakeonlan package on a different machine

Install the wakeonlan package in the machine from where you need to send the magic packet to switch on your server.

Note down the MAC address of the remote server

Note down the MAC address of the server that you wish to switch on remotely.

# ifconfig

eth0     Link encap:Ethernet  HWaddr 00:16:k5:64:A9:68  [ Mac address ]

inet addr:192.168.6.56  Bcast:192.168.6.255  Mask:255.255.255.0

Finally, Switch ON the machine remotely without physical access

When the server is not up, execute the following command from another machine which is connected to the same LAN. Once the magic packet is sent, the remote system will start to boot.

# wakelan 00:16:k5:64:A9:68

About Alex Hunt

Hi All I am Manish Kumar Jha aka Alex Hunt. I am currently working in VMware Software India Pvt Ltd as Operations System Engineer (vCloud Air Operations). I have around 5 Years of IT experience and have exposure on VMware vSphere, vCloud Director, RHEL and modern data center technologies like Cisco UCS and Cisco Nexus 1000v and NSX. If you find any post informational to you please press like and share it across social media and leave your comments if you want to discuss further on any post. Disclaimer: All the information on this website is published in good faith and for general information purpose only. I don’t make any warranties about the completeness, reliability and accuracy of this information. Any action you take upon the information you find on this blog is strictly at your own risk. The Views and opinions published on this blog are my own and not the opinions of my employer or any of the vendors of the product discussed.
This entry was posted in Linux/CentOS. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s