Port forwarding with iptables?

Amit Chakradeo amit-kplug at amc.homeip.net
Mon Jun 24 11:48:30 PDT 2002


On Mon, Jun 24, 2002 at 11:41:02AM -0700, Michael O'Keefe wrote:
> > iptables -t nat -A PREROUTING -i $INET_IFACE -p TCP --dport 80 -j DNAT --to $INTERNAL_IP_ADDRESS
> 
> shoudn't that be ${INTERNAL_IP_ADDRESS}:80
> 
> Or does DNAT preserve the port by default ?
> 

I think you need the port for --to-source & --to-destination flags. I found the
--to option on the web somewhere and it seems to work and is not in 
documentation. 

Amit



More information about the KPLUG-List mailing list