How do I poll the ARP table with an SNMP OID?

16,651

You should use ipNetToPhysicalTable as defined by RFC 4293. So ipNetToMediaPhysAddress becomes ipNetToPhysicalPhysAddress

 ipNetToMediaTable OBJECT-TYPE
     SYNTAX     SEQUENCE OF IpNetToMediaEntry
     MAX-ACCESS not-accessible
     STATUS     deprecated
     DESCRIPTION
            "The IPv4 Address Translation table used for mapping from
             IPv4 addresses to physical addresses.

             This table has been deprecated, as a new IP version-neutral
             table has been added.  It is loosely replaced by the
             ipNetToPhysicalTable."
     ::= { ip 22 }
Share:
16,651

Related videos on Youtube

Mike Pennington
Author by

Mike Pennington

-->

Updated on September 18, 2022

Comments

  • Mike Pennington
    Mike Pennington almost 2 years

    When you need to poll the ARP table of a device, conventional wisdom is to use ipNetToMediaPhysAddress or atPhysAddress; however, both of these OIDs are deprecated according to Cisco's documentation.

    These OIDs work just fine; however, I'm building a new tool so it makes sense to use the most current OID, if possible.

    Is there a non-deprecated SNMP OID to query for the ARP table in a device? Google hasn't turned this answer up for me, so far...


    Mircea's answer works well on newer IOS...

    [mpenning@something]$ snmpbulkwalk -v 2c -c public -Osq 192.0.2.1 ipNetToPhysicalPhysAddress
    ipNetToPhysicalPhysAddress.2.ipv4."192.0.2.1" a4:4c:11:90:56:80
    ipNetToPhysicalPhysAddress.2.ipv4."192.0.2.2" a4:4c:11:96:68:0
    ipNetToPhysicalPhysAddress.2.ipv4."192.0.2.101" 0:90:b:43:80:74
    [mpenning@something]$ snmpbulkwalk -v 2c -c public -Oqv 192.0.2.1 sysDescr
    Cisco IOS Software, C3900 Software (C3900-UNIVERSALK9-M), Version 15.2(2)T1, RELEASE SOFTWARE (fc1)
    Technical Support: http://www.cisco.com/techsupport
    Copyright (c) 1986-2012 by Cisco Systems, Inc.
    Compiled Wed 29-Feb-12 23:44 by prod_rel_team
    [mpenning@something]$
    

    Older IOS requires use of ipNetToMediaPhysAddress

  • Mike Pennington
    Mike Pennington over 11 years
    This returns values for our stuff running IOS 15.2T, sadly that's 3 out of about 300 devices... unfortunately ipNetToPhysicalPhysAddress doesn't seem to be supported in 12.2 (what almost everything else runs). Nevertheless, you've correctly answered my question, thank you!
  • Mircea Vutcovici
    Mircea Vutcovici over 11 years
    You should try to use the new one and fall back on the old one if the new one is not available.