On a Cisco Catalyst switch, I need to find what port an end device is connected to.
I have the IP address/host name.
How do I quickly find the port?
On a Cisco Catalyst switch, I need to find what port an end device is connected to. I have the IP address/host name. How do I quickly find the port? |
|||
|
The answer depends on whether the switch is a Layer 2 or a Layer 3 switch. That is to say, is the switch only switching and relaying traffic on to a different device for routing, or, is it doing the routing decisions itself via SVIs (switched virtual interfaces). On a layer 3 switch, the port can be found by using a few simple commands on the device. However on a layer 2 switch, you have to log into both the switch and whatever device is doing the routing to locate the port. In either case, the commands are the same, just run on two different boxes for the layer 2 switch. On a Layer 3 switch:
On a Layer 2 switch:
|
||||
|
Firstly, you need to get the MAC address, so get into a machine on the same VLAN and look at its neighbour table - Windows is If this is a discovery job on a layer 2 switch, do If on the other hand it's a router, use Long-term however, I heartily recommend that you setup LLDP (failing that, CDP) to your hosts so that you can identify them from either side. lldpd is an absolutely excellent LLDP daemon for Linux that also supports CDP, EDP, SONMP and FDP. If you're currently able to reach the host and it does happen to run linux/BSD, I'd recommend skipping the above and just turn on LLDP. |
|||||
|
Regardless of whether your switch is performing frame forwarding (layer 2) or packet routing (layer 3), the following should work if the switch has a management IP address in the same subnet as the host you want to find:
|
|||
|