I am trying to get a list of the devices that are connected to my Cisco (Catalyst 2960) switch. Preferably through SNMP. Here is what I've already done:
I was able to retrieve the ARP table from the switch (through SNMP walking OID 1.3.6.1.2.1.4.22.1.2
on the switch). However this does not reflect the 'live' set of IP's since ARP does not update when devices go offline. In other words, when I restart a device and it acquires a new IP address (dynamic) I end up with the old IP address also listed in my ARP table, even though that IP is not currently on the network.
Is there any way for me to find that 'live' list through the switch, preferably avoiding the ARP table?
P.S. I cannot continuously ping the devices to determine their status, I'm working under very low bandwidth conditions.
Best Answer
Is a broadcast ping to the subnet from the SVI on the switch (which is low-bandwidth), and using
show mac address-table dynamic
out of the question?At this point, use your ARP table to map from mac-address to IP address.
Doing this with SNMP is possible, but somewhat painful if you need to know what port each mac-address is on... use dot1dTpFdbAddress to grab the mac-addresses, dot1dBasePortIfIndex to map to interface
ifIndex
and thenifName
to map fromifIndex
to a name you'll recognize.