Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Frank Smith <fsmith@hoovers.com>
To: "Han, Yan" <hany@u.library.arizona.edu>, netfilter@lists.netfilter.org
Subject: Re: iptables ftp problems; unable to "ls"
Date: Wed, 05 Nov 2003 18:03:53 -0600	[thread overview]
Message-ID: <99330000.1068077032@hoovers-59.hoovers.com> (raw)
In-Reply-To: <BEA73FB6B8F62545A5B2818724D0DF2902E70864@u.library.Arizona.EDU>

--On Wednesday, November 05, 2003 16:40:05 -0700 "Han, Yan" <hany@u.library.arizona.edu> wrote:

> 
> We use a linux server as a firewall and forward packets to different
> servers. In this case, we applied the iptables to forward packets from $Fido
> to $AtlasFtp for FTP. It is ok that we can log in the ftp server, but unable
> to do other things such as "ls", neither does Windows GUI FTP.
> 
> Does anyone know why the FTP does not work? (we opened the port 20 and 21
> for FTP)? Is there something wrong with ports? 
> 
> 
>############    FTP   #########
>   iptables -t nat -A PREROUTING -i eth0 --dst $Fido -p tcp --dport $FTP_Port
> -j DNAT --to $AtlasFtp
>#    iptables -t nat -A PREROUTING -i eth0 --dst $Fido -p udp --dport
> $FTP_Port -j DNAT --to $AtlasFtp
> 
>     iptables -t nat -A POSTROUTING -p tcp --dst $AtlasFtp --dport $FTP_Port
> -j SNAT --to-source $Fido
>#    iptables -t nat -A POSTROUTING -p tcp --dst $AtlasFtp --dport $FTP_Port
> -j SNAT --to-source $Fido
> 
>     iptables -t nat -A OUTPUT --dst $Fido -p tcp --dport $FTP_Port -j DNAT
> --to-destination $AtlasFtp
>  #   iptables -t nat -A OUTPUT --dst $Fido -p udp --dport $FTP_Port -j DNAT
> --to-destination $AtlasFtp
> 
> 
> 
> Yan 

You need to add a state RELATED rule to allow the data connection
opened back to the client, or use passive mode FTP.

Frank


-- 
Frank Smith                                      fsmith@hoovers.com
Systems Administrator                           Voice: 512-374-4673
Hoover's Online                                   Fax: 512-374-4501



  reply	other threads:[~2003-11-06  0:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-05 23:40 iptables ftp problems; unable to "ls" Han, Yan
2003-11-06  0:03 ` Frank Smith [this message]
2003-11-06  0:06 ` Alistair Tonner
  -- strict thread matches above, loose matches on Subject: below --
2003-11-07 17:51 Han, Yan

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=99330000.1068077032@hoovers-59.hoovers.com \
    --to=fsmith@hoovers.com \
    --cc=hany@u.library.arizona.edu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox