Showing results for 
Search instead for 
Did you mean: 

SNMP Script To Trace IP's To Access Switch


I am creating a Perl script with SNMP to trace an IP address of an end point back to the access switch that it connects to. So far my flow is to ask the user for an IP and a default gateway. I do an SNMP walk for the arp table on the default gateway(the distribution switch) and obtain the value of the corresponding mac address. I trace the mac address to the trunk port that connects the access switch where the end device is connected. From here, I need to get the IP address of the CDP neighbor so that I may now walk its mac address table(on the access switch) to compare it to the mac address of the end device and determine the port that it is on. The problem that I am finding is that the ifIndex does not have a relationship to the CDP mib and thus, if I have already found the ifIndex of the trunk port, there is no way that I can tie it to a CDP port.  Does any one have a work around to this? 

Everyone's tags (1)
CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards