Results 1 to 3 of 3

Thread: [HOW-TO] Wake on Lan over the Internet (Wake on WAN)

  1. #1
    Join Date
    Jan 2007
    Beans
    209
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Wake on WAN via Hostnames

    Is there anyway to make the default wakeonlan program use hostnames instead of IP addresses? I couldn't find anything on the man pages but I swear I used to use it in such a way before 9.10.

  2. #2
    Join Date
    Jan 2007
    Beans
    209
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    [HOW-TO] Wake on Lan over the Internet (Wake on WAN)

    As far as I've managed to ascertain the two programs in the Ubuntu Repos that deal with wake on lan (wakeonlan and etherwake) don't have any ability to use hostnames rather than IP Addresses to wake over the internet; if you've got an external IP that often changes (as some ISPs provide) then you'll want to use a dynamic DNS service and a hostname.

    As such, I've written the following bash script:

    Code:
    #!/bin/bash
    SERVERIP=$(host HOSTNAME | grep -o -P "(:?\d+.?){4}")
    wakeonlan -i $SERVERIP HWADDRESS
    exit
    where HOSTNAME is your hostname and HWADDRESS is the MAC Address of the box you want to wake. You'll also need to forward port 9 on your router so that it will send the wakeonlan signal to the right place (this is the broadcast address for most routers but some may have another method if they don't allow you to forward to the broadcast address).

    Hope this is useful

  3. #3
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: [HOW-TO] Wake on Lan over the Internet (Wake on WAN)

    Please don't create multiple threads on the same subject. I have merged your two threads.

Tags for this Thread

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
  •