Page 1 of 6 123 ... LastLast
Results 1 to 10 of 190

Thread: HOWTO: Set your system up for Wake On LAN (WOL)

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Swift Current, Newfoundland, Canada
    Beans
    195
    Distro
    Kubuntu 6.06

    HOWTO: Set your system up for Wake On LAN (WOL)

    This is really common, but I haven't seen a ubuntu howto for it, people more or less peice it together from posts and blog entries and the like.

    So, here it goes. First off, make sure your system supports WakeOnLAN (WOL), if you know your system well, you already know if it does or doesn't.

    --

    Automatic way:
    This script does everything described in the Manual way, for you, except step 1 and step 4.
    ------------------------

    The automatic method is super dialup friendly! thanks to gzip compression the filesize is a mere 1.5kb! almost half the extracted size of 3.4kb!


    1. If you havent already, go to your BIOS, and turn on WakeOnLAN (it varies, look for it.) If your network card is onboard, your set for step 2, otherwise there is probably a cable that should go from your network card to your motherboard, though this is not always the case.


    Before continuing, note the interface you want to do this to. Most people know how to do this, if you do not, look at step 2a of the manual method.

    2. Download and extract this: You can do it with the GUI and run the extracted program in a terminal by double clicking it, or open a terminal and do the following:

    **** Removed dead link ****

    3. As the exit of the program notes, now you just need to get/use a wake on lan sending program, like wakeonlan.

    4. Sit on your lazy *** and have fun

    --

    Manual way:
    ------------------------
    1. If you havent already, go to your BIOS, and turn on WakeOnLAN (it varies, look for it.) If your network card is onboard, your set for step 2, otherwise there is probably a cable that should go from your network card to your motherboard, though this is not always the case.

    2. Back in ubuntu, kubuntu, xubuntu, w/e, we now need to make a script that will run every time the computer is started, because this command only lasts until the computer is turned on again once.

    2a. Find out what network device you want to have the computer wake-able from, usually all, which is just one. If you have more network devices in your system, 9 chances out of 10, you already know what they are called.
    You can NOT wake up a laptop or computer that is only connected via wireless with wake-on-lan, unless the bios has a method for this, this is very rare, and I do not garuntee this howto will work in such cases.
    In your terminal, type:
    Code:
    ifconfig
    You'll get something like: (I have removed my mac address for security)
    Code:
    eth0      Link encap:Ethernet  HWaddr 01:23:45:67:89:ab
              inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::215:f2ff:fe6f:3487/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:71495 errors:0 dropped:0 overruns:0 frame:0
              TX packets:76190 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:23164212 (22.0 MiB)  TX bytes:7625016 (7.2 MiB)
              Interrupt:217 Base address:0xd400
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:1290 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1290 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:161182 (157.4 KiB)  TX bytes:161182 (157.4 KiB)
    So, I want this system to be wake-able from eth0.

    2b. Now we create the script.
    Note: you must be an administrator on the system you are doing this to.
    Code:
    sudo -i
    Enter your password at the prompt.
    Change to the startup script directory and start editing a new file:
    Code:
    cd /etc/init.d/
    pico wakeonlanconfig
    Paste, or type this into the file, replacing eth0 with your network device, repeat the ethtool line as many times for your devices before the exit line:
    Code:
    #!/bin/bash
    ethtool -s eth0 wol g
    exit
    Set the permissions of the file:
    Code:
    chmod a+x wakeonlanconfig
    Make the script run on startup:
    Code:
    update-rc.d -f wakeonlanconfig defaults
    You should see something like:
    Code:
     Adding system startup for /etc/init.d/wakeonlanconfig ...
       /etc/rc0.d/K20wakeonlanconfig -> ../init.d/wakeonlanconfig
       /etc/rc1.d/K20wakeonlanconfig -> ../init.d/wakeonlanconfig
       /etc/rc6.d/K20wakeonlanconfig -> ../init.d/wakeonlanconfig
       /etc/rc2.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig
       /etc/rc3.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig
       /etc/rc4.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig
       /etc/rc5.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig
    Now we finish by running it, and making sure there are no errors.
    Code:
    /etc/init.d/wakeonlanconfig
    This should produce no output and put you right back at the prompt you started at.

    3. Use it. you'll need something to send wake-on-lan packets with, "wakeonlan" is in the repos. And you'll need the mac address of the system.

    To get your MAC address, on the same system you just enabled WOL on, type:
    Code:
    ifconfig | grep HW
    its the thing that looks like 01:23:45:67:89:ab , write it down.
    turn off that system:
    Code:
    sudo halt
    if your using wakeonlan from the repos, and you are on the same network as the computer your tying to wake up, replace 01:23:45:67:89:ab with your mac address and do, from another computer:
    Code:
    wakeonlan 01:23:45:67:89:ab
    In MOST cases, you CAN SEND wake on lan packets from a wireless connected computer.
    If that doesnt work, its likely the port on the system your trying to wake up isnt the default (9), try 7, or if your BIOS settings or book told you one, use that one.
    Code:
    wakeonlan -p 7 01:23:45:67:89:ab
    If that STILL doesnt work, make sure wakeonlan is enabled in your bios and your hardware supports it.

    *Note: It has been said that you need to disable -i from halt, however I have never had to do this, nor do I know how.

    4. Sit on your lazy *** and have fun

    Feel free to post any questions, suggestions, problems and I will tend to them ASAP.

    Added notes:
    * For this to work, most systems must be shut down properly, ie: with the power button or halt, or any of the ways to shut down. Unclean power-offs (like a power outage or holding the power button for 5s) seem to stop WOL from working untill the system is powered on and shut down properly. Though, there my be a few exceptions. This is a hardware issue with the BIOS. In my opinion, WOL should work regardless of how the system is powered off, but thats not the case. I suggest, if you have frequent power outages, that you have your BIOS set to Power ON after a power failure, most new systems allow this.
    Last edited by dmizer; January 23rd, 2009 at 08:33 AM. Reason: removed dead link

  2. #2
    Join Date
    Aug 2006
    Beans
    13

    Re: HOWTO: Set your system up for Wake On LAN (WOL)

    Many Thanks Chris, for this clear explanation. It saved me a lot of time.. I am very new to Linux, and already found how that the ethtool wol settings aren't persisted, but I didn't figure out yet how to make my system remember them.

    The only problem I now have is: my computer wakes up within a minute after shutting down. Something wakes it up (which gives me hope that WOL *is* actually working on my system) but I want it to start up only if *I* send a magic package of course! I did set the wol setting to: g.

    Do you have any idea what could be causing this? In the mean time, I am going to check my bios settings..

    Cheers
    Hans

  3. #3
    Join Date
    Aug 2006
    Beans
    13

    Re: HOWTO: Set your system up for Wake On LAN (WOL)

    Yep! It works! The problem was in the BIOS settings. I set the Wake on PCI Card setting to Yes, and disabled the Wake on PCI Master (which was probably causing the computer to start up too soon)

    BTW I start my Ubuntu box from a Windows XP system using the Magic Packet Sender utility (http://magicpacket.free.fr/) that's connected via a wireless network. It works like a charm.

    Thanks again,
    Hans
    Last edited by hvollebregt; August 25th, 2006 at 09:29 PM.

  4. #4
    Join Date
    Oct 2005
    Location
    Swift Current, Newfoundland, Canada
    Beans
    195
    Distro
    Kubuntu 6.06

    Re: HOWTO: Set your system up for Wake On LAN (WOL)

    Hm, the wake on pci thing could be what puzzled me about some systems i came across before.... i thought there was a wakeonlan thing going on, because within 1 hour, about 3 computers in a lab where i worked would randomly turn on if you turned them off... puzzled the hell out of me.

    thanks, and have fun being lazy ;P

  5. #5
    Join Date
    Oct 2005
    Location
    Swift Current, Newfoundland, Canada
    Beans
    195
    Distro
    Kubuntu 6.06

    Re: HOWTO: Set your system up for Wake On LAN (WOL)

    Automated script now available. Currently only supports 1 interface, more means manual. Version 1.0 of the script should be up within 48 hours that supports multiple interfaces.

    enjoy

  6. #6
    Join Date
    Apr 2005
    Location
    Veracruz, Mexico
    Beans
    201
    Distro
    Ubuntu 6.06

    Re: HOWTO: Set your system up for Wake On LAN (WOL)

    How do I wake on WAN my pc? I've tried wakeonlan within my network, but I can't access it outside my network.
    Free your mind...

  7. #7
    Join Date
    Feb 2006
    Beans
    30

    Re: HOWTO: Set your system up for Wake On LAN (WOL)

    Thank you Chris for this description. I have one important question: what is a purpose for that script that was added to the description? As far as I know WON (Wake On Lan) mechanism is fully based on hardware and is OS (operating system) independent. If you want to use WON you need just a motherboard with BIOS enabled feature of WON and NIC with WON enabled future. That is all. If you are able to boot up a PC remotely that you are able to load any OS. Did I miss something?

    Kind regards,
    Maciej

  8. #8
    Join Date
    Jun 2006
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: HOWTO: Set your system up for Wake On LAN (WOL)

    @mslonik

    I assumed the same until I had to use it practically.

    Now I think it is like this:

    When wol is enabled and the computer is powered down, not all components of the computer are shutdown: for example I suppose that at least the ethernet port has to remain active in order to process the wol magic packet.

    I suppose that the script configures the computer to keep the ethernet active.

    Moreover, I have discovered the following with my hardware: if I pull the power supply plug from my computer and connect it again, the wol does not work any more. I have to start the computer with the poweron button. Afterwards wol works again.

    frafu

  9. #9
    Join Date
    Dec 2005
    Beans
    25

    Re: HOWTO: Set your system up for Wake On LAN (WOL)

    This script was not working, and I saw that the LED in my router corresponding to the computer I wanted to wake was going off when I powered off the computer.

    So I decided to try to remove -i from halt as suggested, and it worked!!!

    This is what I did (I'm running Edgy), I warn you that I am not an expert so I don't know if it's OK to do this:

    - Make a backup of the /etc/init.d/halt script
    - edit the /etc/init.d/halt script
    - Locate the line where the halt command is invoked:
    Code:
    halt -d -f -i $poweroff $hddown
    - Remove the -i

    That's it. Hope it works for you!!

  10. #10
    Join Date
    Feb 2006
    Beans
    30

    Re: HOWTO: Set your system up for Wake On LAN (WOL)

    Some general remarks on Wake on Lan. First, after some trials on hardware and careful examining all former answers I found the following procedure useful for testing if hardware compoments are ready (compliant) with this technology.

    Hardware components:
    1. BIOS / motherboard.
    2. NIC (Network Interface Card) or Netword Adapter.

    Procedure:
    1. In BIOS of your motherboard enable WOL functionality (typically in Power Management Setup branch of BIOS options). Is your motherboard compliant to PCI 2.1 standard?
    YES | NO

    2. Check if for sure your NIC is WOL compatible. Is your NIC compliant to PCI 2.1 standard?
    YES | NO

    3. Check if your power supply is ATX compliant:
    YES | NO

    If answer to this question is NO than sorry, you can not use WOL functionality.

    3. If answers to questions 1. and 2. are YES than you don't need WOL cable. If any answer to questions 1. and 2. is NO than you need WOL cable. Connect your NIC with motherboard with special WOL cable. See your hardware manuals if any doubts.

    4. Experiment. Set your BIOS function WOL enabled and PC in shutdown state. Check if diode on the switch that your NIC is connected to is lit or flashes.
    YES | NO

    Remark: If NO than there is a problem. Try to boot up your PC and correctly shut it down. Check again.
    Remark: Sometimes NIC vendors add a diode for constant monitoring of LAN activity. If BIOS function of WOL is enabled than also diode on your NIC flashes together with diode on a switch. Check your NIC manual if any doubts about diodes functionality.

    5. Experiment. Set your BIOS function WOL enabled and PC in shutdown state. From the other computer on the same LAN send MP (Magic Packet) to your PC. Does it awake your PC?
    YES | NO

    Remark: It should wake it up. Try to boot up your PC and correctly shut it down. Check again.

    6. Experiment. Set your BIOS function WOL enabled and PC in shutdown state. Switch off a power supply for at least 10 seconds. Observe if a LED on a switch lights off. Now switch on a power supply. From the other computer on the same LAN send MP (Magic Packet) to your PC. Does it awake your PC?
    YES | NO

    Remark: My computer does not. Perhaps some people will find their hardware working on these conditions. Please report on that. In my opinion this is one of the weakest points of the whole WOL idea. If there is power loss in your home than your computer can not be awaken remotely. It should be this way, but it seems that most of the NICs do not fulfil this requirement. This fact is very seldomly reported. All I was able to find was honest report of one vendor here:
    http://www-307.ibm.com/pc/support/si...cid=SF06-D0035
    Such a feature as remote wake up after power loss just should work.

    7. Experiment. Set your BIOS function WOL enabled and PC in shutdown state. Wake it up with MP (Magic Packet) send from another PC on your LAN. As soon as it starts to boot and beeps single (end of POST procedures) press power button on a chassis and turn it off again. Now send MP again. Does it wake up your PC?
    YES | NO

    Remarks. Again, it should wake up your PC. If it doesn't than some problems may occure with your system and "clear shutdown".

    Answers to above quiz on my hardware:
    1. YES. Motherboard: Abit SA6R. Tweaked BIOS (self made) basing on 7X version.
    2. YES. Compaq PCI 10/100 WOL, MPX EN 5038 B. Hard to say what piece of hardware it really is. I used to have 3COM 905C TX-M. Unfortunately this one wasn't working with WOL at all on Linux or even Windows. Strange, but true.
    4. YES.
    5. YES.
    6. NO.
    7. YES.

    Now, the software part of WOL mechanism:
    1. OS (Operating System), especially so called "halt scripts".
    2. NIC driver.

    Remarks: People in this thread reports that special script is required or at least some tweaks with halt script to enable OS clear shutdown with NIC still powered after shutdown. If your hardware passed the above procedure in similar to my than likely you don't need any special script. Nevertheless I've never tried wake on states different from S5 (ACPI). Perhaps such a script is required for S4 (hybernate state).

    Remark: I don't feel comfortable with Linux drivers, so please get me right if I'm wrong but driver for NIC is a standard part of a kernel and there is not much to do, at least with standard kernel that comes with distro. Your NIC should work out of a box.

    Remark: The rule of a thumb no. 1. If WON works on Windows, it should so on Linux. If your NIC doesn't work on Linux (or you suppose a problem) take it off your PC and put into another one managed by Windows. Check if it works there.

    Remark: The rule of a thumb no. 2. NIC 100 Mbit cards are very cheap nowadays. Borrow one that works with WON from your friend. Now check if yours works with your friend's hardware. Try to exchange with your friend on the NICs.

    I hope that this short summary will be of any help to somebody. Good luck!

    mslonik (Maciej)

Page 1 of 6 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •