|Linux Backup Server: Remote Wakeup, Automatic Shutdown |
NIC and Motherboard Support
Monday, November 22, 2010 07:19:26 PM
In part 3 of this series we learn how to use WOL, Wake-on-LAN, and the finer points of shutting a system down.
At last I can write this up for you, my fine readers. Today we're going to learn about using Wake-on-LAN to wake up a server remotely, and automatic shutdowns. My master plan for my backup server is to automate everything-- wake it up, run backups for all the computers in my house, and then everyone shuts down for the night. (You might want to review part 1 and part 2.)
BIOS SupportThe first requirement is your system BIOS must support WOL, and usually it is disabled by default, so you must enter your BIOS to turn it on.
NIC SupportYour Ethernet interface must support Wake-on-LAN (WOL). How do you find out? You need the ethool command:
# ethtool eth0 | grep -i wake-on
man ethtool explains all the switches. At a minimum you want to see this:
Supports Wake-on: g
g means "Wake on MagicPacket". If you see "Wake-on: d" then WOL is disabled. You can enable it with ethtool:
# ethtool -s eth0 wol g
This should survive the next restart so you can test it, and it might even survive several restarts.
You also need the MAC address of your NIC, which you find like this:
# ifconfig eth0 | grep -i hwaddr
Now power down the machine. Go to a PC on the same subnet and install wakeonlan. Then wake up your server like this:
$ wakeonlan -p 8 00:0A:CD:22:33:92
wakeonlan doesn't need root privileges. -p 8 tells it to send a magic packet to UDP port 8. The default is UDP port 9, which is a discard port for testing, a dead end, so it won't work. You should check your own /etc/services to find an unused port, and then edit it to note which one you are using for WOL.
There are variables that may get in your way, such as a motherboard or NIC that do not support WOL, or an older motherboard that requires a 3-pin Wake-on-LAN connector, even if you have a newer NIC. If your motherboard supports PCI 2.2 it should support PME (power management events), which means signals are sent through the PCI socket and you shouldn't need a 3-pin Wake-on-LAN connector. PCI 2.1 and older require the extra 3-pin connector, and a NIC that has a socket for the connector.
ATX power supplies are controlled via software, and your system is not truly turned off until you press the power switch on the back of the power supply. When you run a shutdown command or press the switch on the front of your computer case, the system goes into a standby mode. It still receives a little bit of power so WOL can work.
Next: Starting Up, Shutting Down »
<A HREF="http://18.104.22.168/RealMedia/ads/click_nx.ads/intm/it/www.linuxplanet.com/linuxplanet/tutorials/7230/1/index@125x125-1,125x125-2,468x60-1,468x60-2,accessunit,ciu,cp1,cp10,cp11,cp12,cp13,cp14,cp2,cp3,cp4,cp5,cp6,cp7,cp8,cp9,flex,house_ribbon,peelback,send,sitetext-1!peelback" > <IMG SRC="http://22.214.171.124/RealMedia/ads/adstream_nx.ads/intm/it/www.linuxplanet.com/linuxplanet/tutorials/7230/1/index@125x125-1,125x125-2,468x60-1,468x60-2,accessunit,ciu,cp1,cp10,cp11,cp12,cp13,cp14,cp2,cp3,cp4,cp5,cp6,cp7,cp8,cp9,flex,house_ribbon,peelback,send,sitetext-1!peelback" border=0> </A>
Linux is a trademark of Linus Torvalds.
Go there Read more...