Find your devices on a Cisco switched network

A quick note about finding your devices wich are connected to one of your cisco switches.
I always start on the main switch (core) to find the device.

Commands used:
ping
show arp
show cdp-neighbours
show cdp-neighbours detail
show mac address-table

Solution:
First we have to ping the device to get an arp entry.

#ping 192.168.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
!!!!!

When the ping is successfull you check the arp table to find the mac address of the device

#Show arp | include 192.168.0.1
   1    0023.7d88.27bf    DYNAMIC     Po1

Now we know that it’s behind interface Port-channel1 (Po1), so let’s find out which interface are is used in the Port-channel.

#show interface Po1 | include Members
Members in this channel: Gi1/0/47 Gi1/0/48

With that in mind, let’s see what switch is connected to those interfaces

#sh cdp neighbors
Capability Codes: R – Router, T – Trans Bridge, B – Source Route Bridge
                  S – Switch, H – Host, I – IGMP, r – Repeater, P – Phone,
                  D – Remote, C – CVTA, M – Two-port Mac Relay
Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
SW002
                 Gig 1/0/48        139             R S I  WS-C3560G Gig 0/20
SW002
                 Gig 1/0/47        139             R S I  WS-C3560G Gig 0/19

(You can also use the show cdp entry <Device ID> if you have a lot of switches)
When using show cdp neighbours detail you can even get the coresponding ip address!
Now ssh into the second switch and look if it finds the mac address.

#sh mac address-table | include 0023.7d88.27bf
   1    0023.7d88.27bf    DYNAMIC     Gi1/0/41

Cool, now you know that it’s connected to interface Gigabit 1/0/41!

Check Also

Cisco logging shows uptime instead of timestamp

On some cisco devices when you are connected to the console or view the logfile …

Leave a Reply

Your email address will not be published. Required fields are marked *