Active FTP -> NAT Firewall?????

From: Winky (embree@speakeasy.net)
Date: 03/27/02


From: Winky <embree@speakeasy.net>
Date: Wed, 27 Mar 2002 08:37:29 -0500

I'm new to firewalls and iptables...
I can not communicate w/ ftp from behind my NAT Firewall to a remote
server that uses only active mode. Any attempt to ftp defaults to
passive and of course is not excepted on the other end. I'm running
Redhat 7.2 w/ Kernel 2.4.16 and iptables 1.2.6a below is my simplistic
iptables settings(remember this is new to me). The ip_nat_ftp and
ip_conntrack_ftp modules are both loaded.
        To my understanding Active ftp will hav the server initiate a tcp
connection on port 20 for the flow of data. How do I accept just this
connection and not any other unwanted connections.

-t filter -P INPUT ACCEPT
-t filter -P FORWARD REJECT
-t filter -P OUTPUT ACCEPT
-t filter -A INPUT -i eth0 -p tcp --syn --destination-port 22 -j ACCEPT
-t filter -A INPUT -i lo -j ACCEPT
-t filter -A INPUT -i eth1 -j ACCEPT
-t filter -A INPUT -p tcp --syn -j DROP
-t filter -A INPUT -p udp -j DROP
-t nat -A POSTROUTING -o eth0 -j MASQUERADE

I'd much appreciate any help, advice or corrections to false
understandings that anyone can supply me. Thanks.



Relevant Pages

  • Re: Iptables FTP question
    ... But only from iptables 1.2.8 on. ... you cannot filter more that this with iptables for FTP. ... >> you wont be able to use PASV without the state machine. ...
    (comp.security.firewalls)
  • Re: Questions on secure remote access to Fedora Core 2
    ... After most of a day of research on iptables, and a bunch of trial and ... Keep HTTP and HTTPS open for everybody ... Open inbound SSH, FTP, and mail for everybody ... ... users who for whatever reason can't use SFTP. ...
    (comp.os.linux.security)
  • Re: iptables udp and output
    ... Didn't your distro include iptables? ... to compile from source? ... the implied "-t filter". ... where you had to specify what you wanted to block. ...
    (comp.os.linux.security)
  • Re: Better iptables firewall
    ... Personally, lesser is your configuration, better is your security. ... iptables -t filter -F ...
    (Debian-User)
  • Re: FTP Problems RH 7.3 Iptables
    ... > New install of Red Hat 7.3. ... When I try to use Mozilla 1.0 to download a file from an FTP ... > iptables or an iptables rule problem. ... When I have a firewall problem I fire up Ethereal and use it with and then ...
    (comp.security.firewalls)

Quantcast