TCP:あるPCは別のPCのリスンポートに接続できますが、その逆はできません。

TCP:あるPCは別のPCのリスンポートに接続できますが、その逆はできません。

私はローカルネットワークを持っています(VPNなのか実際のローカルネットワークなのかは関係ありません。どちらも試してみました)。

Linux Mintを実行しているコンピュータがソケットを開きます。

mint$ nc -l 4242

OpenSUSEを実行している2番目のエントリはソケットに接続してメッセージを送信できます。

suse$ nc 10.8.0.10 4242

ただし、Suseでソケットを開いてMintで接続しようとすると、接続は確立されません。ufwSuseにはファイアウォールはまったくインストールされていません。

MintからWindows PCにTCPパケットを送信しようとしましたが、うまくいったので、Suseシステムに問題があるようです。

もしそうなら、より高いポート番号(55555など)を選択してみましたが、成功しませんでした。

iptables -L -vスースについて:

Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination         
 272 23240 ACCEPT     all  --  lo     any     anywhere             anywhere            
  28  5183 ACCEPT     all  --  any    any     anywhere             anywhere             ctstate ESTABLISHED
   0     0 ACCEPT     icmp --  any    any     anywhere             anywhere             ctstate RELATED
  15  4984 input_ext  all  --  any    any     anywhere             anywhere            
   0     0 LOG        all  --  any    any     anywhere             anywhere             limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix "SFW2-IN-ILL-TARGET "
   0     0 DROP       all  --  any    any     anywhere             anywhere            

Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination         
   0     0 LOG        all  --  any    any     anywhere             anywhere             limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix "SFW2-FWD-ILL-ROUTING "

Chain OUTPUT (policy ACCEPT 47 packets, 7142 bytes)
pkts bytes target     prot opt in     out     source               destination         
 272 23240 ACCEPT     all  --  any    lo      anywhere             anywhere            

Chain forward_ext (0 references)
pkts bytes target     prot opt in     out     source               destination         

Chain input_ext (1 references)
pkts bytes target     prot opt in     out     source               destination         
   2  1956 DROP       all  --  any    any     anywhere             anywhere             PKTTYPE = broadcast
   0     0 ACCEPT     icmp --  any    any     anywhere             anywhere             icmp source-quench
   0     0 ACCEPT     icmp --  any    any     anywhere             anywhere             icmp echo-request
  13  3028 DROP       all  --  any    any     anywhere             anywhere             PKTTYPE = multicast
   0     0 DROP       all  --  any    any     anywhere             anywhere             PKTTYPE = broadcast
   0     0 LOG        tcp  --  any    any     anywhere             anywhere             limit: avg 3/min burst 5 tcp flags:FIN,SYN,RST,ACK/SYN LOG level warning tcp-options ip-options prefix "SFW2-INext-DROP-DEFLT "
   0     0 LOG        icmp --  any    any     anywhere             anywhere             limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix "SFW2-INext-DROP-DEFLT "
   0     0 LOG        udp  --  any    any     anywhere             anywhere             limit: avg 3/min burst 5 ctstate NEW LOG level warning tcp-options ip-options prefix "SFW2-INext-DROP-DEFLT "
   0     0 DROP       all  --  any    any     anywhere             anywhere            

Chain reject_func (0 references)
pkts bytes target     prot opt in     out     source               destination         
   0     0 REJECT     tcp  --  any    any     anywhere             anywhere             reject-with tcp-reset
   0     0 REJECT     udp  --  any    any     anywhere             anywhere             reject-with icmp-port-unreachable
   0     0 REJECT     all  --  any    any     anywhere             anywhere             reject-with icmp-proto-unreachable

この問題の原因は何ですか?

ベストアンサー1

次のコマンドを使用します。

sudo iptables -I INPUT -p tcp --dport 4242 -j ACCEPT

水税チェーンの最後の行は次INPUTのとおりです。

   0     0 DROP       all  --  any    any     anywhere             anywhere            

これはDROPすべてのINPUTパケットを意味します。このコマンドを使用します。

sudo iptables -I INPUT -p tcp --dport 4242 -j ACCEPT

I入力パケットを最上位から受け入れ、ルールの前に実行するためのDROP新しいルールを挿入します。

そして、このルールは新しい接続には適用されません。

ACCEPT     all  --  any    any     anywhere             anywhere             ctstate ESTABLISHED

この統計がESTABLISHED意味するものは次のとおりです。

関連 - 新しい接続ですが、すでに許可されている他の接続に関連付けられています。 ESTABLISHED - 接続が確立されました。

おすすめ記事