Forum Discussion

yee379_137296's avatar
yee379_137296
Icon for Nimbostratus rankNimbostratus
Nov 07, 2013

snmp mac address and if index query

i normally query for all arp entries using the

RFC1213-MIB
mib and
ipNetToMediaPhysAddress
or
ipNetToPhysicalPhysAddress
oid; the typical output is something like:

IP-MIB::ipNetToPhysicalPhysAddress.13.ipv4."172.18.x.y" = STRING: 0:d0:ff:ee:fc:a
IP-MIB::ipNetToPhysicalPhysAddress.14.ipv4."127.2.0.1" = STRING: 0:23:e9:6e:97:0
IP-MIB::ipNetToPhysicalPhysAddress.17.ipv4."127.1.1.2" = STRING: 0:1:23:45:67:0
IP-MIB::ipNetToPhysicalPhysAddress.17.ipv4."127.1.1.3" = STRING: 0:1:23:45:67:1
IP-MIB::ipNetToPhysicalPhysAddress.17.ipv4."127.1.1.4" = STRING: 0:1:23:45:67:2
IP-MIB::ipNetToPhysicalPhysAddress.17.ipv4."127.1.1.5" = STRING: 0:1:23:45:67:3
IP-MIB::ipNetToPhysicalPhysAddress.19.ipv4."a.b.c.d" = STRING: 0:0:c:7:ac:97

(first an last ip's redacted)

the number before the ipv4 bit usually corresponds to the ifIndex of the interface that the arp was seen on. however, on our ltm box:

IF-MIB::ifIndex.80 = INTEGER: 80
IF-MIB::ifIndex.736 = INTEGER: 736
IF-MIB::ifIndex.752 = INTEGER: 752
IF-MIB::ifIndex.768 = INTEGER: 768
IF-MIB::ifIndex.784 = INTEGER: 784
IF-MIB::ifIndex.800 = INTEGER: 800
IF-MIB::ifIndex.816 = INTEGER: 816
IF-MIB::ifIndex.832 = INTEGER: 832
IF-MIB::ifIndex.848 = INTEGER: 848
IF-MIB::ifIndex.864 = INTEGER: 864
IF-MIB::ifIndex.880 = INTEGER: 880
IF-MIB::ifIndex.896 = INTEGER: 896
IF-MIB::ifIndex.912 = INTEGER: 912
IF-MIB::ifIndex.928 = INTEGER: 928

(as you can see the index's don't match).

how can i match the ifIndex value from

ipNetToPhysicalPhysAddress
to a real physical description like that presented with
sysInterfaceName
?

  • The ipNetToPhysicalPhysAddress indices match the ifIndex scheme used in the ipv6IfTable. To get the textual representation of the interface names, use ipv6IfDescr. For example:

     

    snmpwalk -c public -v 2c localhost ipNetToPhysicalPhysAddress IP-MIB::ipNetToPhysicalPhysAddress.2.ipv4."192.168.10.17" = STRING: 24:77:3:87:b8:68 IP-MIB::ipNetToPhysicalPhysAddress.8.ipv4."127.1.1.2" = STRING: 0:1:23:45:67:0 IP-MIB::ipNetToPhysicalPhysAddress.8.ipv4."127.1.1.3" = STRING: 0:1:23:45:67:1 IP-MIB::ipNetToPhysicalPhysAddress.16.ipv4."10.11.113.22" = STRING: 0:c:29:c3:86:f1

     

    snmpwalk -c public -v 2c localhost ipv6IfDescr IPV6-MIB::ipv6IfDescr.1 = STRING: lo IPV6-MIB::ipv6IfDescr.2 = STRING: eth0 IPV6-MIB::ipv6IfDescr.3 = STRING: eth1 IPV6-MIB::ipv6IfDescr.4 = STRING: eth2 IPV6-MIB::ipv6IfDescr.5 = STRING: eth3 IPV6-MIB::ipv6IfDescr.8 = STRING: tmm0 IPV6-MIB::ipv6IfDescr.16 = STRING: external

     

    eth0 is the mgmt interface. tmm0 is an internal interface used by TMOS. external is the name of a VLAN (and the only defined VLAN) on this system.