我使用最小的配置在Debian10机器上设置SNMP,但是SNMP服务器不会从客户端接收SNMP。
客户机上的snmpd.conf:
com2sec my-sec default abc123
group my-grp v2c prtg-sec
view my-view included .1
access my-grp "" any noauth exact prtg-view none noneIptables在客户机上是空的,而客户机上的fail2ban没有阻塞服务器IP。
但是,在带有本地IP的客户机上运行snmpwalk很好,但是它不能在服务器(snmpwalk -v2c client_ip -c abc123)上工作,并且获得超时错误,同时来自客户端的TCPDUMP显示以下消息:
tcpdump: listening on ens18, link-type EN10MB (Ethernet), capture size 262144 bytes
13:30:02.776848 IP (tos 0x0, ttl 63, id 3288, offset 0, flags [DF], proto UDP (17), length 72)
snmp_server.60035 > snmp_client.snmp: [udp sum ok] { SNMPv2c C="abc123" { GetNextRequest(25) R=404279833 } }
13:30:03.778174 IP (tos 0x0, ttl 63, id 3435, offset 0, flags [DF], proto UDP (17), length 72)
snmp_server.60035 > snmp_client.snmp: [udp sum ok] { SNMPv2c C="abc123" { GetNextRequest(25) R=404279833 } }
13:30:04.779138 IP (tos 0x0, ttl 63, id 3619, offset 0, flags [DF], proto UDP (17), length 72)
snmp_server.60035 > snmp_client.snmp: [udp sum ok] { SNMPv2c C="abc123" { GetNextRequest(25) R=404279833 } }
13:30:05.780377 IP (tos 0x0, ttl 63, id 3811, offset 0, flags [DF], proto UDP (17), length 72)
snmp_server.60035 > snmp_client.snmp: [udp sum ok] { SNMPv2c C="abc123" { GetNextRequest(25) R=404279833 } }
13:30:06.781420 IP (tos 0x0, ttl 63, id 3817, offset 0, flags [DF], proto UDP (17), length 72)
snmp_server.60035 > snmp_client.snmp: [udp sum ok] { SNMPv2c C="abc123" { GetNextRequest(25) R=404279833 } }
13:30:07.782405 IP (tos 0x0, ttl 63, id 4065, offset 0, flags [DF], proto UDP (17), length 72)
snmp_server.60035 > snmp_client.snmp: [udp sum ok] { SNMPv2c C="abc123" { GetNextRequest(25) R=404279833 } }UDP161是开放的,服务器也可以连接到这个端口。
安装在客户端上的打包程序:
# dpkg -l|grep snmp
ii libsnmp-base 5.7.3+dfsg-5+deb10u2 all SNMP configuration script, MIBs and documentation
ii libsnmp30:amd64 5.7.3+dfsg-5+deb10u2 amd64 SNMP (Simple Network Management Protocol) library
ii snmp 5.7.3+dfsg-5+deb10u2 amd64 SNMP (Simple Network Management Protocol) applications
ii snmpd 5.7.3+dfsg-5+deb10u2 amd64 SNMP (Simple Network Management Protocol) agents发布于 2021-07-27 04:24:47
Debian 10可能实际上使用的是更新的Netfilter,而不是iptables。nft list ruleset是否报告除空过滤链之外的其他内容?
/etc/hosts.deny和/etc/hosts.allow是否有适用于snmpd的限制?
https://unix.stackexchange.com/questions/659923
复制相似问题