One of the issues with running remotely is this flat out doesn’t work if the remote machine is suspended or powered off. As the summer months approach, power management is increasingly important, particularly in North Carolina, and particularly in a house where the office is in a finished attic.
Booting a machine is possible remotely, but it takes a series of steps to set up, but I managed to muddle through it.
First, I need to enable the function in the BIOS, by pressing F2 on startup, selecting “Power Management Setup” and enabling “Resume by PCI PMC”.
Next I needed to gather some details using ifconfig (like Joe, I missed the memo). The information I needed was the name of the device, (eth0), the HWaddr (of the form 00:00:00:00:00:00), and the Bcast address (191.168.1.255).
Next, I verified what the hardware supports by entering sudo ethtool eth0. In my case it said “Supports Wake-on: g” and “Wake-on: d”. Translated this apparently means “MagicPacket support is available, but is currently disabled”. It turns out that enabling wake on LAN is something that you need to do each time you boot, so I created a file named /etc/network/if-up.d/wake-on-lan with the following contents:
#!/bin/sh
/usr/sbin/ethtool -s eth0 wol g
I then restarted the network with
/etc/init.d/NetworkManager restart
At this point, I was (finally!) set up. I can suspend, hibernate, or outright shutdown that machine.
On the remote machine (in my case an eee), I installed wakeonlan, and created a small script:
wakeonlan -i 191.168.1.255 00:00:00:00:00:00
I’ve heard reports that this doesn’t work over wireless, but I had no problem. I presume that this would have to do with your specific network topology as this is operating at the LAN level.
For options other than g, etherwake may be of interest.
Wake On Lan is great, and I’m glad it works well in your network. When it doesn’t there are additional tools to extend the reach of Wake On Lan requests. I developed one, which you can find at CodePlex [link]. It’s Windows only I’ll warn you, but what it does is run a proxy which will forward requests. That is useful if you have a group of machines that should be off, and can leave one on, but can’t get the Wake On Lan command to reach the NIC from the more remote machine you use while on the go.
The same utility also helps Windows users setup their NICs for Wake On Lan. It can’t touch the BIOS settings, but pretty much everything else is covered.
I have been using “ip” instead of “ifconfig” for like 5 years. It is way better: more symmetric, and manages link, addresses, routes, neighbors, tunnels and ipsec stuffx, so it is basically a Network Swiss Army knife, substituting arp, ifconfig, route and some other commands.
ip addr (or ip addr show <your-if>) will show all sort of addresses. Here it shows ethernet, inet and inet6 addresses on my interface.
You’ve missed the best thing about Wake-on-LAN, which is that Aliens-"esque" feeling you get when starting up your remote machine. i.e. like Bishop flying the drop-ship down by remote...
Wow, I suppose I totally missed the memo on ifconfig and friends being obsolete. I guess you tend to stick with what you know as long as it’s working properly.