DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-05-01 13:41:41

Slangaren
Member
Registered: 2008-03-18
Posts: 7

Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

I have been tying to get WOL to work from Internet (WOW).

I have a DLink DIR-655 router and it seams like it doesn't support Static ARP only Static DHCP.
WOL is working fine on the LAN.

I was then thinking if there is any script for my DNS-323 (which is allways on) that can send a magic packet to the broadcast IP or a MAC adress if triggered in some way?

The DNS is on a fixed IP.

Offline

 

#2 2008-05-01 15:16:04

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

WOL doesn't work from the internet because the router mostly likely does not support ip directed broadcast (or it is not enabled) - ip directed broadcast is usually not offered on consumer routers since it allows them to be used as an attack vector for denial of service attacks.

Offline

 

#3 2008-05-01 16:37:32

bzhou
Member
Registered: 2008-02-15
Posts: 171

Re: Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

If you just want to wake machine on the same LAN of DNS-323, see http://www.nslu2-linux.org/wiki/HowTo/WakeOnLAN
You can either get it from optware ipk (http://www.nslu2-linux.org/wiki/Optware/Dns323), build and install some of these mentioned package with funplug, or manually.

Offline

 

#4 2008-05-01 20:37:29

Slangaren
Member
Registered: 2008-03-18
Posts: 7

Re: Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

bzhou wrote:

If you just want to wake machine on the same LAN of DNS-323, see http://www.nslu2-linux.org/wiki/HowTo/WakeOnLAN
You can either get it from optware ipk (http://www.nslu2-linux.org/wiki/Optware/Dns323), build and install some of these mentioned package with funplug, or manually.

You are correct. I would like to install the WOL script/app on the DNS-323 and wake a Win PC on the same LAN.
As I have never worked with Linux, I wonder if there is any existing funplug o similar with this already included or if there is any documentetion on How To..

I did install the recommended funplug for the fanscript but that is all I have done so far..

Thanks

Offline

 

#5 2008-05-01 23:19:07

sjmac
Member
Registered: 2008-01-21
Posts: 222

Re: Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

Slangaren wrote:

I did install the recommended funplug for the fanscript but that is all I have done so far..

Well one way to get that script is to follow the instructions at http://www.nslu2-linux.org/wiki/Optware/Dns323, and then type
ipkg install perl-wakeonlan
then you will get Perl and the perl-wakeonlan script installed in to /opt/bin/.

You can run it like
/opt/bin/wakeonlan

Usage
    wakeonlan [-h] [-v] [-i IP_address] [-p port] [-f file] [[hardware_address]
...]

Options
    -h
        this information
    -v
        displays the script version
    -i ip_address
        set the destination IP address
        default: 255.255.255.255 (the limited broadcast address)
    -p port
        set the destination port
        default: 9 (the discard port)
    -f file
        uses file as a source of hardware addresses

Offline

 

#6 2008-05-02 05:34:21

bzhou
Member
Registered: 2008-02-15
Posts: 171

Re: Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

If you want to get fancy, once you get the command line script working, you can install a small web server, invoke the script from a CGI script.
You can even add security, then forward port so you can invoke it from the internet.
See http://www.nslu2-linux.org/wiki/Optware/Haserl for example.
There might also be PHP version of wake-on-lan script available.

Last edited by bzhou (2008-05-06 19:15:18)

Offline

 

#7 2008-05-02 21:15:16

Slangaren
Member
Registered: 2008-03-18
Posts: 7

Re: Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

I think I made the installation work..

Last edited by Slangaren (2008-05-02 21:33:24)

Offline

 

#8 2008-05-02 21:47:12

sjmac
Member
Registered: 2008-01-21
Posts: 222

Re: Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

OK, from your output I see where you went wrong ... great idea to post it like that :-)

You need to edit the file /opt/etc/ipkg.conf and add a new line in to it that contains

Code:

src dns323 http://ipkg.nslu2-linux.org/feeds/optware/dns323/cross/unstable/

Close any telnet session that you have open to the DNS323.

I'll assume you'd prefer to edit config files from Windows, which is fine, but remember that text file formats are slightly different on Linux, so you need a Linux/Unix aware editor. I just did a quick Google, and this seems to do the job:
http://www.editpadpro.com/editpadlite.html

Install that, and then use it to edit the ipkg file on your DNS323, which you should be able to see at
\\yourDns323Name\Volume_1\ipkg\opt\etc\ipkg.conf

Make sure that there is only one line in that file that starts "src", and it should say

Code:

src dns323 http://ipkg.nslu2-linux.org/feeds/optware/dns323/cross/unstable/

Save that file, and then open up your fun_plug file: \\yourDns323Name\Volume_1\fun_plug

I think you said that you have fonz' fun_plug package version 0.4 (same as me), so try adding these lines near the top after the line that says "date >>${LOGFILE}":

Code:

echo "*Mount /opt for ipkg applications" >>${LOGFILE}
mkdir -p /opt
mount --bind /mnt/HD_a2/ipkg/opt /opt
export PATH=/opt/bin:/opt/sbin:$PATH

Save that file, and then telnet to the DNS323 and type
ipkg update

and then type
ipkg install perl-wakeonlan

Last edited by sjmac (2008-05-02 21:50:03)

Offline

 

#9 2008-05-02 21:56:44

Slangaren
Member
Registered: 2008-03-18
Posts: 7

Re: Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

Thanks,

I saw the page:
http://dns323.kood.org/howto:optware
And followed that..

Which worked!!

And the wakeup is also working now on the LAN..

Some new questions..

I heared that Telnet has no security, should I awoid it from outside? Or is the DNS supporting secured telnet? (SSL??) Explain what I should do..

How do I manage login?
I gess that I will do port forward in the router on port 23 to the NAS.
Are only logins used on the DNS allowed to Telnet in or is it completely open?

Many thanks again..

Offline

 

#10 2008-05-02 22:48:27

sjmac
Member
Registered: 2008-01-21
Posts: 222

Re: Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

OK, I suggest that you still make the changes that I suggested to your fun_plug, otherwise you won't have access to your wakeonlan after you reboot.

Regarding telnet/ssh login, that's a whole other topic.

If you are using fonz fun_plug version 0.4 then I suggest you look at enabling ssh login using dropbear (the openssh from optware is going to need a little tweaking to work with the DNS323 I think ...)

Search this forum for telenet ssh dropbear path

Last edited by sjmac (2008-05-02 22:48:57)

Offline

 

#11 2008-05-02 23:05:42

Slangaren
Member
Registered: 2008-03-18
Posts: 7

Re: Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

sjmac wrote:

If you are using fonz fun_plug version 0.4 then I suggest you look at enabling ssh login using dropbear (the openssh from optware is going to need a little tweaking to work with the DNS323 I think ...)

I have installed
fonz_funplug_0.3_w_fan_control.rar.
Because I wanted to use the fan script.

If you suggest to use another, please do so and I will follow..

Last edited by Slangaren (2008-05-02 23:06:36)

Offline

 

#12 2008-05-04 18:56:15

Slangaren
Member
Registered: 2008-03-18
Posts: 7

Re: Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

I just want to thank for support..

My setup is now working with my DNS sending wake up packets from outside the FW. I am also using SSH with login for security.

As told before I am using "fonz_funplug_0.3_w_fan_control.rar".
I followed as above with the changes to the fun_plug as recommended above by sjmac (thanks).

I then used the guide:
http://techblog357.blogspot.com/2007/08 … using.html
to get ssh using PuTTY working with login..

Everything is working perfect..

Thanks again and hope this guide can help someone else..

Last edited by Slangaren (2008-05-04 18:56:41)

Offline

 

#13 2008-10-05 14:50:01

SilentException
Member
From: Island of Krk, Croatia
Registered: 2008-05-04
Posts: 148

Re: Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

for those using lighttpd and php i've made a small php page from which you can wake up your computers using dns-323

you need to change a few things before you can use it (like computer names and mac addresses)

i've protected my lighttpd with auth-digest and made it accessible from the outside. then i can access this page and wake up any computer i need to

have fun! smile

Code:

<?php
# Wake on LAN - (c) HotKey@spr.at, upgraded by Murzik
# Modified by Allan Barizo http://www.hackernotcracker.com
function WakeOnLan($addr, $mac, $socket_number) {
  $addr_byte = explode(':', $mac);
  $hw_addr = '';
  for ($a=0; $a<6; $a++)
    $hw_addr .= chr(hexdec($addr_byte[$a]));
  $msg = chr(255).chr(255).chr(255).chr(255).chr(255).chr(255);
  for ($a = 1; $a <= 16; $a++)
    $msg .= $hw_addr;
  $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
  if ($s == false) {
    echo "Error creating socket!\n";
    echo "Error code is '".socket_last_error($s)."' - " . socket_strerror(socket_last_error($s));
    return FALSE;
  }
  else {
    // setting a broadcast option to socket:
    $opt_ret = socket_set_option($s, 1, 6, TRUE);
    if($opt_ret <0) {
      echo "setsockopt() failed, error: " . strerror($opt_ret) . "\n";
      return FALSE;
    }
    if(socket_sendto($s, $msg, strlen($msg), 0, $addr, $socket_number)) {
      echo "Magic Packet sent successfully!";
      socket_close($s);
      return TRUE;
    }
    else {
      echo "Magic packet failed!";
      return FALSE;
    }
  }
}
?>

<TITLE>WOL</TITLE>
<script type="text/javascript" language="JavaScript">
<!--
function valid(menu) {
  if (menu.selectedIndex == 0) {
    //alert('Please, select the device!');
    return false;
  }
}

function process_choice(selection) {
  var ipaddr = document.getElementById('ipaddr');
  var mac = document.getElementById('mac');
  var port = document.getElementById('port');

  if (selection.selectedIndex == 0) {
    ipaddr.value = '';
    mac.value = '';
    port.value = '';
  }
  else if (selection.selectedIndex == 1) {
    ipaddr.value = '192.168.1.255';
    mac.value = '11:11:11:11:11:11';
    port.value = '9';
  }
  else if (selection.selectedIndex == 2) {
    ipaddr.value = '192.168.1.255';
    mac.value = '22:22:22:22:22:22';
    port.value = '9';
  }
  else if (selection.selectedIndex == 3) {
    ipaddr.value = '192.168.1.255';
    mac.value = '33:33:33:33:33:33';
    port.value = '9';
  }
  else if (selection.selectedIndex == 4) {
    ipaddr.value = '192.168.1.255';
    mac.value = '44:44:44:44:44:44';
    port.value = '9';
  }
}
//-->
</script>

<form action="wol.php" name="wol-form" onsubmit="return valid(this.device)">

<table border="0">
<tr>
<td>Device:</td>
<td>
  <select name="device" onchange="process_choice(this)" style="width: 150px;">
  <option value="null" selected>(please select:)</option>
  <option value="barton">barton</option>
  <option value="conroe-1">conroe-1</option>
  <option value="conroe-2">conroe-2</option>
  <option value="xps-m1530">xps-m1530</option>
  </select>
</td>
<td>
<input type="submit" value="Wake up!">
</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>IP address:</td>
<td>
  <input disabled type="text" name="ipaddr" style="width: 150px;" id="ipaddr"> <br>
</td>
</tr>
<tr>
<td>MAC address:</td>
<td>
  <input disabled type="text" name="mac" style="width: 150px;" id="mac"> <br>
</td>
</tr>
<tr>
<td>Port:</td>
<td>
  <input disabled type="text" name="port" style="width: 150px;" id="port"> <br>
</td>
</tr>
</table>
<p>
</form>

<?php

if (isset($_GET['device']))
  $device = $_GET['device'];
else
  $device = '';

$devices = array('barton', 'conroe-1', 'conroe-2', 'xps-m1530');
if (in_array($device, $devices)) {
  if ($device == 'barton') {
    $mac_addy = "11:11:11:11:11:11";
  }
  else if ($device == 'conroe-1') {
    $mac_addy = "22:22:22:22:22:22";
  }
  else if ($device == 'conroe-2') {
    $mac_addy = "33:33:33:33:33:33";
  }
  else if ($device == 'xps-m1530') {
    $mac_addy = "44:44:44:44:44:44";
  }
}
else {
  $mac_addy = "";
}

if (in_array($device, $devices) && ($mac_addy != '')) {
  $socket_number = "9";
  $ip_addy = gethostbyname("192.168.1.255");
  WakeOnLan($ip_addy, $mac_addy, $socket_number);
}

?>

D-Link DNS-323 v1.05 fun_plug-ed + many mods,  2 x 320GB Seagate Barracuda 7200.10 RAID0, Cat6 Gigabit Network, 9k Jumbo Frames, Average (WRITE): 19,32 MB/sec, Average (READ): 28,6 MB/sec

Offline

 

#14 2009-03-30 18:28:12

blbrown
Member
Registered: 2007-11-02
Posts: 88
Website

Re: Use the DNS-323 to Wake On LAN (WOL) another PC from the internet.

I thought I'd post a little update about this thread, since I recently looked into it.  It turns out that the version of busybox included in ffp (since version 0.3) already includes a command-line utility to send magic packets:

busybox ether-wake

So if you want to send a WOL packet to a computer from the DNS-323 with ffp 0.3, 0.4, or 0.5, simply type "ether-wake" from the command-line.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB