1

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.

Jason Antman
  • 1,546
  • 1
  • 12
  • 23
  • If I understand you correctly you're looking to build a layer 2 topology diagram? Take a look at Ciscoworks. There should be a demo you can run to get what you're after. I'm surprised the CDP information via SNMP doesn't tell you what interface its from, perhaps there is a matching table or another OID that has the info? – SpacemanSpiff Feb 08 '11 at 16:40
  • Check out SolarWinds Lansurveyor... some googling around and this looks like what you want. – SpacemanSpiff Feb 08 '11 at 16:46

3 Answers3

1

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)

Joel K
  • 5,765
  • 2
  • 29
  • 34
1

You should check out Netdisco. It does exactly what you are asking for.

Joseph
  • 3,787
  • 26
  • 33
0

There is no easy way to distinguish "uplink" from "downlink to a switch uplink" by using CDP, that's purely 'local knowledge'. If you have teh full CDP information, there should be data for what's on the other end (equipment model number, equipment hostname and one IP, usually the management IP, of the device).

By correlating the LAN router port's MAC address with the MAC forwarding database, you should eb able to determine what port (or ports) are facing the local default gateway. I believe the MAC fdb is exposed via SNMP.

In the past, I have used python programs telnetting to devices, scraping the output of "sh cdp neighbor" to do roughly this and found it quite doable.

Vatine
  • 5,390
  • 23
  • 24