Locating a Device on Your Network by MAC Address
An unfamiliar MAC address in a log, or a need to find which machine is saturating a link, both come down to tracing a MAC back to a physical location. The job has two stages: confirm the device is present, then narrow down to a specific port.
Stage one: confirm it is online and get an IP
Scan for ARP responses on the local segment. arp-scan is the quickest option. It sends ARP requests directly, so host firewalls do not interfere, because layer 2 has to answer:
sudo arp-scan --localnet
The output lists IP, MAC and its built-in vendor guess. For more accurate vendor data, paste the MAC into the lookup page, which syncs from the official Wireshark source every 30 days.
nmap does the same job:
sudo nmap -sn 192.168.1.0/24
The -sn flag does host discovery without port scanning. On the local segment nmap also uses ARP, which makes it more reliable than ICMP probing.
Check the DHCP lease table. If the device took its address by DHCP, the server's lease records give you the MAC-to-IP mapping directly, often with a hostname. ISC dhcpd keeps them in /var/lib/dhcp/dhcpd.leases and dnsmasq in /var/lib/misc/dnsmasq.leases. This route needs no scanning and retains records for devices that have gone offline.
Check the gateway's ARP table. The gateway has talked to every host, so its table is often the most complete:
ip neigh show
Stage two: narrow down to a switch port
With the MAC in hand, the MAC address table on a managed switch identifies the port. Cisco-style syntax:
show mac address-table address 001b.a912.3456
Huawei style:
display mac-address 001b-a912-3456
The output gives a VLAN and a port. If that port is an uplink to another switch, the device is further downstream and you log into the next switch and repeat. Hop-by-hop tracing is the standard method for finding a physical location; the mechanism is described in the switch MAC address table.
For wireless clients, check the association table on the access point or controller instead. It usually shows signal strength too, which gives you a rough bearing.
Practical shortcuts
Check the vendor first and save yourself time. If it resolves to a printer manufacturer, there is no point walking the desks. The vendor directory confirms which company owns a prefix.
Use port LEDs. Some switches can blink the indicator on a chosen port, which makes the machine at the other end of the cable immediately visible.
A failed lookup is not automatically suspicious. Addresses whose second hex character is 2, 6, A or E are locally administered, typically a phone with randomisation enabled or a virtual interface. The rule is in reading the first byte of a MAC address.
When the device is already offline. Both ARP tables and MAC address tables age out, so entries disappear. At that point you are left with DHCP lease history, switch logs or NetFlow records.
A combined one-liner
Format scan results as a table so they are easy to check against an asset list:
sudo arp-scan --localnet | awk '/^[0-9]/ {printf "%-16s %-18s %s\n", $1, $2, substr($0, index($0,$3))}'
If you are building a systematic device register, the caveats around using MAC as one of the fields are in using MAC addresses for network inventory.