Go to the router for that subnet and find the MAC for that IP -- if they're generating traffic, the router will have the MAC. Then go to each switch with access ports for that subnet (could be a single switch, could be dozens) and look for the MAC in the mac-address-table.
-- Example --
I have forgotten the port for the management interface of my iSCSI SAN switch, but I know the IP. From a machine in the same LAN, I ping it and then look in the ARP table:
[root:pts/5{4}]machine:~/[01:53 PM]:arp -a | grep IP
? (IP) at d0:7e:28:d1:42:01 [ether] on eth0
I first login to sw-r2-3
:
sw-R2-3#show mac address-table address d07e.28d1.4201
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
55 d07e.28d1.4201 DYNAMIC Po1
I know Po1
(port-channel 1) is the uplink for that switch, so I go to sw-r2-2
:
sw-R2-2#show mac address-table address d07e.28d1.4201
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
55 d07e.28d1.4201 DYNAMIC Gi1/0/43
I know G1/0/43 is an access port -- show run int g1/0/43
-- so that's where it's connected.