Either you buy a router that is smart enough to handle this situation or do not use Pasv mode within the LAN. Or modify the FTP server component in a way that PasvIpAddr can be set privately for a particular client depending on it's source IP (just an idea?).
--- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Arnold FLUTEAUX wrote: > Ok, I understand that port 21 is an exception and the router replaces > automatically the private IP by the public IP. It's not the case for > others > ports. OK. > > And for these others cases, we must use PASVIPAdress in which, we set > public > IP. > > So now, suppose that I've a server behind a router with IP public is > 194.206.244.150 for example and IP private would be 192.2.1.3. I set > PASVIPAdress with 194.206.244.150 on port 1985 and I connect it on > from > outside lan. So it's OK. > > And now, if I want to connect it from inside LAN. So I connect it with > 192.2.1.3, always in passiv mode on 1985 port. But in this case, it's > not > good because the server response to PASV command the IP public > 194.206.244.150 and the client can't connect from inside to > 194.206.244.150. > > What can I do for this case ? > > Sorry it's difficult to explain that in English; I'm French ! > > > > Arnold > > > > Arno Garrels > <mailto:twsocket%40elists.org?Subject=%5Btwsocket%5D%20FTP%20Connection%20in > %20Passive%20mode&In-Reply-To=> arno.garrels at gmx.de > Tue Oct 24 13:53:43 UTC 2006 > > _____ > > Arnold FLUTEAUX wrote: >> Yes I understand that we can solve this with PasvIPAddr but I don't >> understand why we get public IP with port 21 and not with another >> port. It's curious and this is also the case with IIS FTP Server. >> Why must we set PasvIPAddr only when we want to have transfert on >> another port than 21 ? > > It's a router issue not a server problem. Your router replaces the > private by its public IP in the server response on port 21, > because this is the default FTP control port. Many cheap routers > don't even do that on port 21. > If the router would try to search and replace the IP string in FTP > data comming from any port it would slow down network speed notable. > Maybe it's possible to setup your router to do the same on a > different port as well? > > --- > Arno Garrels [TeamICS] > <http://www.overbyte.be/eng/overbyte/teamics.html> > http://www.overbyte.be/eng/overbyte/teamics.html > > >> Thanks >> >> >> >> Arno Garrels wrote: >> Sounds like the router exchanges the private IP by the public IP in >> the server response on port 21 only. Is the router configured to >> allow incomming connections to the passive ports (a range set at the >> FTP server)? >> >> If this doesn't help: >> >> TFtpServer has a property PasvIpAddr >> that should be assigned the public IP of the router. >> >> - You may try my StunCli component: >> A small STUN client component implementing rfc3489: >> < <http://www.duodata.de/misc/delphi/Ics5-StunCli-03.zip> >> http://www.duodata.de/misc/delphi/Ics5-StunCli-03.zip> >> <http://www.duodata.de/misc/delphi/Ics5-StunCli-03.zip> >> http://www.duodata.de/misc/delphi/Ics5-StunCli-03.zip Included is a >> small demo, it's not required to install the component, just unzip >> any file to the same directory and you are ready to go. >> >> - Or HTTP-GET a php page on a public webserver and parse the >> response: >> >> file getip.php: >> <?php >> echo $HTTP_SERVER_VARS[REMOTE_ADDR]; >> ?> >> >> --- >> Arno Garrels [TeamICS] >> < <http://www.overbyte.be/eng/overbyte/teamics.html> >> http://www.overbyte.be/eng/overbyte/teamics.html> >> <http://www.overbyte.be/eng/overbyte/teamics.html> >> http://www.overbyte.be/eng/overbyte/teamics.html >> >> >> Arnold FLUTEAUX wrote: >>> Hi, >>> >>> >>> >>> I want to connect in Passiv mode to a server with, for example, this >>> public address: 80.118.187.130. >>> >>> - If I connect to server on port 21, I receive after command "PASV", >>> this response >>> >>> 227 Entering Passive Mode (80.118.187.130,132,178). So we have the >>> good IP address and the client can connect it on well >>> >>> >>> >>> - If now, I connect to server on port 2125, I receive after command >>> "PASV", this response >>> >>> 227 Entering Passive Mode (192.168.2.150,132,178). So we haven't the >>> good address IP and so the client can't connect it well. >>> >>> >>> >>> Can anyone explain me why on port 21 the result is ok and on another >>> port, the client doesn't receive the good address. >>> >>> >>> >>> Thanks >>> >>> Arnold > > > > > > Arnold Fluteaux > > Chargé d'Affaires > > SCJ Informatique > > > > 02.35.59.22.55 > > 06.15.77.70.14 -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be