impossible to forward port 8080 and 3389 with iptables (ubuntu)
Posted on 2008-06-25
I came accross a very (to me) wierd problem ..
somehow, it seem I'm unable to forward port 8080 and 3389, while most of the other ports (I didnt test everything) are working perfectly.
here is how my network look:
[network: 192.168.0.x] > [ubuntubox eth0: 192.168.0.11 eth1: 10.0.0.2] > [router 10.0.0.1]
the router has 10.0.0.2 as DMZ
so far, everything is ok, all computers behind the box have access to internet.
now, when I want to forward some port into my LAN, problems arise:
for exemple, I tried to forward the port 21 to 192.168.0.9, in doing as follow:
sudo iptables -A FORWARD -i eth1 -o eth0 -p tcp --dport 21 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A PREROUTING -t nat -p tcp -i eth1 --dport 21 -j DNAT --to-destination 192.168.0.9:21
no problem there. but when I'm trying the very same things, with port 8080, to any of my LAN, it wont work. at all. same goes for 3389.
there is no firewall on the server I'm trying to reach inside the lan, and no other service blocking the way.
it just wont connect.
I tried with port 21, 80, 5900, all of those were ok.
if it's any help, here is the extra package I installed on ubuntu: apache, bind, ntop, lynx.
and also, there was some wierd error while booting, something like: ACPI Invalid PBLK Length
but I don't think it's related.
thanks in advance!
edit: I can see however that the timeout on port 8080 and 3389 is longer when I did the forward, than when I remove the entry from iptables