なぜリモートでsvnサーバーにアクセスできないのですか?

なぜリモートでsvnサーバーにアクセスできないのですか?

私はcentOSサーバーでsvnserveを使用しています。私のサーバーにポート番号3690が開いています。ご覧のとおり、コマンドの結果はiptables-L下図のように

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 

次のコマンドを使用してサーバー上で正常にチェックアウトできるため、サーバー上でsvnserveを起動しました。svn co svn://ip アドレス/名前
それでもノートパソコンで見ようとすると…接続が拒否されたそうですね。さらに、接続テストも試しました。Telnet IP ポート、telnet:リモートホストに接続できないと言います。ポート3690が開いていて、私のsvnサービスは間違いなくポート3690でリッスンしているので、これは混乱しています。その理由は何ですか? svnサーバーにリモートで接続するにはどうすればよいですか?

ベストアンサー1

IPtablesはルールを上から下に処理します。問題はこれである:

次のルールを確認してください。

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

ルールが実行されると、ルールをReject all含むすべてのパケットが破棄されますsvn。そのため、接続できません。

解決策:

本当に他のすべてのパケットをドロップするには、次のルールをINPUTチェーンの最新のルールにします。

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

おすすめ記事