cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1249
Views
0
Helpful
3
Replies

Which MAC or IP addresses learned on a routers port(Layer 3) via snmp

ody_bikas
Level 1
Level 1

Hi, I'am looking for a way that I could take which MAC or IP addresses is learned on a routers port(layer 3) and which is this port via snmp(OIDs). Is there any? I am looking something like procedure "Using SNMP to Find a Port Number from a MAC Address on a Catalyst Switch" (documentation of Cisco) it refers about layer 2 switches I want to find the procedure for routers layer 3. Thanks in advance.

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

This is exactly what CiscoWorks Campus Manager does. It reads the CAM/MAC tables from switches, and cross-references that with the ARP tables from routers.

The objects used to obtain the ARP tables are (from the IP-MIB):

ipNetToMediaPhysAddress (MAC address)

ipNetToMediaNetAddress (IP address)

You may also be interested in the other two objects from the ipNetToMediaTable, ipNetToMediaIfIndex and ipNetToMediaType to help you decide which addresses to accept.

Thank you for your reply. But I want some explanations to be given. The ipNetToMediaTable contains information about CAM/MAC tables. The ipNetToMediaIfIndex returns {1.3.6.1.2.1.4.22.1.1.1.x.y.z.w Integer32 1}

&

1 is the IfIndex that the x.y.z.w(Is it the ip address? e.g. 10.0.0.1) learned now on that port? Or the one that learned one time and now is dumped into the table?

The ipNetToMediaTable has nothing to do with the CAM tables. It contains information analogous to "show arp". ipNetToMediaIfIndex returns the ifIndex for the interface on which the entry was learned. So, IP address x.y.z.w was learned on the interface with the ifIndex of 1.