我的ubuntu14.04LTS服务器在端口53上接收来自不同ip地址的大量传入流量。我不托管任何DNS服务。所以我决定阻止53端口:
iptables -A INPUT -p tcp --destination-port 53 -j DROP
iptables -A OUTPUT -p tcp --dport 53 -j DROP在那之后,我保留了新规则:
invoke-rc.d iptables-persistent save最后的结果如下:
Chain INPUT (policy ACCEPT)
target prot opt source destination
DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:53
Chain FORWARD (policy ACCEPT)
target prot opt source destination
DOCKER all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:53
Chain DOCKER (1 references)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 172.17.0.3 tcp dpt:80
ACCEPT tcp -- 0.0.0.0/0 172.17.0.7 tcp dpt:8080然而,当我使用nethogs来监视流量时,我仍然可以看到端口53上的流量。你知道为什么这些规则不起作用吗?
请注意:我已经安装了码头1.9.1。
Nethogs的产出:

而且名单还在增加。
发布于 2016-01-31 22:01:44
DNS主要是端口53上的UDP。
但是为什么你也要在输出链中阻止它呢?您不想从这台机器解析任何域名吗?
发布于 2016-01-31 21:59:10
DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:53通常,DNS通信量是UDP,返回到TCP。您也需要将UDP放到端口53。
iptables -I INPUT -p udp --destination-port 53 -j DROP https://serverfault.com/questions/753066
复制相似问题