All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krunk <krunkalot@hotpop.com>
To: netfilter@lists.netfilter.org
Subject: Re: passive ftp
Date: Sat, 17 Apr 2004 13:12:04 -0500	[thread overview]
Message-ID: <1082225524.4221.9.camel@james> (raw)
In-Reply-To: <web-287943006@mail01.infosat.net>

This did it for me:
IPT=/usr/sbin/iptables
EXTIF=ppp0 # interface facing outward
EXTIP=xxx.xxx.xxx.xxx
INTIF=eth1
INTNET=<ip assigned to eth1>
TCP="ftp ftp-data"
for i in $TCP
do
$IPT -A OUTPUT -o $EXTIF -p tcp -s $EXTIP --dport $i --syn -m state --state NEW -j ACCEPT
$IPT -A FORWARD -i $INTIF -p tcp -s $INTNET --dport $i --syn -m state --state NEW -j ACCEPT
done

You can put any number of services defined in /etc/services in the TCP
list and free them up with the loop. 

On Sat, 2004-04-17 at 12:50, IT Clown wrote:
> Hi 
> 
> I am having some trouble to access passive mode ftp sites.I
> have a firewall with ip forwarding enabled.When a pc on the
> network want to access passive ftp servers i need to do the
> following in my rules ( on the server ):
> 
> -A OUTPUT -p tcp -m multiport --dport 21,20 -j ACCEPT
> -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
> -A FORWARD -i eth0 -j ACCEPT
> -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
> 
> But i do not want every query to be forwarded i only want
> say ftp access to be forwarded. Why does the following not
> work ( on the server ):
> 
> -A FORWARD -p tcp -i eth0 -o ppp0 --dport 20 -j ACCEPT
> -A FORWARD -p tcp -i eth0 -o ppp0 --dport 21 -j ACCEPT
> -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
> Regards
> ______________________________________________________________
> Herbalife Independent Distributor http://www.healthiest.co.za




  parent reply	other threads:[~2004-04-17 18:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-17 17:50 passive ftp IT Clown
2004-04-17 18:03 ` Is there a more active mailing list for security? Krunk
2004-04-17 19:13   ` Mark E. Donaldson
2004-04-17 18:12 ` Krunk [this message]
2004-04-17 18:18 ` passive ftp IT Clown
2004-04-17 19:06 ` Mark E. Donaldson
2004-04-18 16:24   ` NAT FTP module problem GoMi
  -- strict thread matches above, loose matches on Subject: below --
2003-02-11 16:43 passive ftp Luis Miguel Cruz Miranda
2003-02-12 10:05 ` Cedric Blancher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1082225524.4221.9.camel@james \
    --to=krunkalot@hotpop.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.