WOL How to

John Hubbard ender8282 at yahoo.com
Wed Jan 21 05:17:05 UTC 2009


Alex Katebi wrote:
> Anybody knows how to configure the Wake On LAN option of a NIC card in 
> Ubunutu?
> WOL feature is used for powering on remotely.
>
>
I got WOL working pretty well on my media box.  I wrote a little script 
after I did it so that it would be easier the next time.  No guarantees 
that it works but here it is.  Look I even included comments. 
#!/bin/sh
#install the ethtool package
sudo apt-get update && sudo apt-get -y install ethtool

#create the startup script to enable wake on lan
echo '#!/bin/bash' >> ~/wakeonlanconfig
echo 'ethtool -s eth0 wol g' >> ~/wakeonlanconfig
echo 'exit' >> ~/wakeonlanconfig

#give the script correct ownership and move it
sudo chown root:root ~/wakeonlanconfig
sudo chmod 775 ~/wakeonlanconfig
sudo mv ~/wakeonlanconfig /etc/init.d/wakeonlanconfig

#install the script in the correct places
sudo pdate-rc.d -f wakeonlanconfig defaults

#run the script this first time
sudo /etc/init.d/wakeonlanconfig

echo "Add the following line to the file /etc/ethers on all"
echo "machines that should be able to easily wake this one."
echo "`ifconfig | grep HW | cut -d " " -f 11`   `hostname`"

echo "make sure that this machines name/ip are included in "
echo "the /etc/hosts of the machines that will wake it."

-- 
-john

To be or not to be, that is the question
                2b || !2b
(0b10)*(0b1100010) || !(0b10)*(0b1100010)
        0b11000100 || !0b11000100
        0b11000100 || 0b00111011
               0b11111111
        255, that is the answer.






More information about the ubuntu-users mailing list