ftp forwarding to inside lan

ftp forwarding to inside lan

Post by Mark Allar » Fri, 07 Apr 2000 04:00:00

I have sucessfully limited ftp traffic to my firewall to only one IP address
using the script below see # Incoming FTP. I would like to know what it will
take to do the samething, but hit a machine on the inside lan instead of the
firewall itself.

Thanks in advance.




# Flush the rules (start over)
$IPMASQ portfw -f


# Set the TCP timeout to 10 hours
$IPCHAINS -M -S 36000 0 0

# Masqurade for the 192.168.X.0/24 networks
$IPCHAINS -A forward -j MASQ -s -d
$IPCHAINS -A forward -j MASQ -s -d
$IPCHAINS -A forward -j MASQ -s -d
$IPCHAINS -A forward -j MASQ -s -d

# Specific Firewall rules here
# Incoming FTP

$IPCHAINS -A input -i eth0 -p tcp -s x.x.x.x/32 -d x.x.x.x 21 -j ACCEPT

$IPCHAINS -A output -i eth0 -p tcp ! -y -s x.x.x.x 21 -d -j ACCEPT

# *************** Transparent Proxy ******************
# Redirect all http port 80 requests to local squid proxy server
#   note that /etc/squid.conf needs tweaking from stock -
#   see http://www.unxsoft.com/transproxy.html
#     httpd_accel_host virtual
#     httpd_accel_port 80
#     httpd_accel_with_proxy on
#     httpd_accel_uses_host_header on

$IPCHAINS -A input -p TCP -d 80 -j ACCEPT
$IPCHAINS -A input -p TCP -d 80 -j ACCEPT
$IPCHAINS -A input -p TCP -d 0/0 80 -j REDIRECT 3128


1. FTP client inside linux firewall communicating with FTP server inside another linux firewall

I am trying to use an Windows FTP client (BPFTP) behind a linux
firewall computer running ipchains and ipmasqadm portfw to communicate
with an Windows FTP server (War, G6, ServU) behind another linux
firewall set up more or less the same way. The server is on port 21,
but I have port fowarding on the linux box that redirects port 27015
to port 21 on the internal FTP server. I also forwarded port 20 on the
external firewall to port 20 on the internal computer with the FTP
server. I can communicate with the FTP server from outside the
firewall from an un-firewalled computer, but not using PASV. From the
FTP client inside the linux firewalled LAN I can connect, but do
nothing else. I'm sure someone in this group is very familiar with
this issue and can help me.

Any help will be appreciated. Thanks.

2. wierd post Installation phenomenon

3. IP-Forwarding PPP-LAN but not LAN-LAN

4. Licence regime turns off buyers

5. Problem setting up ftp server inside lan (iptables)

6. Win95 telnet script language

7. Yet another pf question (FTP inside LAN)

8. scsi causes kernel panic - please help

9. forwarding ftp on LAN...problem: connection time out

10. Port forwarding, NAT and LAN-to-LAN connections

11. ftp problem LAN behind NAT/fierwall to LAN

12. how do i forward requests from inside of my firewall to an external proxy?

13. Iptables: How do I forwarding public IPs into a router inside a private IP network?