0

I used svnserve on my centOS server. And I have open port number 3690 on my server. As you can see, the result of command iptables -L is shown as following

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
ACCEPT     icmp --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:webcache 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:mysql 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:5901 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ddi-tcp-1 
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:svn 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:search-agent 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:svn 

And I have started svnserve on my server, as I can check out successfully on my server with command svn co svn://ip address/name.
Nevertheless, when I try to check out from my laptop. It is said that connection is refused. And also, I have tested the connection by telnet ip port , it is said telnet: Unable to connect to remote host. It is quite confused since I have open port 3690 and my svn service is definitely listening to port 3690. What could be the reason for that? And what should I do to access the svn server from remote?

0

IPtables process the rules from top to the bottom. Here is the issue:

Take look on the following rules:

REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:svn 

After Reject all rule all packets are discarded, including your svn rule. So that is why you're unable to connect.

Solution:

Place the following rule as the latest one on your INPUT chain, if you really want to discard all other packets:

iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.