Solved Client expects port 21, but FTP-servers have same IP address

March 19, 2013 at 01:14:41
Specs: Windows XP
My setup is as follows: as a part of a global network, I have two separate measurement stations collecting data in the field. They are working with some kind of embedded linux system and is running an FTP-server so that I can download collected data. I have some control over the stations, which e.g. means that I can select the port used for the FTP-server (default is 21).

Unfortunately, for this particular set of measurement stations, they are connecting via FTP-over-radio-link to another station which is connected to my computer via a router (on the server-side) and I can only "see" their common external IP address. If I have understood this correctly, they can not use the same port for FTP traffic, right? The router used is some (for me) unknown brand with unknown capabilities, so I don't expect/want a solution at that end.

Now, to my problem: as a part of this global network there is a custom software running on my computer that automatically connects to all the different stations to download and process the data. This software runs on any recent version of Windows, but I'm running Windows XP right now. There is no way for me to modify this software at this point (for the future, maybe, but not now), and unfortunately it has a severe limitation: it MUST use port 21 for FTP-connections.

So, how do I solve this?


My first attempt was to set the FTP-port to 2121 for one of the servers and create another IP address on my client network adapter and try to forward port 21 of this new IP to port 2121 on the server/router side, but due to lack of knowledge and experience I did not manage to get this working fully. Is this a reasonable approach and how could I do this "the right/best/simplest way"?

Any other suggested solutions?

Thanks in advance!


See More: Client expects port 21, but FTP-servers have same IP address

Report •

✔ Best Answer
March 19, 2013 at 08:34:24
Your software issue is a case of shortsightedness on the part of the programmers. If it were me, I'd contact them and get them to fix that problem with it only using port 21 and then issue you the update.

Alternatively, if you know your way around Linux/UNIX and you're a good programmer (I'm not) you could write a script that would download and process the data for you. Or if nothing else, write a script that downloads the files to another (perhaps internal) ftp server you could leave on port 21 and then point this rather limited software at to then in turn download/process the data for you.

It matters not how straight the gate,
How charged with punishments the scroll,
I am the master of my fate;
I am the captain of my soul.

***William Henley***



#1
March 19, 2013 at 06:45:47
According to a post in another forum, try port 990. That's on the server side. Nothing has to be done on the client side.


How do you know when a politician is lying? His mouth is moving.


Report •

#2
March 19, 2013 at 07:09:31
Thanks for your answer, guapo, but my problem is (like you say) that both FTP servers share the same external IP address, since they are behind the same router. If I understand this correctly two separate servers can not share the same destination port at the same destination IP, right?

I have 2 servers sharing the same IP address. I will have to run one server at a different port (say 2121), but my software does not support connecting to a different port than 21.


I will try to clarify this better in my question.


EDIT: It seemed like you changed your answer. But the above still holds. Anyway, will try port 990.


Report •

#3
March 19, 2013 at 07:23:07
I changed my answer because I misread the question the first time. Then I seached google for: two ftp servers same IP. That's where I found the 990

How do you know when a politician is lying? His mouth is moving.


Report •

Related Solutions

#4
March 19, 2013 at 07:29:34
I have 2 servers sharing the same IP address.

No you don't. They share the same gateway i.e., your border router.

You need to do 2 things. 1) configure the ftp service on one of the servers to use a port other than 21, lets say port 2121. 2) you need to configure port forwarding on your router to direct inbound port 21 traffic to one server and inbound port 2121 traffic to the other server.


Report •

#5
March 19, 2013 at 07:57:19
Thank you for the clarification, FishMonger! When you're new to a field you don't always pick up the correct terminology.

As for your suggested solution, it unfortunately won't work (correct me if I'm wrong) because even if I configure the FTP service to port 2121 on one of the servers and configure port forwarding in the router it won't fix the fact that my client software is unable to connect to FTP servers on any other port except port 21. It is this severe limitation of the client software that has put me in this position in the first place.


Report •

#6
March 19, 2013 at 08:26:39
What brand and model of router do you have and how much control do you have over its config?

Do you have a registered dns name for the network?

Can your ftp app point to dns names, or only IP addresses?

Does your router support forwarding (routing) by hostname?

Depending on the answers to those questions, you could configure one of the ftp clients to connect to server1.mydomain.com and the other to server2.mydomain.com and let the router determine how to route the traffic to each server.

Doing that allows both clients to use port 21 and you won't need to worry about setting up additional ports.


Report •

#7
March 19, 2013 at 08:34:24
✔ Best Answer
Your software issue is a case of shortsightedness on the part of the programmers. If it were me, I'd contact them and get them to fix that problem with it only using port 21 and then issue you the update.

Alternatively, if you know your way around Linux/UNIX and you're a good programmer (I'm not) you could write a script that would download and process the data for you. Or if nothing else, write a script that downloads the files to another (perhaps internal) ftp server you could leave on port 21 and then point this rather limited software at to then in turn download/process the data for you.

It matters not how straight the gate,
How charged with punishments the scroll,
I am the master of my fate;
I am the captain of my soul.

***William Henley***


Report •

#8
March 19, 2013 at 09:18:00
Thank you for your input, Curt R! I think I might just have decided for a solution to the problem, or rather, decided to go with my second idea to a workaround: to write a separate script to do the data transfer. The client software is able to work with manually downloaded files, but the automatic part of the data evaluation will be lost. But a little bit of manual work to start the evaluation is definately better than having absolutely no data at all to work with, so I think it will have to be the go-to solution in this case.

I might even use your suggested idea of writing the script so that it downloads the files to a local FTP server that my software can connect to. This way, it will be sort-of automatic anyway.


Thank you, everybody, for your input. After discussing this with a couple of colleagues, I think this problem should be considered as "solved".


As for the issue with the obvious shortsightedness of the programmer, we have known about this for a while and asked for a fix that should be on its way, at some point. However, he seems to be very busy and I fear it may take quite some time (read: quite a few months or more) before a fix will be released.


Report •

#9
March 19, 2013 at 12:23:54
I might even use your suggested idea of writing the script so that it downloads the files to a local FTP server that my software can connect to. This way, it will be sort-of automatic anyway.

Once working correctly you would setup the script as a cronjob which would make it run automatically. You would want to have the ftp server running on the same Linux/UNIX box, as the script and set it up so the files are automatically put in the correct folder.

If you have the ftp software set to retrieve files at say, 7 am every Mon-Fri from your ftp server, you would then set the cronjob to run before that. Say, 3 am every Mon-Fri.

Once done, it would all be fully automated.

Hopefully the programmer will have the fix done on the software real soon for you!

It matters not how straight the gate,
How charged with punishments the scroll,
I am the master of my fate;
I am the captain of my soul.

***William Henley***


Report •

Ask Question