在我的网络中,我想扫描启用 snmp 的设备。那么是否有任何单行 snmp 命令,以获取特定 IP 地址范围(如 172.26.1.1 到 172.26.1.255)中启用 snmp 的设备列表。
我找到了一个链接,上面说这是可能的,但没有提到命令。
是否有任何通用的 OID 来实现这个或单个 snmp 命令?
最佳答案
好吧,您可以尝试使用子网广播地址,但从 SNMP 常见问题解答来看,大多数设备都关闭了此功能。所以这可能不会很好地工作。
http://www.snmp.com/FAQs/snmp-faq-part2.txt
2.60.12 SUBJECT: How should an agent respond to a broadcast request?
When an SNMP request is sent with a broadcast address, Who is supposed to respond? Ideally every host in the subnet should respond. But I notice that it doesn't happen. What is the expected behaviour when a directed broadcast is done?
Depending on how the agent is written, it may respond, or just drop the message. Many agents just drop the message. I believe that is what the SNMP agent in cisco product do.
另一种方法是尝试使用 nmap 扫描响应 SNMP 的主机,并尝试查看它们响应的社区字符串。
https://www.vanstechelman.eu/networking/scanning_for_snmp_services_with_default_community_strings
还有
关于snmp - 是否有一个 snmp 命令来获取某个 IP 地址范围内启用 snmp 的设备的列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32527735/