I need to find out the MAC addresses and ports of devices connected directly to a Cisco switch, preferably via SNMP. the best way i found is with CDP neighbors, but i don't find the MAC addresses, only ip and hostname.

currently i get the mac from the ip via RFC1286-MIB::dot1dTpFdbPort, but this is very unreliable as ip addresses are not always listed in this table. does someone know a better way to retrieve the mac address?

link|improve this question
feedback

2 Answers

cdp neighbors will show you other Cisco devices and on what port they are attached. If you're looking for the mac on those devices, do a show mac address-table dynamic interface X where X is the interface on which the device is connected. You can leave off interface X to see all mac addresses of devices connected to the switch. Not sure how to get this via SNMP

link|improve this answer
Well, yes, but the MAC table for that port will have all the devices connected to the connected switch, too.. – Shane Madden Dec 10 '11 at 20:22
@Shane. True, if the connected device is a switch. If it's a router - you're all set. In the case of a switch, I suppose I would get the IP from show cdp neigh details, ping it from the switch, then show arp | inc IP to get the MAC of the switch. – Paul Ackerman Dec 10 '11 at 20:46
feedback

SolarWinds Switch Port Mapper, available as part of the Network Engineer's Toolset is a great tool that will do what you are asking as long as the switch's management interface supports the proper SNMP OIDs. Both a GUI and CLI (Windows command window) available.

A lot of good details in the Switch Port Mapper Documentation as well.

A trial is available, the full version comes with Engineer's Toolset or can be purchased separately.

I do not work for SolarWinds but can speak very highly of Engineer's Toolset.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.