On a switched LAN segment with 30 switches and 48 ports per switch.How can I locate the switch/port where a host with specific ip address is connected, when I have an ip-address and mac of that host?
sorry for my poor english.
i solved the same problem writing a script with perl and the perl SNMP module . it scans each hours my switchs and store the result in a file . the association mac / port can be found in the bridge MIB. ( i don't have the OID here cause i'm not at work , mail me if you are interested )
yes but it is not really meaning full cause there is no comments, it's include in a package who do other things, you will need to have a description of config files i use for my administration.....and i'm a poor perl programmer...
I use the perl module Net::SNMP
the OID i check are 1.3.6.1.2.1.17.1.2.0 for the number of port , 1.3.6.1.2.1.17.4.3.1.2 for the mac adresse in decimal , 1.3.6.1.2.1.17.4.3.1.1.<the value of the mac in decimal> to retreive the mac in hexa , and i just retreive the mac addresse if 1.3.6.1.2.1.17.4.3.1.3.<the value of the mac in decimal> != 4 ( but i don't remember why... )
I store the result in a hash table and compare it to the contents of my file and update the timstamp meaning "last time i ve seen this mac behind this port" .
Net::SNMP comes witch good examples.
If you have a perl problem it can be done in shell and with ucd-snmp utilities ( snmpwalk ).
Hope this will help.
write me here if you wish more information. raztaboule@yahoo.fr
On a Cisco switch do a ping <ip address> and then do a show ARP. you'll see the port that the MAC connectes to.
Also you can use the command show CAM dynamic but you have to know the MAC address of the client in advance to relally go through the list of show cam dynamic output.
One more way is to have someone temporary disconnect the network cable from the NIC and you consoled into the swtich. You 'll see something like port 3/12 left the bridge.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.