使用 SNMP WALK 获取一个端口上的 MAC 地址列表
我需要获取同一端口上的所有 MAC 地址。
假设您有一个插入墙上的基本路由器。两台计算机从该路由器插入这些端口。我希望能够找出插入这些端口的 MAC 地址。
我必须能够使用它进行网络开发(PHP / SQL) 如果可能的话,SNMP 将是最好的选择。
任何帮助将不胜感激!
目前我们正在使用 SNMPWALK 来查找端口的单个 MAC 地址,但现在我们将在同一端口中拥有多个用户。
I need to grab all the mac addresses that are on the same port.
Let’s say you have a basic router that is plugged into the wall. From that router two computers are plugged into those ports. I want to be able to find out what MAC addresses are plugged into those ports.
I MUST be able to use this for web development (PHP / SQL)
SNMP would be the best option if it’s possible.
Any help would be greatly appreciated!
Currently we are using SNMPWALK to find a single mac address to the port, but now we will have multiple users in the same port.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试使用名为 LanTopolog 的程序。它是我用于网络发现、可视化和监控的应用程序。它使用 SNMP 和 ICMP 并显示我的端口的所有 MAC 地址。您只需要知道计算机和交换机的 IP 地址即可。这是网站; http://www.lantopolog.com/download.html。
You can try to use a program called LanTopolog. Its an application that i use for network discovery , visualization and monitoring. It uses SNMP and ICMP and shows all the mac addresses of my ports. You just need to know your IP address for your computer and switches. Heres the website; http://www.lantopolog.com/download.html.
snmpwalk 应该返回它在给定端口上看到的所有 MAC。 SNMPv2-SMI::mib-2 .17.4.3.1.1(又名 .1.3.6.1.2.1.17.4.3.1.1)将为您提供每个网桥端口的 MAC。然后您需要将网桥端口 ID 与端口号相匹配。最佳实践是在每次运行检查时进行检查,而不是假设桥端口 ID 始终映射到相同的物理端口。
snmpwalk should return all the MACs it sees on a given port. SNMPv2-SMI::mib-2 .17.4.3.1.1 (aka .1.3.6.1.2.1.17.4.3.1.1) will give you the MAC for each bridge port. Then you need to match the bridge port ID up with the port number. It's best practice to check that every time you run your check rather than assuming bridgeport IDs will always map to the same physical ports.