0

I have a Windows 7 machine connected to 2 subnets, with IP addresses 10.0.0.241 and 172.17.240.94.

On this machine runs a 3rd party java application that internally launches an FTP client session, connecting to a FTP server located in 172.17.240.65.

In some point the application tries to download a file, but then it shows a "connection reset" error (a proprietary application message).

Using a sniffer, I have found that the application issues a wrong FTP command: PORT 10,0,0,240,x,y (where x,y is any port number).

So the problem is self evident: The PORT command has chosen the wrong IP address out of the 2 available ones, and the FTP server tries to connect back to an address out of its network. The right command should be PORT 172,17,240,94,x,y.

On other machines with 2 IP's the application works fine (and PORT command looks fine too), on others not... it seems random.

I haven't access to the source code of the application.

I have tried to shuffle the IP's order in Windows network adapter configuration, with no success.

Is there a way to get the java engine choose the right IP address?

oscar
  • 103

1 Answers1

3

Obviously the java application does not determine the address for PORT based on the IP of the peer. It probably just takes the address the system reports first, whatever it is. Maybe this knowledge base article from MS helps you to change the order of IP http://support.microsoft.com/kb/171320 (its for older windows versions but might still apply). Your could also try to change the binding order How can I change the binding order of network adapters in Windows 7? or to physically change the interfaces.

But it might be even easier to change the java application to use FTP passive mode, where it does not need to know the IP of its own network.