LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-09-2013, 02:56 AM   #1
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Rep: Reputation: 1
unable to connect ftp


Hi

i have centos 5.3 installed with squid transparent proxy .

i try to access ftp site through filezilla client but it shows error as Response: 503 Failure of data connection.
Server sent unexpected reply.
Connection closed .

i used Natting in squid server, i allow ftp port 20,21 in squid allow rule in firewall to allow ftp but still same error

Regards
Amar
 
Old 04-09-2013, 03:45 AM   #2
cbtshare
Member
 
Registered: Jul 2009
Posts: 610

Rep: Reputation: 42
can you show the results of the command
#iptables -L

do you have selinux in enforcing?
 
Old 04-09-2013, 05:15 AM   #3
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Original Poster
Rep: Reputation: 1
Thanks for reply , no selinux is not in enforcing

[root@xyz ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp-data
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere state NEW,RELATED,ESTABLISHED tcp dpt:squid
ACCEPT tcp -- anywhere anywhere tcp spt:squid state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere state RELATED,ESTABLISHED tcp spt:http

Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere state NEW,RELATED,ESTABLISHED tcp dpt:http
ACCEPT tcp -- anywhere anywhere state RELATED,ESTABLISHED tcp spt:http

Amar
 
Old 04-09-2013, 05:58 AM   #4
cbtshare
Member
 
Registered: Jul 2009
Posts: 610

Rep: Reputation: 42
have you checked the logs? if you are getting an error something should be there..
 
Old 04-09-2013, 06:12 AM   #5
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Original Poster
Rep: Reputation: 1
yes but no error only error as 503 Failure of data connection.
Server sent unexpected reply.
Connection closed . in filezilla client.

i use nat in squid server it may create issue with ftp ??if yes what to do
 
Old 04-09-2013, 02:30 PM   #6
cbtshare
Member
 
Registered: Jul 2009
Posts: 610

Rep: Reputation: 42
you can read here they found a solution:
http://www.linuxsolved.com/forums/index.php?topic=944.0
 
Old 04-10-2013, 01:42 AM   #7
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Original Poster
Rep: Reputation: 1
I tried the solution given in link but still same problem
 
Old 04-10-2013, 02:26 AM   #8
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
Are you using vsftpd as ftp daemon?

First stop squid and try to connect it again, if you can connect then it is a proxy server problem and we will search remedy for it but if it does not connect even squid is stopped then we have to find solution for current conditions.

Try to add this line in your iptables and restart iptables
Code:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
Code:
# service iptables restart
Now try to connect.

Last edited by eklavya; 04-10-2013 at 02:30 AM.
 
Old 04-10-2013, 03:22 AM   #9
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Original Poster
Rep: Reputation: 1
Hi

the ftp is not created by us , it is given by client and if i connect by removing pc from our network and connecting some dongle directly to the pc then it will be connect , i.e not connecting from our network and i already added -A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
 
Old 04-10-2013, 03:59 AM   #10
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
It means there is something wrong in your network that is not in individual system (outside your network).
Is there any proxy in your network? can you stop for the test?
 
Old 04-10-2013, 05:10 AM   #11
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Original Poster
Rep: Reputation: 1
Hi

i have squid transparent proxy but if i stop squid then i am not able to use internet? and then how can i connect to ftp ?
 
Old 04-10-2013, 05:21 AM   #12
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
Is this line in your squid.conf?
Code:
acl Safe_ports port 21 # ftp
 
Old 04-10-2013, 06:12 AM   #13
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Original Poster
Rep: Reputation: 1
yes i have acl Safe_ports port 21 # ftp in squid.conf file
 
Old 04-10-2013, 06:50 AM   #14
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
If SELinux is disabled, port 21 is defined accepted in iptables, port 21 is opened in administration > firewall
then it should be issue of proxy (I think so).

Can you put content of your squid.conf?
 
Old 04-10-2013, 08:07 AM   #15
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Original Poster
Rep: Reputation: 1
pls find the attachment
Attached Files
File Type: txt squid.txt (146.8 KB, 13 views)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Unable to connect to FTP sunveer Linux - Newbie 2 03-16-2013 09:20 AM
unable to connect to FTP using squid ganfun Linux - Software 3 05-14-2010 11:33 AM
Unable to connect to redhat 5 server using ssh, ftp. Avadhut Linux - Newbie 6 03-12-2009 01:18 AM
FC9 : SSH OK but unable to connect via FTP, VNC, etc. revof11 Linux - Networking 5 05-29-2008 12:06 PM
Unable to connect with telnet, ssh, ftp, etc... djlerman Linux - Server 1 09-05-2007 04:13 PM


All times are GMT -5. The time now is 08:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration