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

Re: iptables DNAT

On Tuesday 03 September 2002 13:59, Nicos Gollan wrote:
> On Tuesday 03 September 2002 09:14, sébastien wrote:
> > I 'have a linux woody install with a 2.4 kernel.
> > All necessary modules for iptables  are compiled.
> >
> > but i can't make port redirect to another machine on my lan(for the
> > web server), i can just redirect on the local machine.
> >
> > can you help me
> Perhaps if you tell us a little more about your problem. What error
> messages do you get? Are you using a stock debian kernel?

yeah, supplying some more info can come in handy while posting to this (or any 
other) mailing list.

anyway, the right way to do it is :

iptables -t nat -A PREROUTING -p tcp --dport 222 -i eth0 -j DNAT --to

this rule will forward all incoming traffic to port 222 (on eth0, change if 
these are not your settings), to host, port 22. this is what i 
use for login with ssh into one of my internal servers from the outside.

you can look at the current settings (before and after applying the new 
rule)of iptables :
iptables -L -t nat --line-number

this will show you all settings that are currently commited to NAT .


> --
> Embedded Linux -- True multitasking!

Reply to: