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

FTP server behind firewall

Using v4 and having a bit of trouble.  I can make an ftp server run on the standard port 21.  However, I cannot make my ftp server (behind astaro fw) accept connections on a high, non-standard port, say, port 10500.  I never even attempted to use the built in ftp service, as im sure its ip-conntrack is using port 21.  

Has anyone else done this?  No, the snat guidebook does not help me in this situation.

Thank you.


This thread was automatically locked due to age.
Parents
  • Hi hondaman

    You have to change the ports in the firewall_on.sh script.
    You have explicit to say, that ASL should use these ports.
    Please try this Howto, I changed it at home and it works fine.

    Howto
    ------
    change default Port for ftp

     * if you want change the default port for ftp - nat-rules and packet filter-rules, do following:

     1. login on ASL
     2. su -
     3. joe /usr/local/fw/firewall_on.sh
     4. change following lines

         $IN ip_conntrack_ftp ports=new_port,new_port      
         
         $IN ip_nat_ftp ports=new_port,new_port

     5. reboot and test

    After that you have to create the NAT-Rules.

    /ronnerich  [;)]
Reply
  • Hi hondaman

    You have to change the ports in the firewall_on.sh script.
    You have explicit to say, that ASL should use these ports.
    Please try this Howto, I changed it at home and it works fine.

    Howto
    ------
    change default Port for ftp

     * if you want change the default port for ftp - nat-rules and packet filter-rules, do following:

     1. login on ASL
     2. su -
     3. joe /usr/local/fw/firewall_on.sh
     4. change following lines

         $IN ip_conntrack_ftp ports=new_port,new_port      
         
         $IN ip_nat_ftp ports=new_port,new_port

     5. reboot and test

    After that you have to create the NAT-Rules.

    /ronnerich  [;)]
Children
  • I have an FTP server running on the standard port 21. I'm DNATing port 21 to my ftp server. I'm also DNATing the FTP servers assigned PASV port range to the server as well. Are you saying that the additional DNATing of the PASV port range is not necessary?
  • The changes to  $IN ip_conntrack_ftp ports=new_port,new_port and  $IN ip_nat_ftp ports=new_port,new_port effect ACTIVE FTP transfers. If you want PASSIVE transfers to work you need to forward the range of passive ports that you have set using DNAT.
    Just define a range of ports under Definitions>Services  say from 34500:34509 then DNAT that range of ports to the FTP server along with the port you connect on. Don't forget to set up Packet filter rules to allow all of these connections. It works for my FTP server so it should work for you. One problem you might run into is the FTP server using its internal IP address to reply to requests from the outside. You might have to set up SNAT to change the internal IP address back to the external IP address. I run Serv-U for my FTP server which has an option that lets it reply with the external IP address so I do not run into this problem. What are you using for your FTP server?

    Dan
  • Hi!

    In v5 you can set an option called "Log FTP Data Connections".
    Does anyone know, wehere that logfile is stored??

    Thanx, TH
  • it is logged in the packetfilter.log with a special prefix FTP_DATA i think.

    regards
    Gert