Loading ...
Sorry, an error occurred while loading the content.

Re: [nslu2-general] Can I use NSLU2 to send WOL to local PC from internet?

Expand Messages
  • phinas
    One way that I did it was to install the php mod and run this script.
    Message 1 of 5 , Dec 13, 2007
    • 0 Attachment
      One way that I did it was to install the php mod and run this script.


      <?php

      function WakeOnLan($mac)
      {

      // Create Magic Packet

      for($i=0;$i<6;$i++)
      $packet .= chr(255);

      $mac_byte = explode(':', $mac);

      for($i=0;$i<6;$i++)
      $mac_addr .= chr(hexdec($mac_byte[$i]));

      for($i=0;$i<16;$i++)
      $packet .= $mac_addr;


      // Set to UDP broadcast

      $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
      socket_set_option($sock, SOL_SOCKET, SO_BROADCAST, TRUE);
      socket_sendto($sock, $packet, strlen($packet), 0, '255.255.255.255', 9);

      socket_close($sock);

      return;

      }


      WakeOnLan("00:00:B8:FF:AA:96");

      sleep(10);

      header( 'Location: http://my.orb.com' ) ;


      ?>






      pinyilde wrote:
      >
      > My router does not support or provide for sending Wake On LAN (WOL)
      > packets to a local PC from the Internet so I'm wondering about the
      > feasibility of remoting into an NSLU2 and getting it to send the WOL
      > packet. Any suggestions on how this could be done?
      >
      >
      >

      --
      View this message in context: http://www.nabble.com/Can-I-use-NSLU2-to-send-WOL-to-local-PC-from-internet--tp14309648p14329235.html
      Sent from the Nslu2 - General mailing list archive at Nabble.com.
    Your message has been successfully submitted and would be delivered to recipients shortly.