Solved

Retrieve IP addresses from Cisco Switch Ports

Posted on 2004-10-07
6
11,996 Views
Last Modified: 2013-11-13
Looking to get the corresponding ip address of the switch port.
I run show ip arp and show mac address table on the switches and save results in seperate text files.
I then run a perl script on these files to retrieve the ip address, machine names , vlan etc.
problem is however not all ports are outputting arp details so only getting info on some ports
Does anyone know of a workaround to this problem
0
Comment
Question by:mulpeter
[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
6 Comments
 
LVL 27

Expert Comment

by:pseudocyber
ID: 12247922
You're only going to get ARP details matching an IP address to a port if in fact IP is running on the port in question.  In some cases, it might not be.
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 12248051
Entries will only be in the Mac Address table if a machine is connected to the port and is turned on and communicating on the network.  The entries age out so if a machine is turned off, its ARP/MAC entries will eventually age out and be removed from the tables.
0
 
LVL 10

Expert Comment

by:ngravatt
ID: 12248813
Typically you would need to find it on one of your machine's arp tables.  If there is a router in your network, this is usually the most central place to gather that type of info.  On a cisco router, the command is "show arp" - it will give you a listing of the MAC addresses and their corresponding IP address.  On a windows box, from a DOS prompt you can type "arp -a" to see similar output.
0
What, When and Where - Security Threats from Q1

Join Corey Nachreiner, CTO, and Marc Laliberte, Information Security Threat Analyst, on July 26th as they explore their key findings from the first quarter of 2017.

 
LVL 10

Expert Comment

by:ngravatt
ID: 12248837
i forgot to say.  switches (most) only work at layer 2, so they never see IP addresses. Routers work at Layer 3, so they learn IP addresses for use in the routing tables and such.
0
 
LVL 79

Expert Comment

by:lrmoore
ID: 12248897
If you have a router and a switch, you can use the ARP cache of the router.
Switch holds mac-address to switchport mapping - get the mac table
Router holds mac-address to IP address mapping - compare arp table to switch mac table
WINS/DNS holds IP address to NetBios host/user mapping - resolve IP's to netbios/host names

You need to use all three in concert to keep tabs on who's on first.

Take a look a Solarwinds switchport mapper. Free 30 day eval just to see how it works:
http://www.solarwinds.net
0
 
LVL 11

Accepted Solution

by:
PennGwyn earned 250 total points
ID: 12260400
Machines will appear in the ARP table only if they have sent traffic seen by this device within the timeout period.  When I'm faced by a similar challenge, I begin with a broadcast ping (your equipment might not propagate that, and so you might need to do a fast ping scan instead).  Every device that wants to answer the ping must arp for its origin first, and that gets their MAC address into the switch arp table if it had timed out.

0

Featured Post

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
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…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

623 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