How to find the port a device is plugged into

Have you ever needed to quickly find out which switch port a network device is plugged into and you only know the IP address of the device?  You could always trace the cables in your data closet and drive yourself crazy or you could use a few simple commands on your switch and quickly find it.

sh ip arp | inc <ip address>
This will return the mac address
sh mac-address-table | inc <mac address>
This will return the switch port
If the IP address is on another switch, the port that is returned in the output will be for the trunked port that goes to the next “hop”.  Go to the next switch and repeat.

sh run int <switch port>
This will return the config for that interface

Here is an example:

switch01#sh ip arp | inc
Internet           0   0080.a38a.10dc  ARPA   Vlan11
switch01#sh mac-address-table | inc 0080.a38a.10dc
  11    0080.a38a.10dc   dynamic ip                     GigabitEthernet3/3 
switch01#sh run int gi3/3
Building configuration…
Current configuration : 152 bytes
interface GigabitEthernet3/3
 switchport access vlan 11
 switchport mode access
 qos trust dscp
 spanning-tree portfast

You may also like...

1 Response

  1. Starfox says:

    Thanks man!!!

Leave a Reply

Your email address will not be published.