Forwarding ftp to internal network

Jeremy Fowler jfowler at westrope.com
Mon Nov 26 17:12:17 CST 2001


Well if your trying to forward packets from your firewall to a server inside
your LAN you need to add a Destination NAT (DNAT) rule to your firewall script.
Here is an example given that eth0 is the NIC connected to the internet (eth1
would then be connected to the LAN).

IPTABLES=/sbin/iptables
EXTERNAL=eth0
EXTERNAL_IP=<enter the firewall's IP address here>
FTP_PORT=21
FTP_SERVER=192.168.1.3

$IPTABLES -t nat -A PREROUTING -i $EXTERNAL -p TCP -d $EXTERNAL_IP     --dport $FTP_PORT -j DNAT 
--to-destination $FTP_SERVER

Hope that helps. -Jeremy

-----Original Message-----
From: Michael Pratt [mailto:mtpratt at swbell.net]
Sent: Wednesday, November 21, 2001 8:13 PM
To: kclug at kclug.org
Subject: Forwarding ftp to internal network

Hi all!

Can anyone help me out by telling me how to forward someone from ftp to an
internal pc 192.168.1.3 using iptables?

Thanks!
Happy Thanksgiving to you and your family!
Mike




More information about the Kclug mailing list