FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 1st, 2010, 10:04 AM
Squado Squado is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2010
Posts: 3 Squado User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 11 sec
Reputation Power: 0
Ftp_connect for multiple ftp servers behind 1 router

After 2 days of googling and trying different solutions I decided to join this forum and ask more experienced people for a possible solution. The problem has similarities with a thread posted before, but because it is not totally similar I started this new thread.

Ok, the configuration:
I have a modem/router (option - Globesurfer III) with a static external IP address (say 88.200.88.8) and an internal IP address 192.168.1.1. Connected are two HTTP+FTP servers. 192.168.1.2 and 192.168.1.3.

I want to be able to reach the HTTP and FTP servers of both from the Internet so I applied the following settings in the Port forwarding part of the router:

192.168.1.2; TCP Any -> 50002; (Forward to port: 80)
192.168.1.3; TCP Any -> 50003; (Forward to port: 80)
192.168.1.2; TCP Any -> 21; (Forward to port: 21)
192.168.1.3; TCP Any -> 60003; (Forward to port: 21)

Further I put the firewall from the router on minimum (just for testing) so Internet services from within the LAN are all allowed.

These settings almost work for me. I can reach both HTTP servers by going to 88.200.88.8:50002 or 88.200.88.8:50003. In addition to this I can make a FTP connection (using FilleZilla on active with port 21 and port 60003), do directory listing and upload/download files. So everything works fine for me so far.

The problem:
I am also using ftp_connect from a server on the Internet to put and get some files from both servers. This works fine with the server with port 21 for ftp but doesn't totally work with the FTP port with external FTP port 60003. It does connect, and it makes the files I want to put, but all files are 0KB and no files are downloaded.

I tried it by setting it on pasv mode and tried forwarding different ports. But i am lost. I am new at php as well as setting ports and am hoping somebody can help me with this.

Thanks in advance for any help,
Evan

Reply With Quote
  #2  
Old May 17th, 2010, 03:45 AM
Squado Squado is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2010
Posts: 3 Squado User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 11 sec
Reputation Power: 0
Still no improvements

After having above problem I have been trying different thinks, but still I have got the same problem. On php net I read this:

Connecting through a firewall also depends on the type. This is an example for the Secure Gateway FTP. First you have to connect to the firewall, then open a session to the destination ftp server. This looks like this:


// Connect to firewall
$conn_id = ftp_connect("firewall.yournet.com");

// Open a session to an external ftp site
$login_result = ftp_login ($conn_id, "userid@externalhost.com", "password");

// Check open
if ((!$conn_id) || (!$login_result)) {
echo "Ftp-connect failed!"; die;
} else {
echo "Connected.";
}

// turn on passive mode transfers
ftp_pasv ($conn_id, true) ;

... and go on ...


Because ftp_connect to 88.200.88.8:21 works I thought maybe this is an option for me. So I tried:

// Connect to firewall
$conn_id = ftp_connect("88.200.88.8", 21, 300);

// Open a session to an external ftp site
$login_result = ftp_login ($conn_id, "USER@88.200.88.8:60003", "PASS");


This gives me the error: "Warning: ftp_login() [function.ftp-login]: Login incorrect. in ..."



Is there anybody who can give any help?

Reply With Quote
  #3  
Old October 11th, 2011, 08:14 AM
grandfinalemike grandfinalemike is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2011
Posts: 2 grandfinalemike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m
Reputation Power: 0
I was wondering if you have ever been able to get this working. I have also been trying to do the same thing, but can't get the combination of triggering/forwarding to allow 2 instances of ftp to different ip addresses. I did find this link that tells to open up port 60010 - 60030 to the ip of the address you need passive mode. That will allow for the connection. I am just wondering if you could pm me the info on how you got the 2 ftps to work.

thanks

Reply With Quote
  #4  
Old October 11th, 2011, 08:21 AM
Squado Squado is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2010
Posts: 3 Squado User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 11 sec
Reputation Power: 0
Hey grandfinalmike,

Sorry, did not resolve the question. Seems that is has to do something with the provider, not allowing ftp on a different port than 21.

Reply With Quote
  #5  
Old October 11th, 2011, 08:56 AM
grandfinalemike grandfinalemike is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2011
Posts: 2 grandfinalemike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m
Reputation Power: 0
can i ask how you set these up. for some reason, no matter what combo i do, it doesn't seem to work.. maybe its that the linksys i have doesn't allow for it.



I want to be able to reach the HTTP and FTP servers of both from the Internet so I applied the following settings in the Port forwarding part of the router:

192.168.1.2; TCP Any -> 50002; (Forward to port: 80)
192.168.1.3; TCP Any -> 50003; (Forward to port: 80)
192.168.1.2; TCP Any -> 21; (Forward to port: 21)
192.168.1.3; TCP Any -> 60003; (Forward to port: 21)

Further I put the firewall from the router on minimum (just for testing) so Internet services from within the LAN are all allowed.

These settings almost work for me. I can reach both HTTP servers by going to 88.200.88.8:50002 or 88.200.88.8:50003. In addition to this I can make a FTP connection (using FilleZilla on active with port 21 and port 60003), do directory listing and upload/download files. So everything works fine for me so far.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > Ftp_connect for multiple ftp servers behind 1 router

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap