Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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

share|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

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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