[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Trouble with port-forwarding



Hello,

I have a network with several web servers. All of them are on port 80
and I can't change this (these are embedded devices).

So, I would like to redirect port 81 of my external connexion (did I
mention I was behind a NAT, of course) to the port 80 of the first
server, the port 82 to the port 80 of the second wand....

Another problem is that the linux box is not the router. There is
already a router, and I can't change it, and it isn't able to do port
translation.

So I redirected the traffic from the outside on port 81,82, .... to my linux box, and:

I did:

iptables -t nat -A PREROUTING -p tcp --dport 81 -j DNAT --to-destination 192.168.1.10:80
...
..

But I would also like to be able to benefit from the redirect, being on my local linux box. 

I tried to add the same rule to the OUTPUT chain (as it is explained in
the netfilter howto), but:

if I try -A OUTPUT, iptables answers Invalid argument
if I try -I OUTPUT, ................ Target problem

I don't see where is the problem

Thanks for your help



-- 
Zorglub
Clément Stenac



Reply to: