我对系统pipe理相当陌生,而且我一直在努力熟悉像netsat这样的工具。 如果我在我的服务器上运行netstat -n ,我看到这一行:
tcp 0 0 xxx.xxx.xxx.xxx:44573 xxx.xxx.xxx.xxx:443 ESTABLISHED
但是,我使用默认策略为DROP的iptables,44573不是我允许stream量的端口之一。 我的规则在iptables中看起来像这样:
Chain INPUT (policy DROP) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:pcsync-https state NEW,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:21022 state NEW,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:http state NEW,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:https state NEW,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:ftp state NEW,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpts:65500:65534 ACCEPT tcp -- anywhere anywhere tcp dpt:webcache state NEW,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp spt:http state ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp spt:https state ESTABLISHED ACCEPT icmp -- anywhere anywhere icmp echo-reply ACCEPT icmp -- anywhere anywhere icmp echo-request ACCEPT all -- anywhere anywhere ACCEPT udp -- anywhere anywhere udp spt:domain ACCEPT tcp -- anywhere anywhere tcp dpt:smtp state NEW,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:http limit: avg 25/min burst 100 Chain FORWARD (policy DROP) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp spt:pcsync-https state ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp spt:21022 state ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp spt:http state ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp spt:https state ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp spt:ftp state ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp spt:webcache state ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:http state NEW,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:https state NEW,ESTABLISHED ACCEPT icmp -- anywhere anywhere icmp echo-request ACCEPT icmp -- anywhere anywhere icmp echo-reply ACCEPT all -- anywhere anywhere ACCEPT udp -- anywhere anywhere udp dpt:domain ACCEPT tcp -- anywhere anywhere tcp spt:smtp state ESTABLISHED
有没有人能够说明这一点? 我只是解释这个错误?
最可能的解释是,您看到从您的计算机到HTTPS端口的出站连接。 端口44573是一个短暂的端口 ,当你的机器发出一个HTTPS出站请求时,这个端口就被给予了。
netstat并没有明确的显示出站和入站,但是由于你没有任何程序在端口44573上侦听,所以端口44573处于临时端口范围内,远程机器的端口(443)不在临时端口范围内并且是用于通用服务器协议的端口),可以合理地确定它是出站连接。
埃文是非常正确的。
顺便说一句,你有:
链式输出(策略ACCEPT)
那么在OUTPUT链中有一系列的ACCEPT规则,而且没有REJECT规则,所以除了会计输出之外是完全开放的。
这很好,如果这是你打算..但我希望看到一个日志规则,所以你可以看到“意外,但仍然允许交通”在输出规则和“意外和被拒绝的交通”在INPUT规则。
另外,如果你对数据包计费不是很感兴趣的话,你可以在INPUT / OUTPUT顶部有一个“ – RELATE,ESTABLISHED -j ACCEPT”规则