Tuesday, January 1, 2019

How to find the port a device is connected to, based on IP, on a Cisco Catalyst switch

On a Layer 3 switch:

  • Log into the switch and issue the following command (where ipaddress is the ip address of the host you are trying to locate:
    show ip arp *ipaddress*
    
  • The output should look similar to below, and give you the mac-address of the device (I've highlighted the mac-address below in bold).
    LYKINS-1861#show ip arp 172.20.1.100
    Protocol  Address          Age (min)  Hardware Addr   Type   Interface
    Internet  172.20.1.100            0   **28cf.da1d.1b05**  ARPA   Vlan10
    
  • Now issue one of the following commands (where mac-address is the hardware address from previous step). Depending on the Cisco platform, sometimes the command is listed in either form.
    show mac address-table address *mac-address*
    show mac-address-table address *mac-address*
    
  • The output should look similar to below, the port you are looking for should be listed as the Destination Port:
    LYKINS-1861#show mac-address-table address 28cf.da1d.1b05
    Destination Address  Address Type  VLAN  Destination Port
    -------------------  ------------  ----  --------------------
    28cf.da1d.1b05          Dynamic      10     **FastEthernet0/1/1**


On a Layer 2 switch:

  • Find out what device is doing the routing for this switch (you may have to look at the network documentation). Sometimes it is a "Router on a Stick", where the Layer 2 VLANs are being trunked up to the router for the Layer 3 decisions.
  • Log into the routing device, and issue the following command (where ipaddress is the ip address of the host you are trying to locate:
    show ip arp *ipaddress*
    
  • The output should look similar to below, and give you the mac-address of the device (listed below in bold).
    LYKINS-1861#show ip arp 172.20.1.100
    Protocol  Address          Age (min)  Hardware Addr   Type   Interface
    Internet  172.20.1.100            0   **28cf.da1d.1b05**  ARPA   Vlan10
    
  • Now log into the Layer 2 switch
  • On that device issue one of the following commands (where mac-address is the hardware address from the previous step). Depending on the Cisco platform, sometimes the command is listed in either form.
    show mac address-table address *mac-address*
    show mac-address-table address *mac-address*
    
  • The output should look similar to below, the port you are looking for should be listed as the Destination Port:
    LYKINS-1861#show mac-address-table address 28cf.da1d.1b05
    Destination Address  Address Type  VLAN  Destination Port
    -------------------  ------------  ----  --------------------
    28cf.da1d.1b05          Dynamic      10     **FastEthernet0/1/1**