Results 1 to 8 of 8

Thread: HOWTO: Wake On Lan from internet

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2006
    Location
    Heesch, Netherlands
    Posts
    118

    HOWTO: Wake On Lan from internet

    I have a working Wake On Lan Solution on my asus wl500gx using ether-wake, which is included in Oleg firmware.
    It's quite simple, and works with the (also builtin) busybox_httpd webserver, without making NAT rules for wake on lan in your modem!

    First: Make your asus webserver accessible from the internet. See other HOWTO's how to do that. In my asus httpd runs on port 81, my modem has a NAT rule to translate external port 80 to internal port 81.

    If you want to hide your wake-on-lan webpage behind a password protected area (which you probably want, otherwise everyone could turn on your home pc's) you have to include a line to your config file:

    Code:
    /cgi-bin:user:password
    In this example, only the active pages will be protected, you can also protect other folders, with one or more useraccounts:

    Code:
     /adm:admin:setup  # Require user admin, pwd setup on urls starting with /adm/
     /adm:toor:PaSsWd  # or user toor, pwd PaSsWd on urls starting with /adm/
    Save your configfile under /opt/etc/httpd.conf

    Start busybox_httpd with:
    Code:
    busybox-httpd -c /opt/etc/httpd.conf -p 81 -h /opt/share/www
    Replace path to configfile, portname and weblocation to your own values of course.
    You can place this into /usr/local/sbin/post-boot

    Findout if your pc can be woken up by issueing the command:
    Code:
    ether-wake -i br0 00:11:22:33:44:55
    Replace with your own mac adress of course. If it's not working, check if your pc or network settings. Your pc has to be a wired connection to the internal network where the asus is connected. Not all routers pass through the magic packet, so best is to keep it simple, and connect the pc directly to the asus. (this howto is not intended for resolving general WOL problems)

    If the pc wakes up, you can place the following file into your cgi-bin folder on the shared weblocation, in my case: /opt/share/www/cgi-bin/wol.cgi
    Code:
    #!/bin/sh
    ether-wake -i br0 11:22:33:44:55:66
    echo "<HTML><HEAD><title>test</title></head><BODY>Magic Packet Sent</Body></html>"
    After creating/placing the file, chmod +x it, to give it a execute permissions.

    As you see, you can edit this file as you like, or create multiple cgi-bin files, with a central html page with links to all corresponding files, for multiple pc's.

    Now, powerdown the pc, go to another pc and go to www.yoursite.com/cgi-bin/wol.cgi

    You will see the password protection if installed, after entering your credentials, the pc will wake up!

    Because the magic packet was sent by a device from within your lan, it doesn't have to pass your modem, so a NAT rule is not necessary. Also, remembering your mac adress is history

    I also tried this with an available php webserver, php-thttpd, but thttpd is more secure. Because of security, thttpd won't start ether-wake with root permissions, and it will end with a "Cannot create raw socket" error. I tried to su ether-wake, but that was no improvement.

    Of course, if there's no external disk, or you don't have an /opt/ mountpoint, you can place your files anywhere.
    Remember to
    Code:
    flashfs save && flashfs commit && flashfs enable
    If you place files on internal storage.
    Last edited by mistraller; 24-08-2007 at 23:04.

Similar Threads

  1. Only lan being accessed, not internet!
    By RazielX in forum WL-500g Q&A
    Replies: 0
    Last Post: 07-04-2007, 03:04
  2. Wake on Lan from WL-HDD
    By DJans in forum WL-HDD Q&A
    Replies: 1
    Last Post: 08-03-2007, 20:27
  3. PC nur für´s Internet freigeben nicht für LAN
    By eufel in forum German Discussion - Deutsch (DE)
    Replies: 5
    Last Post: 21-07-2006, 08:41

Posting Permissions

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