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 2011-02-13 12:09:01

Thiam
Member
Registered: 2007-06-18
Posts: 43

Port forwarding within LAN

Is it possible to forward a TCP/IP port on the DNS-323 to another machine on the LAN?

My DNS runs squeezeboxserver, and I'm trying to get it to work with MusicIP Mixer using the SpiceFly plugin.
I've looked into running MusicIP Mixer on the DNS itself, but even if this would be possible, the linux version is a java application and Java SE for Embedded itself requires 32 MB of RAM.

So, I installed MusicIP Mixer on, my PC and pointed it to my music collection on the DNS.
Problem is, the SpiceFly plugin assumes MusicIP Mixer is running on the same machine as SBS. Only the IP port is configurable, not the host.

So maybe a solution would be to forward all traffic from port 10002 on the DNS to port 10002 on my PC.
That way, I can at least use SpiceFly when the PC is running.
Is this possible given there's no iptables on the DNS-323?

Offline

 

#2 2011-02-14 05:15:28

bound4h
Member
Registered: 2010-04-12
Posts: 209

Re: Port forwarding within LAN

What kind of router do you have?  You could try changing the routing table (not port forwarding)?  DLINK routers have this, so I'm sure others do.  May or may not work, but surely sounds like what you are trying to do.


EDIT: Actually, now that I think more about it.  This probably won't work.  Since all you can do is enter one port in SpiceFly config, your computer is doing nothing more than looking at a local port.  So my above suggestion probably wouldn't work since SpiceFly isn't inherently trying to send data OUT to the network via that port since it's using it's own IP as the host (as you said was unconfigurable).

Maybe someone has a workaround, but I think the key here is finding someway to change the host (other than the GUI config you're currently using).  Maybe SpiceFly reads from some config files?

Last edited by bound4h (2011-02-14 05:19:46)

Offline

 

#3 2011-02-14 14:47:06

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

Re: Port forwarding within LAN

The router plays no part in LAN~LAN communication, all such connection requests will be sent directly to the host and the router will never see them.

Offline

 

#4 2011-02-14 16:28:52

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Port forwarding within LAN

With use of socat this could be possible. Something like

Code:

socat TCP4-LISTEN:10002 TCP4:<your-pc-ip>:10002

Offline

 

#5 2011-02-14 20:42:19

rsd76
Member
Registered: 2010-04-18
Posts: 47

Re: Port forwarding within LAN

I was able to use a putty ssh connection to open a remote port (on the DNS-323) to a other remote port (router). I didn't have a local port to test correctly.
However for this to work you need to be logged on from your PC to your NAS.

You can change the setting of a running putty session.
Right click on the topbar. Select "Change settings". Connection->SSH->Tunnels. Select the 2 "Port Forward" options.
In the lowerpart enter:
Source port: 10002
Destination: 127.0.0.1:10002
Select Remote and probably IPv4.
Than click "Add"
In the view window the following should be visable: 4R10002 127.0.0.1:10002
Click apply.

Using "lsof" I can view that a port is opened for listining:
lsof -Pni tcp:10002
Output:
COMMAND  PID USER   FD   TYPE DEVICE SIZE NODE NAME
sshd    6010 root    7u  IPv4 128512       TCP 127.0.0.1:10002 (LISTEN)

So sshd is listening to port 10002.

This config can also be entered in the start screen of putty. Be sure to save your settings.
Everything Putty can with ssh port forwarding is also possible with the ssh command itself (-R option I think).


Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us. (Calvin & Hobbes)

Offline

 

#6 2011-02-15 12:52:26

Thiam
Member
Registered: 2007-06-18
Posts: 43

Re: Port forwarding within LAN

I've solved it be modifying the SugarCube perl code and HTML files.
I've never programmed perl (and never used vi as a source code editor), but the code is clear enough for a small change like this.
I'v added a 'sugarhost' entry to SugarCube's settings file and modified the source code to use this parameter instead of localhost. Guess what? It works, but only technically. When SugarCube request a new song to MIPMixer, this results in a huge MySQL query, in it's turn resulting in a nearly 40MB temporary sql file. This causes all playback to stop for about a minute.
So, for all practical purposes, this is unworkable.
Maybe SBS 7.6 with SQLite will not have this problem. Time to set up a test environment.

Offline

 

#7 2011-02-26 13:14:25

Kuaaap
New member
Registered: 2011-02-26
Posts: 1

Re: Port forwarding within LAN

Shame, was really hoping there was a way of running MusicIP on the Squeeze Server as a plugin on the D-Link DNS-323 without having a PC switched on. If anyone has managed this please let us know.

Offline

 

#8 2011-02-27 22:26:25

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Port forwarding within LAN

Have you tried running it under debian on the NAS?

Offline

 

#9 2011-03-01 23:07:32

Thiam
Member
Registered: 2007-06-18
Posts: 43

Re: Port forwarding within LAN

dhub wrote:

Have you tried running it under debian on the NAS?

No, but running it under debian on the NAS will not change a thing to the fact that the DNS only has 64MB of RAM and that Squeezecenter/MySQL is a memory hungry beast. If it's about keeping as much RAM as possible available for applications, I would think the very limited linux OS on the NAS itself would be better than a generic -altough heavily tweaked- linux distro.

Offline

 

#10 2011-03-02 00:00:31

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Port forwarding within LAN

Debian chroot isn't an either/or situation.  You can run the highly memory efficient services that came with the NAS for most stuff and only run single binaries in the chroot environment without starting all of the services debian likes to run.

For example, the following just starts the sabnzbdplus service, which is nothing more than a python script:
chroot /chroot/debian /etc/init.d/sabnzbdplus

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB