Solved

Retrieve IP addresses from Cisco Switch Ports

Posted on 2004-10-07
6
11,982 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
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 is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
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…

827 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