This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

IP address to interface mapping

I need to add a ton of devices to DNS, and basically I want to get from a device all its IP'd interfaces.   This would be a lot faster if I could script it considering some core routers have up to 20 IP'd interfaces (vlan/interfaces/etc)

Since I use NPM to monitor and poll all the devices on the network.  Is there a way to get NPM to grab all the IP addresses configured on a device, as well as the interfaces and dump that in some sort of a useful table?

Or does anyone have or recommend a perl script that will snmp poll a device and pull any IP addresses configured (ifTable) and map it to its coordinating interface (ipAddrTable)

 

Device         - IP               - interface
switch1       - 10.4.2.217 - Vlan2 
For example I have a layer2 switch with VLAN2 ip'd to: 10.4.2.217
I think I can use the following commands to get the data I need, but I don't know how to sort it to to get:
$ snmpwalk -v 2c -c public 10.4.2.217 RFC1213-MIB::ifIndex
IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifIndex.2 = INTEGER: 2
IF-MIB::ifIndex.10001 = INTEGER: 10001
IF-MIB::ifIndex.10002 = INTEGER: 10002
IF-MIB::ifIndex.10003 = INTEGER: 10003
IF-MIB::ifIndex.10004 = INTEGER: 10004
IF-MIB::ifIndex.10005 = INTEGER: 10005
IF-MIB::ifIndex.10006 = INTEGER: 10006
IF-MIB::ifIndex.10007 = INTEGER: 10007
IF-MIB::ifIndex.10008 = INTEGER: 10008
IF-MIB::ifIndex.10009 = INTEGER: 10009
IF-MIB::ifIndex.10010 = INTEGER: 10010
IF-MIB::ifIndex.10011 = INTEGER: 10011
IF-MIB::ifIndex.10012 = INTEGER: 10012
IF-MIB::ifIndex.10013 = INTEGER: 10013
IF-MIB::ifIndex.10014 = INTEGER: 10014
IF-MIB::ifIndex.10015 = INTEGER: 10015
IF-MIB::ifIndex.10016 = INTEGER: 10016
IF-MIB::ifIndex.10017 = INTEGER: 10017
IF-MIB::ifIndex.10018 = INTEGER: 10018
IF-MIB::ifIndex.10019 = INTEGER: 10019
IF-MIB::ifIndex.10020 = INTEGER: 10020
IF-MIB::ifIndex.10021 = INTEGER: 10021
IF-MIB::ifIndex.10022 = INTEGER: 10022
IF-MIB::ifIndex.10023 = INTEGER: 10023
IF-MIB::ifIndex.10024 = INTEGER: 10024
IF-MIB::ifIndex.10101 = INTEGER: 10101
IF-MIB::ifIndex.10102 = INTEGER: 10102
IF-MIB::ifIndex.10501 = INTEGER: 10501
$ snmpwalk -v 2c -c public 10.4.2.217 RFC1213-MIB::ipAdEntIfIndex
IP-MIB::ipAdEntIfIndex.10.4.2.217 = INTEGER: 2
$ snmpwalk -v 2c -c public 1 10.4.2.217 IP-MIB::ipAdEntAdd
IP-MIB::ipAdEntAddr.10.4.2.217 = IpAddress: 10.4.2.217
$ snmpwalk -v 2c -c public 10.4.2.217 RFC1213-MIB::ifDescr
IF-MIB::ifDescr.1 = STRING: Vlan1
IF-MIB::ifDescr.2 = STRING: Vlan2
IF-MIB::ifDescr.10001 = STRING: FastEthernet0/1
IF-MIB::ifDescr.10002 = STRING: FastEthernet0/2
IF-MIB::ifDescr.10003 = STRING: FastEthernet0/3
IF-MIB::ifDescr.10004 = STRING: FastEthernet0/4
IF-MIB::ifDescr.10005 = STRING: FastEthernet0/5
IF-MIB::ifDescr.10006 = STRING: FastEthernet0/6
IF-MIB::ifDescr.10007 = STRING: FastEthernet0/7
IF-MIB::ifDescr.10008 = STRING: FastEthernet0/8
IF-MIB::ifDescr.10009 = STRING: FastEthernet0/9
IF-MIB::ifDescr.10010 = STRING: FastEthernet0/10
IF-MIB::ifDescr.10011 = STRING: FastEthernet0/11
IF-MIB::ifDescr.10012 = STRING: FastEthernet0/12
IF-MIB::ifDescr.10013 = STRING: FastEthernet0/13
IF-MIB::ifDescr.10014 = STRING: FastEthernet0/14
IF-MIB::ifDescr.10015 = STRING: FastEthernet0/15
IF-MIB::ifDescr.10016 = STRING: FastEthernet0/16
IF-MIB::ifDescr.10017 = STRING: FastEthernet0/17
IF-MIB::ifDescr.10018 = STRING: FastEthernet0/18
IF-MIB::ifDescr.10019 = STRING: FastEthernet0/19
IF-MIB::ifDescr.10020 = STRING: FastEthernet0/20
IF-MIB::ifDescr.10021 = STRING: FastEthernet0/21
IF-MIB::ifDescr.10022 = STRING: FastEthernet0/22
IF-MIB::ifDescr.10023 = STRING: FastEthernet0/23
IF-MIB::ifDescr.10024 = STRING: FastEthernet0/24
IF-MIB::ifDescr.10101 = STRING: GigabitEthernet0/1
IF-MIB::ifDescr.10102 = STRING: GigabitEthernet0/2
IF-MIB::ifDescr.10501 = STRING: Null0