This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Publish Ftp server passive mode

Hi,
I have published several internal FTP server through public external ip mapped on the WAN (external interface). For example:
194.1.1.2/29 is the ip of wan_eth1, 194.1.1.1 is the ip of the router, 194.1.1.3 and 194.1.1.4 are additional address (alias) published on wan_eth1. 
There is a DNAT rule to redirect FTP (21) from 194.1.1.3 to and internal ftp private server (for example 192.168.1.100).
I'm able to establish ftp connection to 194.1.1.3 via prompt of dos of a PC client (windows 7); I'm able to make action of put and get files. I can say that FTP - ACTIVE mode works correctly. 
If I try to use FIREFOX and write ftp://194.1.1.3 I'm able to arrive to insert username and password but after this action the connection is closed. DATA connection fails. Firefox uses ftp client connection in PASSIVE mode. With Internet Explorer you can decide to set ftp client connection either passive or active according to a flag. The pc where I attempt with firefox (in passive mode) the client connection to the ftp server protected by astaro is not protected by other firewall so my request arrive in passive mode to ASTARO GATEWAY. Is there a way, a proxy or something else, to enable publishing FTP server to permit PASSIVE MODE? Normally client and server negotiate the "data port" because they are dynamically elaborated....is there a mechanism of Astaro to intercept this negotiation and permit only the needed port?

Thank you for your help


This thread was automatically locked due to age.
  • Hi, ginger, and welcome to the User BB!

    On the 'Advanced' tab of 'Network Security >> Firewall', do you have the FTP helper selected?

    Cheers - Bob
  • Yes, connection tracking helpers is enabled for FTP, IRC, PPTP. I'm afraid this function works only for outbound traffic. But what happen for inbound traffic when dnat rule is applied and flag automatic rule is enabled?
    Keep in mind that rule of dnat is only defined for publishing port 21 and not any port towards internal private server. On the same public IP I would like to publish different services and redirect for each one to different internal server.
    Waiting for a suggestion, thank you.
  • You're right - that only helps internal users to access FTP servers via the Astaro.  I think you want the ideas in FTP over VPN, but you will need the additional DNAT since your clients aren't coming in over a VPN.

    Does that solve your issue?

    Cheers - Bob
  • For passive FTP to work behind DNAT, create individual port-ranges for PASV mode per server that you DNAT from ASG to the servers. Most 'better' FTP-Servers allow to define a port range for PASV mode.
  • With a Linux based FTP it is easy to set PASV up. I am using vsftpd and have a port range defined on which PASV traffic goes, this range is usable via a rule. 
    But my FTP server sits in a DMZ, not in the inner network. I do not like to go to sleep with a directly reachable machine in my network. FTP is not a really secure way to transfer data. I spend a lot of time to make the FTP server secure with virtual FTP users and so on and would not give that up for easy administration.
  • Hi,
    I was successfully be able to make ftp to work either in active and passive mode. There is the following configuration in my astaro ASG.
    I published the FTP service on several port:
    ip_publish_1 on 21 towards ip_private_1 to 21 (internal)
    ip_pubilsh_2 on 2121 towards ip_private_1 to 21 (internal) etc...
    This means that INTERNAL SERVER should be listen always on 21 port in order FTP HELPER can works either with ACTIVE and PASSIVE mode.
    IF you change the internal ftp port of the server from 21 to another port (and change the appropriate DNAT rule) the only mode that works is the ACTIVE mode.

    REgards, Marco.
  • Hi,
    I was successfully be able to make ftp to work either in active and passive mode. There is the following configuration in my astaro ASG.
    I published the FTP service on several port:
    ip_publish_1 on 21 towards ip_private_1 to 21 (internal)
    ip_pubilsh_2 on 2121 towards ip_private_1 to 21 (internal) etc...
    This means that INTERNAL SERVER should be listen always on 21 port in order FTP HELPER can works either with ACTIVE and PASSIVE mode.
    IF you change the internal ftp port of the server from 21 to another port (and change the appropriate DNAT rule) the only mode that works is the ACTIVE mode.

    REgards, Marco.


    Hi,

    can u tell us how u did it...

    i also have a ftp server hosted behind astaro v8.3.. 

    my problem is when i setup a dnat.. i can connect to the ftp server only thru active mode..

    how did you setup your to use passive and active mode..

    can u show some pics..


    greetzz...
  • Do you have a masq rule for the DMZ?

    Cheers - Bob
  • No.. i do not have masq rule for the dmz...

    my ftp server doesn't sit on dmz...

    ftp server is simple sit on the internal lan..
  • Hi, use filezilla server. Enable an ftp server on port 21. In the passive mode setting configuration of server don't specify passive port range; in the same setting don't specify the public ip, leave default mode enabled. If you publish the service on external ip on 21 or everything else port and forward it with dnat rule to private ip buy towards 21 port, then either passive and active will work. Use firefox or ie 9 or filezilla client (with right setting on client side) to test. It works in my case.