Saturday, August 05, 2006

linux notes august 5th 2006

Getting wake on lan or WOL working with ubuntu.

Here are the steps in most basic form

1) Make sure you have hardware that supports WOL. If you are unsure go to the website of your motherboard manufacturer and NIC manufacturer. It should say in their documentation if it is suupported or not.

2) Boot your computer and get the BIOS setup menu. Search for the wake on lan option and enable it. '

3) reboot and login to ubuntu
run this command
sudo su
input password

now we want to enable WOL inside ubuntu.
I personally am not sure this needs to be done but it didnt work for me until I ran the following code:
ethtool -s eth0 wol g

problem is this only works on a one time basis. This means we need to run the ethtool code everytime the computer starts. This way WOL will always work.

How do we do this?

become root
sudo su

now input your password

now change to the proper directory so that the code is run at startup
cd //etc/init.d

now create the file which will become the program
nano ethtool

now put the command in the file and then exit and save the file
ethtool -s eth0 wol g

now we need to set the permissions of the file ethtool
chmod a+x ethtool

now we need to update rc.d so that our code is run on startup
update-rc.d -f ethtool defaults

4. Now do a reboot and test it out by sending that magic packet from another computer.


Blogger wasauce said...

Note that this wake on lan requires the computer to be off. It will not wake the computer from hibernate mode. I am still figuring out it it will awake the computer from suspend.

11:34 AM  
Blogger subzero79 said...

Also i have to add, if anyone is using an nforce ethernet controller the should use a reversed MAC for the WOL. Instead of sending a magic packet for 01:02:03:04:05:06 it has to be 06:05:04:03:02:01

1:06 PM  

Post a Comment

<< Home