2 FTP servers for the same FIXED IP and the same
Fabien GAILLET
-
brupala Posted messages 111127 Registration date Status Member Last intervention -
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
-
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 ;) -
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! -
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? -
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! -
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... -
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! -
-
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!-
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?) -
-
-
-
-
-
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... -
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! -
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! -
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 !-
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...
-
-