[LUNI] Re: Port forwrading help?
Keith T. Garner
kgarner at kgarner.com
Sat Dec 23 16:28:58 CST 2006
David Gibbs wrote:
> David Gibbs wrote:
>> I found some references to using iptables to forward traffic ... but I
>> haven't been able to make it work. Parms mentioned in the document
>> aren't valid on my version of iptables.
>
> Ok, I got the iptables command to be accepted ... but it doesn't seem to
> have any effect.
>
> The iptables command I'm issuing is:
> iptables -t nat -A PREROUTING --dst x.x.x.28 -p tcp --dport 80 -j DNAT
> --to-destination x.x.x.28:5222
>
> If I telnet into port 5222 I get the correct result .. if I telnet into
> port 80 I get a connection refused.
Since you're the host, I think what you really want is REDIRECT, not DNAT.
I'm using REDIRECT to do something similar for a different service
This is off the top of my head, so check your iptables manual, but I think you
want something like this:
iptables -t nat -A PREROUTING --dst x.x.x.28 -p tcp --dport 80 -j REDIRECT
--to-ports 5222
Keith
--
Keith T. Garner kgarner at kgarner.com
"Make no little plans; they have no magic to
stir men's blood." - Daniel H. Burnham
More information about the luni
mailing list