Redirecting port to external IP:port

Questions that don't fit in any category below may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.

Redirecting port to external IP:port

Postby wactuary » Fri Apr 01, 2011 5:29 am

I'm trying to get the squeezecenter package to work with MusicIP. MusicIP only runs on x86 so I can't move it to run locally (my preference). I have MusicIP running on a different machine within my LAN and it interfaces with port 10002. SqueezeCenter expects this to be on the same box. It appears iptables should be able to get the job done, and I've tried the following from within an ssh terminal:

Code: Select all
iptables -t nat -A PREROUTING -p tcp --dport 10002 -j DNAT --to-destination 192.168.1.40:10002


But I get the following result: iptables v1.4.2: Unknown arg `(null)'

I'm new to Synology (and manipulating iptables), but reasonably familiar with linux cli. Any advice on how to make this work? My goal is for calls to 192.168.1.141:10002 be redirected to 192.168.1.140:10002 (with the first IP being my diskstation and the second being the box with MusicIP running.
wactuary
I'm New!
I'm New!
 
Posts: 5
Joined: Fri Apr 01, 2011 4:28 am

Re: Redirecting port to external IP:port

Postby Ziggurat » Wed Sep 07, 2011 12:08 pm

+1 trying to use iptables for a redirect. I would like to forward port 443 to 1194 to get the openvpn server working via my employers firewall

Code: Select all
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 443 -j DNAT --to-destination 192.168.1.210:1194


Results in the same outcome:

iptables v1.4.2: Unknown arg `(null)'

Any help appreciated !
Ziggurat
Trainee
Trainee
 
Posts: 11
Joined: Thu Aug 04, 2011 2:22 am

Re: Redirecting port to external IP:port

Postby alexcat » Mon Nov 28, 2011 3:14 pm

The error is due to the lack of the DNAT module:

iptables -t nat -A PREROUTING -p tcp --dport 41180 -j DNAT
iptables v1.4.2: Couldn't load target `DNAT':/lib/iptables/libipt_DNAT.so: cannot open shared object file: No such file or directory

I've installed iptables from OpenWRT and copied the required library in /lib/iptables/ but is not compatible.
I think that using iptables from OpenWRT could resolve the problem
alexcat
Trainee
Trainee
 
Posts: 11
Joined: Thu Oct 15, 2009 2:40 pm

Re: Redirecting port to external IP:port

Postby alexcat » Mon Dec 19, 2011 4:48 pm

After the 3.2-1955 firmware release, it seems that NAT works well.

Here is a sample code for routing a connection incoming to Synology that has NAS_IP ip address and SOURCE_PORT to DEST_IP and DEST_PORT

Code: Select all
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p tcp --dport SOURCE_PORT -j DNAT --to DEST_IP:DEST_PORT
iptables -t nat -A POSTROUTING -p tcp -d DEST_IP --dport DEST_PORT -j SNAT --to NAS_IP
alexcat
Trainee
Trainee
 
Posts: 11
Joined: Thu Oct 15, 2009 2:40 pm

Re: Redirecting port to external IP:port

Postby lyster » Sun Apr 29, 2012 5:38 am

Did you guys get MusicIP to work? I have the exact same situation, and would love to get Spicedfly SugarCube and MusicIP to work, now that I've moved my flac files and server over to my DS212+....
lyster
Beginner
Beginner
 
Posts: 24
Joined: Wed Mar 28, 2012 2:49 am

Re: Redirecting port to external IP:port

Postby ErwinB » Wed Jul 18, 2012 11:49 am

There is a beta out of a spicefly sugarcube version with the ability to connect to an external musicip server. You can download the beta version from the spicefly forum (v4.28)
It works for me. I have lms on the nas and musicip on my normal pc.
ErwinB
I'm New!
I'm New!
 
Posts: 1
Joined: Wed Jul 18, 2012 11:43 am


Return to General Mods

Who is online

Users browsing this forum: No registered users and 2 guests