2 FTP servers for the same FIXED IP and the same

Fabien GAILLET -  
brupala Posted messages 111127 Registration date   Status Member Last intervention   -
Hello, I have an ADSL connection with a fixed IP. I need to upload data from two different servers on my network. I installed SERV-U on both servers. On one server I use port 21 and on the other port 22. I then configured the necessary NAT on my Zywall 10 router. For my server on port 21, no problem, it is reachable from inside and outside; however, for the other one which is on port 22, my FTP client can only reach it from within the internal network. From outside, it connects but it’s impossible to see the server files... Does anyone have a solution?

13 answers

  1. bossdeclenord Posted messages 32 Status Member 8
     
    This post is getting old!!! 8 years already...

    Finally, I installed 2 FTP servers on the same public IP and it didn’t work right away. So I ended up here and since I found a solution I’m sharing it here.

    Livebox ---> port 21 to PC1 IP
    ---> ports 2020 and 2121 to PC2 IP

    FileZilla on PC1 with default settings

    FileZilla on PC2: listening port: 2020
    Passive mode setting: PC2’s passive IP and "Use custom port range" = 2020 - 2121

    Now, all that’s left is to configure the client:

    - FTP server PC1: default
    - FTP server PC2: port 2020

    And there you go, it works ;)
    5
    1. brupala Posted messages 111127 Registration date   Status Member Last intervention   14 437
       
      Hi,
      you could have set a larger range for the data ports of PC2: you only have one at 2121, which limits to a single transfer at a time.
      you could have set the range 2121 to 2130, for example, and forward 2120 to 2130 to PC2.
      0
  2. kalamit
     
    Hi,

    Actually, an FTP server doesn't use just one port but two. One for commands, the other for data. When you issue a dir command, the Opening blabla goes through the command channel and the list of files itself goes through the data channel. You only redirected a single port.

    Try transferring files in passive mode, then in active mode.

    Kalamit,
    Da** it! Use your mind!
    0
  3. Fabien GAILLET
     
    First of all, thank you very much for your help!
    I know that FTP uses 2 ports. The default ports are 21 for the connection and 20 for listing and transfers. So for the first server everything is fine. For the second, I use port 11222 (random) for the connection and port 11223 for the rest. The problem is that for my FTP client (FTP Expert), I can specify the connection port but where can I specify the port for listing and transfers?
    0
  4. kalamit
     
    Well you can't! That's why I asked you to do it in passive and active.

    During the one, I don't remember which (shame on me), the client offers the port on which the server must connect and thus plays the role of the server. (A nightmare for firewalls...)

    This has already been discussed in the forum, but I can't seem to find the thread...

    Kalamit,
    Da** it! Use your mind!
    0
  5. Fabien GAILLET
     
    OK, so I can forget the Windows FTP client...
    Can you tell me a little more about active and passive modes, I'm a bit stuck...
    What is the DOS command to specify a specific port? I tried PASV with IP + port but it doesn't work...
    0
  6. kalamit
     
    In the command line, you have to precede it with "QUOTE". But I’m not sure it works. Try with FTPexpert, it should be possible to switch to passive/active. Under DOS, it doesn’t seem so.

    Kalamit,
    Da** it! Use your mind!
    0
    1. Fabien GAILLET
       
      Is it possible to find a solution so that my router opens port 20 for my 2 FTP servers?
      0
  7. kalamit
     
    In two words: no!
    But in two words more: yes!

    Passive mode:
    The client connects a first socket on port 21. The server accepts it and waits for a command. The client sends the text PASV on this channel, the server receives it and responds Entering Passive Mode (X,X,X,X,11,134). The client sends the LIST command to the server on port 21 which returns an open response. The client creates a second socket on port 11*255 + 134 or 2939. Then the client will listen on this port. It therefore becomes a server in turn.

    For active mode, no problem, it’s the same, except that the PASV command is not sent. Same principle on the command port except that the client no longer listens but receives the data directly on port 20. No port calculation, it goes faster.

    Kalamit,
    Da** it! Use your mind!
    0
    1. Fabien GAILLET
       
      So if I understand correctly, passive mode uses only port 21 whereas active mode uses ports 20 and 21.
      Thank you for all these details ... but none of that gives me the answer to my problem ... I tried staying in active mode in FTP EXPERT but it yields nothing ...
      Would I need a second router? (also another FIXED IP?)
      0
    2. kalamit
       
      No, passive mode uses the server's port 21 and a randomly chosen port on the client.

      Kalamit,
      Da** it! Use your mind!
      0
    3. Fabien GAILLET > kalamit
       
      And what should I do then to make it work? Do I need another router, another fixed IP?
      0
    4. kalamit > kalamit
       
      Honestly, I don’t know… I had this problem too, I gave up and took a second IP… :(

      Kalamit,
      Da** it! Use your mind!
      0
    5. Fabien GAILLET > kalamit
       
      ok, thanks again for your help!
      I just called Wanadoo to get a second fixed IP but they don’t do that! I have to take a second Netissimo 2 subscription with them to get another FIXED IP!
      Do you have any tip?
      Because I’m in a small SME that doesn’t have an unlimited IT budget …
      0
  8. Fabien GAILLET
     
    I’m going to look into it... thanks again for everything!
    While I have you here, you know about setting up a DNS server, and thanks to that, instead of typing the FIXED IP address on my FTP client, I could type its name + my domain name...
    0
  9. kalamit
     
    Yes, that's one of the solutions I had studied to avoid taking two fixed IP addresses. I didn't have the courage to go all the way. But it's surely a very good method.

    Kalamit,
    Da** it! Use your mind!
    0
  10. kalamit
     
    I would even say that this is THE method!
    At Oleane, they offer DNS hosting, so I didn’t have to go to the trouble of setting one up myself. Maybe I should have... :)

    Kalamit,
    Da** it! Use your mind!
    0
    1. Fabien GAILLET
       
      Are you sure that if I set up my DNS server, by not typing the fixed IP but the name of my server, I will no longer have problems with my ports?
      0
  11. brupala Posted messages 111127 Registration date   Status Member Last intervention   14 437
     
    guys,
    to return to tcp,
    in active mode (normal) it’s the server that establishes the tcp data connection (port 20 by default unless modified by the client’s port command, which is the case most often today).
    in passive mode, it’s the client that establishes the tcp data connection on the port specified by the server in the passv command.

    it doesn’t change much, except that the NAT router must interpret these commands to open and map the ports according to them (passv or port).
    in any case, we can do this on a single IP address.

    and ... Voili  Voilou  Voila !
    0
    1. kalamit
       
      Hi Brupala,
      1st question, how is the port to be specified in the PORT command calculated? Is it random?

      2nd question, mapping ports according to all that, is that done on any router or routing device? For me, for example, the router forwards everything to the firewall, so I would need to find how to map the ports "dynamically" so to speak?
      Thanks!

      Kalamit,
      No place for us...
      0
  12. Fabien GAILLET
     
    How do we, for example, change port 20 in FTP Expert 3?
    0