Find switchport for device on your network (cisco)

If you have a cisco network and not using software tools who logs status for your switchports you can still find where your device is connected without physically going to the location checking patching.

You will need a source and a destination mac address.

  • Source mac address
    • The source mac address isn’t that important, just do a sh mac address table vlan 5. Find a random mac address on the same vlan as the device you are looking for.
  • Destination mac address
    • I usually find this by checking the dhcp server or asking the user for the information. It might be printed on a label on the device or if it’s a windows computer you find it with ipconfig /all under Physical Address.

When you got source and destination mac address you can run the command: traceroute mac {source mac} {destination mac}. The output will tell you something about where both source and destination mac is connected and the path between them. Example:

Traceroute mac aaaa.bbbb.cccc dddd.eeee.ffff
Source aaaa.bbbb.cccc found on switch10
1 switch10 ( : Fa0/40 => Gi0/1
2 switch13 ( : Gi0/2 => Gi0/1
3 switch19 ( : Gi0/2 => Gi0/1
4 switch31 ( : Gi0/2 => Fa0/38
Destination dddd.eeee.ffff found on switch31
Layer 2 trace completed

If you need more details, you can add detail after the command.

Leave a Reply