Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding LAN Switch where a host with specific ip address is connected 1

Status
Not open for further replies.

sjova

IS-IT--Management
Feb 19, 2004
2
0
0
SE
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?


 
depends about the switches (vendor/model)

On some of them are admin tools and you can search based on MAC address.

PM
 
if i'm not wrang...
for this type of switches, exist the command:
"show mac address-table"

probable in the cisco commands docs you can find more about that...


PM
 
I use nortel, not cisco, so this will be general

I go to my layer 3 switch (router) and look in a table that relates ports to MACs to IPs, this ususally locates a layer 2 switch on a port

In the layer 2 switch I can relate ports to MACs using the MAC I found in the layer 3 switch. If we found another layer 2 switch, we repeat.

I tried to remain child-like, all I acheived was childish.
 
hi ,

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 )
 
Hello raztaboule,
Could you share your perl script with me?

Thanks!

flyan168@yahoo.com.tw.
 
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.

regards,
Asghar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top