Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Attention: The Cisco Support Community site will be in read only mode on Dec14, 2017 from 12:01am PST to 11:30am for standard maintenance. Sorry for the inconvenience.

New Member

get cdp neighbors and ports by snmp

Maybe somebody knows how to get by snmp from router (2821) its port numbers to which another cisco devices are connected? For now I can get the following (from unix box):

snmpwalk -a MD5 -A password -l authPriv -u username -v 3 -x DES -X privpasswordphrase router.ip.add.ress SNMPv2-SMI::enterprises.9.9.23.1

This is the output of this command:

SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.6.1.1 "3560-48-1_Vlad.ms.fbhua"

// This is the name of the switch which is connected to this router

SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.7.1.1 "FastEthernet0/1"

// This is port number on that switch

SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.8.1.1 "cisco WS-C3560-48PS"

// This is the model of the switch

SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.9.1.1 "00 00 00 29 "

SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.10.1.1 "FB"

SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.11.1.1 1

SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.12.1.1 3

SNMPv2-SMI::enterprises.9.9.23.1.3.1.0 1

SNMPv2-SMI::enterprises.9.9.23.1.3.2.0 60

SNMPv2-SMI::enterprises.9.9.23.1.3.3.0 180

SNMPv2-SMI::enterprises.9.9.23.1.3.4.0 "Vladimirskaia2821.ms.fbhua"

// This is the name of the router

Is it possible to get the port number of this router to which the switch is connected to?

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: get cdp neighbors and ports by snmp

The local ifIndex is part of the returned OID. In this case, device 3560-48-1_Vlad.ms.fbhua is connected to Vladimirskaia2821.ms.fbhua's port with ifIndex 1. You would need to look up this ifIndex in the ifTable to get its description.

1 REPLY
Cisco Employee

Re: get cdp neighbors and ports by snmp

The local ifIndex is part of the returned OID. In this case, device 3560-48-1_Vlad.ms.fbhua is connected to Vladimirskaia2821.ms.fbhua's port with ifIndex 1. You would need to look up this ifIndex in the ifTable to get its description.

4174
Views
0
Helpful
1
Replies
CreatePlease to create content