FTP Server Behind Router

Discussion in 'Server Operation' started by backscratcher, Jan 20, 2006.

  1. backscratcher

    backscratcher New Member

    I have set up Fedora Core 4 as a server (httpd, mysql and ftp). This server is behind a router. I have set port redirection on this router for ports 80, 20 and 21 to the server's local IP Address (192.168.1.100). I have subscribed to dyndns.com to resolve my dynamic ip to a fix named url. That works just fine.

    I don't have problems accessing the web pages on the server locally and from the internet.

    My problem is on FTP. I can do ftp from another machine in my local network by typing $ftp 192.168.1.100. However, I cannot do the same thing from the internet by typing $ftp <dyndns fix named url>:21.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats a common problem with FTP behind NAT as FTP tries to initiate a second connection on higher ports after initial connect. Have you tried both, passive and active FTP mode?
     
  3. ak007

    ak007 New Member

    same problem

    Guys Im having Same Problem 2 ive got two server behind router the first one is on standar port 21 and the second one is on non-standard por which is 7511 on second one when i connect i get errors when it enters PASV MODE ive also tried PORT but no hope any soloutions?
    im using debian 3.1 sarge and pureftpd

    Thanks,
    Ak007
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Have you tried active mode?
     
  5. themachine

    themachine New Member HowtoForge Supporter

    You are behind a firewall which means tht you need to enable Passive FTP properly.

    PROFTPD:

    Edit /etc/proftpd.conf or whatever your conf file is:

    PassivePorts 40000 40100


    VSFTPD:

    Edit /etc/vsftpd.conf or whatever your conf file is:

    pasv_enable=YES
    pasv_promiscuous=YES
    pasv_min_port=40000
    pasv_max_port=40100
    pasv_address=192.168.1.100


    Note that you are opening up ports 40000 -> 40100 for Passive connections... therefore you need to also open up these ports on your firewall. You will then have no problems (but you will need to enable passive ftp in your ftp cient.


    Does that work?
     
  6. ak007

    ak007 New Member

    Yes That Worked For Proftpd But I need To Know How To I Add users In Vsftpd And How Do I Change The Port In Pureftpd?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    FTP users in vsftpd are in most cases sytem users. Add a system user and try to login with that user.

    If pureftpd reads its configuration from a mySQL database, you will have to add the users accounts there.

    You may have a look at this howto too:
    http://www.howtoforge.com/pureftpd_mysql_virtual_hosting
     
  8. ak007

    ak007 New Member

    ive changed vsftpd Configuration But Its Not Working when i conenct to the server It Gives Me :
    ive alos opened ports for pasv Mode in my router But Not Working
    Here is my vsftpd.conf file
    after ive added last lines for pasv mode i get following errors wgen i start vsftpd
     
    Last edited: Jan 22, 2006
  9. themachine

    themachine New Member HowtoForge Supporter

    Yes.... that is interesting. I am assuming that since you're asking about "vsftpd" and "pureftpd" that you are running both on this machine, yes? Plus you are using an alternate port in your 'listen_port' option. That being said, is it possible that you could try stopping all other ftp servers and try restarting vsftpd again. It might be that the passive_address setting is binding to port 21 and overriding the 'listen_port' option.

    just a theory.
     
  10. HaydenHarnet

    HaydenHarnet New Member

    Last edited: Aug 5, 2010

Share This Page