Right now I'm developing a project where I use the SNMP protocol to discover the network. By discovering the network I mean go through all the routers and switches and retrieve the IP routing table from routers and the forwarding table from switches. With the routers I have no problem. For the switches I need to know for each port the MAC addresses and the Vlans. Basically it's use SNMP to find a port number from a MAC address. To do that i followed this tutorial:
The problem is that I'm using a Cisco 3725 Router with IOS 12.4 (21) and a NM-16ESW module to work as a Switch and when I use the OID .126.96.36.199.2.1.17 corresponding to the BRIDGE-MIB as it follows:
snmpwalk -v2c -c myrouter 10.1.1.5 .188.8.131.52.2.1.17
SNMPv2-SMI::mib-184.108.40.206.0 = Hex-STRING: 00 00 00 00 00 00
SNMPv2-SMI::mib-220.127.116.11.0 = INTEGER: 0
SNMPv2-SMI::mib-18.104.22.168.0 = INTEGER: 4
From this I guess there's no information on the router about Vlans or anything. Other thing is that when I use community string indexing it returns a timeout. My theory is that this version doesn't support indexing but I don't know.
Can anyone help me or have any suggestion about how can I get the Port Number from a MAC address from this "switch" (it's a router working as a switch) using SNMP?
Are you using dhcp on the network? If you are you could enable dhcp snooping and just periodically download and parse the dhcp snooping table.
Sent from Cisco Technical Support iPad App
No, I'm defining the IP addresses device by device. Everytime a device is connected it's supposed to be configured with the IP address and Default Gateway but without using DHCP.