Free tech learning for everyone, from basics to pro

Routing & SwitchingNetworking SecurityBeginner

Finding a device on a switched network: from IP address to switch port

In short: To find where a device is plugged in, start with its IP address. The default gateway's ARP table gives its MAC address. Each switch's MAC address table shows which port that MAC is learned on. If the port is an uplink, follow it with CDP or LLDP to the next switch and repeat, until the MAC appears on an access port.

Why you need this

A security alert names a laptop by IP address. A user reports "my PC has no network" but does not know the desk number. A printer is flooding the network. In each case, the fastest fix starts with finding the exact switch and port. This takes about two minutes once you know the routine.

Finding which port a device is onIP addressfrom the useror DHCPARP tableIP to MAC ongatewayMAC tableMAC to portFollowuplinksCDP/LLDP tonext switchAccess portfound thedevice
Figure 1. Start at the gateway and follow the MAC address down through the switches until it appears on an access port.

Step 1: get the MAC address

On the device's default gateway (the router or Layer 3 switch for its VLAN):

CORE-1# show ip arp 10.10.20.57
Protocol  Address        Age (min)  Hardware Addr   Type   Interface
Internet  10.10.20.57          2    a4bb.6d12.3c4f  ARPA   Vlan20

If there is no entry, ping the address first from the gateway to create one. You can also find the MAC in the DHCP server's lease list.

Step 2: find the port on the core

CORE-1# show mac address-table address a4bb.6d12.3c4f
Vlan    Mac Address       Type        Ports
  20    a4bb.6d12.3c4f    DYNAMIC     Te1/1/3

Te1/1/3 is an uplink to another switch, not the device itself.

Step 3: follow the uplink

CORE-1# show cdp neighbors Te1/1/3 detail | include Device|IP address
Device ID: FL2-ACC-1
  IP address: 10.10.99.21

Use show lldp neighbors for non-Cisco switches. SSH to FL2-ACC-1 and repeat step 2 there. When the MAC appears on a port that has no CDP or LLDP switch neighbour, you have found the device.

Things that can confuse you

  • IP phones: a PC behind a phone shows on the same port as the phone, in the data VLAN.
  • Wi-Fi: a wireless client's MAC appears on the port of its access point (or on the controller's uplink if traffic is tunnelled). Use the wireless controller to see which AP and SSID it is on.
  • Virtual machines: the MAC appears on the hypervisor's uplink port. Check the hypervisor to find the VM.
  • Random MAC addresses: modern phones and laptops use a private, randomised MAC per Wi-Fi network, so the MAC may not match the one printed on the device.
  • Aged entries: MAC entries age out after 5 minutes of silence by default. If the device is quiet, ping it to refresh.

Tools that do it for you

Network management and NAC tools such as Cisco Catalyst Center, ISE, NetBox with plugins, or open-source tools like Netdisco keep a history of where each MAC has been seen, so you can even find where a device was last week. Labelling switch ports and patch panels to desk numbers makes the last step physical as well as logical.

Real-world example: the infected laptop

The security team at a school saw a laptop at 10.20.40.112 scanning other devices. Using the gateway's ARP table, the core's MAC table and two CDP hops, the network team found it on port 1/0/31 of a library switch in three minutes. They shut the port, the library staff found the student's laptop at desk 31, and the device was cleaned before the scan spread.

Practice

Where do you find a device's MAC address if you only know its IP address?
In the ARP table of its default gateway (or the DHCP server's leases).
A MAC address appears on an uplink port. What do you do next?
Use CDP or LLDP to find the neighbouring switch on that port, log in to it and check its MAC address table.
Why might a wireless client's MAC appear on an access point's switch port?
The access point bridges wireless clients onto its wired uplink, so the switch learns their MACs on that port.

Key takeaways

  • Start with the gateway's ARP table to get the MAC from the IP.
  • show mac address-table address finds the port on each switch.
  • Follow uplinks with CDP or LLDP until the MAC is on an access port.
  • Phones, Wi-Fi, VMs and random MACs need extra care.
Tracks your learning on this device only. See your progress on the learning paths.
Verified author✓ Valid
Issued to
Mohamed Fayas
Role
Founder of FM TecHub
Credentials
CCNABTEC HND Network EngineeringBEng (Hons) Computer Networking & Cloud Security
Issuer
FM TecHub · fmtechub.com

He writes practical, plain-English guides on networking, security and cloud.

More about the author →

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Email updates: coming soon

New notes, tools and security news from FM TecHub by email, explained simply. Free. We're not collecting email addresses yet; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesopening soon

Meanwhile, stay connected: