cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5683
Views
5
Helpful
14
Replies

What PC is connected to my switch port?

bhall
Level 1
Level 1

In a Win2K network, is there a windows cscript/wscript that can be run against my catalyst 3548XL switches that will tell me what PC is connected to which switch port? Either by IP address or by MAC address.

i.e. PC1 is connected to Switch1 port 3 or 192.168.0.1 -> INT 0/3 or something to that effect. I would like to create a report (maybe spreadsheet) with this info.

Thank for any and all help.

14 Replies 14

manu.purushotam
Level 1
Level 1

Just try solarwinds network management tool. This option is there in this.

Regards

Manu

baileja
Level 1
Level 1

I have not seen one available. I have seen various snmp perl scripts that will pull from arp table's and mac-address-tables. But for this purpose I have not yet seen anything. A good way to map your ports is telnet to the switch, issue the command show mac-address-table int fa0/1 (or whatever port), next telnet to your router and issue the command "show arp | indluce 000a.8acd.0765" (or mac address returned by the previous command). You now have the IP address of the machine, issue the windows command prompt command "nbtstat -a X.X.X.X" and that will give you the machine name and logged on user. Now thats alot of work for many ports to map but you can grab the entire mac table, dump it in excel, pull the arp table, dump it in another excel and start stripping what you dont want. Than run the command. I have SoloarWinds and I dont believe it provides the functionality you want.

Hi,

SolarWinds Switch Port Mapper works exactly the way you described.

But I've got an inverse problem:

Does anybody know a simple tool which would find a switch and port in my network to which a particular PC (IP address) is connected?

There is a nice L2trace CatOS command but it's not supported in IOS.

CiscoWorks provide UserTracking function but it's not satisfactory - doesn't provide the IP info. The only way I know is using Campus Manager Path Analysis but it's slow and not 100% reliable again.

Regards,

Milan

I use an application called NetDisco which would provide the information you are looking for. Setting it up is not all that easy, but once it is up and running it works smoothly. www.netdisco.org

Would be nice, but we run a Win2K/XP shop here. I'll look at it to see if Windows is a possibility.

Thanks,

Cisco has a tool called CiscoWorksUserTrackingUtility1.0.exe look for it under Ciscoworks Campus Manager Patches.

This tool definitely runs on WinXP (all I've tried to run it on is XP Pro). It runs on your task bar and integrates with user tracking. Just enter the IP address you are looking for and it queries CW2K User Tracking database and returns lots of good information, such as IP address, MAC address, network of the device, plus the switch IP, Port, and vlan name.

I wrote an expect script to do, but it is very environment dependent. If you have a standard for the default gateway for a particular subnet, you can do it.

1. Take in the requested IP address, query the default gateway for that subnet for the ARP entry on the IP address to get the MAC address.

2. Go to the CDP neighboring switch to the router, and do a "show mac-address-table | in [MAC Address]" or "show cam [MAC Address]" or similar SNMP query to get the port the switch associated with that MAC addres.

3. Check to see if port is a neighboring switch. If so, repeat 2. If not, that is port the device is attached to.

Could I get a copy of your script? I can reverse engineer it to my environment as long as it is not Unix.

Thanks,

I'd also apriciate to get a copy of this script.

I'm planning to write it myself for a long time, but still have not time enough to do it (I'm not a programmer anymore, so it would take me a long time, I'm afraid).

If I could just tune your script, it could save me a lot of time.

Thanks,

milan.kulik@aliatel.cz

Hi,

 

login to the switch

1. run the command sh arp(this will give you the the list of ip addresses and Mac addresses)

2. now run the command #sh mac address-table(this will provide you the list of all the systems mac addrsses connected to your switch and port numbers)

 

3. now open excel sheet and copy two lists data and compare the mac add column with the mac add columns with the ports i.e. 2 and 3 cmnds data. 

 

Thanks for the response. I have SolarWinds Engineers edition. It does not provide this kind of information. I was looking for a script that I could incorporate into a program to give me this info. If you ever run across anything like this, I'd would appreciate an email.

Thanks,

I am attaching the script. In order to use it, you need to do a few things.

1. Write a logon function that logs into a router or switch device and returns whether it is a catos or ios device (I just look at the prompt to tell). You should also have a logoff function, but you could probably get away with just a blank proc.

2. Set your domain list for DNS look ups.

3. On or around line 75, you have to figure out what the default gateway address is from the workstation IP. If you use /24s and your default gateway is .1 on every subnet, you can leave it as is.

It also requires the TCLLIB DNS package to handle hostnames. Good luck!

Thanks, I'll see what I can do with it.

mastersaints888
Level 1
Level 1

Sorry, I am a bit new as I am not even a ccna yet. But wouldn't you just look at the `mac-address-table` and then match the mac address to the ip on the arp resolution?

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: