Cisco Switches – find parent/uplink via SNMP

cdpciscosnmp

Does anyone have any ideas on mapping out a Cisco-based network via SNMP? I have SNMP access to all of the switches (obviously), and a list of all of the hostnames. From this, I need to be able to build out a network map (or at least find which switch is the parent of another switch). SNMP is pretty much the only option, as CLI logins are enigmatized.

I can get CDP neighbors via SNMP, but I'm not quite sure how to figure out which interface they're coming from, or which interface is the uplink.

My initial sample is 360 devices, after that I have to tackle the remainder of 1,900. It's a mix of IOS and CatOS, everything from 2948's running 8.3(2)GLX to 3750's running 12.2.

Any advice would be greatly appreciated.

Best Answer

The Cisco CDP mib OIDs here includes cdpInterfaceIfIndex which should map to the local physical interface. (ifmib)

Establishing "Uplink" can be tricky, but you can sometimes infer from relative traffic ratios and sometimes from spanning tree what devices are 'upstream' of others.

Also consider this an opportunity to standardize the naming convention to make it more obvious where in your hierarchy a device sits. ("Access", "Distribution", "Core" to use cisco speak -- your hierarchy may slightly differ)

Related Topic