Strange port forwarding problem

Posted by rAyt on Server Fault See other posts from Server Fault or by rAyt
Published on 2010-04-02T14:26:28Z Indexed on 2010/04/02 14:33 UTC
Read the original article Hit count: 384

Filed under:
|
|

I've got a strange port forwarding problem.

The port forwarding to my internal webserver (10.0.0.10 on Port 80) works without a problem but the port forwarding to a windows server (10.0.0.15) on port 3389 doesn't work. The port 3389 is open.

Any ideas? thanks!

#!/bin/sh
IPTABLES="/sbin/iptables"

$IPTABLES --flush
$IPTABLES --table nat --flush
$IPTABLES --delete-chain
$IPTABLES --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
$IPTABLES -t nat -A PREROUTING -p tcp -i eth0 -d 188.40.XXX.XXX --dport 3389 -j DNAT --to 10.0.0.15:3389
$IPTABLES -t nat -A PREROUTING -p tcp -i eth0 -d 188.40.XXX.XXX --dport 80 -j DNAT --to 10.0.0.10:80
$IPTABLES -t nat -A PREROUTING -p tcp -i eth0 -d 188.40.XXX.XXX --dport 222 -j DNAT --to 10.0.0.10:22
$IPTABLES --append FORWARD --in-interface eth1 -j ACCEPT

© Server Fault or respective owner

Related posts about linux

Related posts about iptables