Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do you search for an IP address given a MAC address, on a Cisco switch?

Posted on 2009-04-06
2
Medium Priority
?
406 Views
Last Modified: 2012-05-06
I have to develop a scrip that will find an IP address given a MAC address on a Cisco switch. The script must be written for a Unix server and run in intervals of about 30 minutes.

I should say that I am a complete novice in this matter, but I am a quick learner.

The issue is, I live on a small island, and my MacBook Pro was stolen, but I have my MAC address. The local ISP will help me locate the laptop if I write a script to associate an IP with my MAC. It should run about every 30 seconds and notify both the network administrator and me.  I am a programmer but this is unfamiliar territory for me. I would greatly appreciate some guidance.  
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
grsteed earned 800 total points
ID: 24084152
If the switch is only layer 2, than you may not be able to see the IP address unless it happens to be on the same network that switch management IP address is on. That is, the same network that you telnet/ssh to  when accessing the switch console. If you issue the command "show arp" or "show ip arp" you will see the MAC's and IP's for that network.  If it's a long list use the form "show ip arp | in <MAC>" where in=include and <MAC> is your MAC address.   If you don't see your MAC listed that way, you can try the command "show mac-address-table dynamic | in <MAC>"  That will show you if you MAC shows up on a port on that switch, of a trunk/port channel that connects to another switch. If that's what you see, you need to go to the next switch and issue the same command.  This will eventually get you to the port that your laptop is showing up on.

The best place to get MAC -> IP information is from the router arp cache, or the arp cache of a layer 3 switch with the command "show ip arp | in <MAC>"

To run this from a Unix server, you may want to use TCL/Expect which uses  SEND and EXPECT commands to send a string and wait for a string back.  With it you can script a telnet/ssh to a device, wait for login prompt, send login, wait for password prompt, send password, wait for prompt, send command, wait for output etc...  a sample can be found here.

http://www.corecoding.com/cisco-expect-script_c32.html

Hope this helps.

Gary

0
 
LVL 10

Assisted Solution

by:atlas_shuddered
atlas_shuddered earned 200 total points
ID: 24097956
One other item of note, if the switch in question is capable of running the Cisco Network Assistant, you can perform a layer 2 trace.  The downside to this is that it will not run automatically.
0

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Tired of waiting for your show or movie to load?  Are buffering issues a constant problem with your internet connection?  Check this article out to see if these simple adjustments are the solution for you.
I recently attended Cisco Live! in Las Vegas, a conference that boasted over 28,000 techies in attendance, and a week of hands-on learning hosted by a solid partner with which Concerto goes to market.  Every year, Cisco displays cutting-edge technol…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question