[Techtalk] Port forwarding with iptables?

Julie txjulie at austin.rr.com
Thu Sep 11 21:28:29 EST 2003


perimorph wrote:
> hi julie,
> 
> 
>>I've tried everything I know, and I still can't get iptables to
>>forward a port.  I want all packets to port 5907 on my cable
>>modem interface sent to port 5900 on a machine inside the house.
> 
> 
> i do it this way:
> 
> $IPTABLES -A FORWARD -i $EXTIF -o $INTIF -p tcp --dport 80 -m state
> --state NEW,ESTABLISHED,RELATED -j ACCEPT
> 
> $IPTABLES -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to
> 192.168.1.1:5000

Thanks.  I figured it out very shortly after sending the message.
All of the times I've used iptables in the past I've put -j on the
end.  Except that with the DNAT chain you have to say "-j DNAT"
followed by the "--to host:port".

Grrrrr.
-- 
Julianne Frances Haugh             Life is either a daring adventure
txjulie at austin.rr.com                  or nothing at all.
					    -- Helen Keller



More information about the Techtalk mailing list