Cacti监控Centos抓包unreachable

09:10:41.023399 IP 192.168.1.80 > 192.168.2.182: ICMP host 192.168.1.80 unreachable - admin prohibited, length 79

抓包发现总是有这个出现,而且是跟在GetRequest后面。

打开iptables配置:

最开始网上找的配置语句是这个,

-A INPUT -p udp -m udp --sport 161 -j ACCEPT

后面以为还需要开放tcp,又加了一条,

-A INPUT -p tcp -m state --state NEW -m tcp --dport 161 -j ACCEPT 
-A INPUT -p udp -m udp --sport 161 -j ACCEPT

最后发现udp那条是错误的,于是,

-A INPUT -p udp -m state --state NEW -m udp --dport 161 -j ACCEPT

再抓包,就看见每个GetRequest后面都是GetResponse了。

顺便记下这次抓包的命令

tcpdump -nn -X 'host 192.168.2.182' -c 10
原文地址:https://www.cnblogs.com/ShepherdIsland/p/3898677.html