cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
38975
Views
0
Helpful
2
Replies

How to find IP of switch connected to device?

Let's say I have an IP for a workstation (e.g. 10.0.0.1) and IP for a Cisco router it's connected to (e.g. 10.0.0.254)

 

How can I find out the IP for the switch the workstation is connected to? What is the process? I want to find the specific switch and switchport to make changes

2 Replies 2

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello,

you know the end device IP 10.0.0.1 and you know the router IP 10.0.0.254.

 

a) connect to the router and use

show  arp 10.0.0.1

You get the end user MAC address copy it to a text file

 

b) using show cdp neighbors detail

find out the directly connected switch to the router

Connect to the switch using telnet/SSH

Once inside the switch you can use the following command

show mac address-table address <end-user-address>

 

You put here the MAC address as seen on show ip arp command in format AAAA.BBBB.CCCC

 

at this point you find an interface :

or that interface is the access port to the end device and you have ended your search or it is a trunk port to another switch

in the second case you can use the show cdp neighbor detail to find out the management address of the switch.

and you repeat the whole procedure.

You connect to this swich via telnet/SSH and you issue

show mac address-table address <end-user-address>

 

Note:

on some switches you can use the command

traceroute mac <end-user-address> <end-user-address>

 

and this can tell you from the core switch the switch and the port to which the end device is connected.

However, this method does not work all the times.

 

Hope to help

Giuseppe

 

Hello,

 

what you need is the MAC address of your PC. Let's say that is 0050.7966.6800. 

 

1. From the router, issue the command 'show arp 10.0.0.1':

 

R1#sh arp 10.0.0.1
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.0.0.1 1 0050.7966.6800 ARPA GigabitEthernet0/1

 

2. From the router, issue the command 'show cdp neighor detail' to find out which switch is connected to interface GigabitEthernet0/1:

 

R1#sh cdp neighbors detail
-------------------------
Device ID: Switch
Entry address(es):
Platform: Cisco , Capabilities: Router Switch IGMP
Interface: GigabitEthernet0/1, Port ID (outgoing port): GigabitEthernet0/1
Holdtime : 163 sec

 

 

 

3. From the switch, issue the command 'show mac address-table' this will show you which port on the switch the PC is connected to:

 

Switch#sh mac address-table
Mac Address Table
-------------------------------------------

Vlan Mac Address Type Ports
---- ----------- -------- -----
1 0050.7966.6800 DYNAMIC Gi0/0

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: