December 2, 2022

macOS: How to find network devices using a terminal


There is a Terminal command called arp that allows you to find network devices on your local area network (LAN). It will display IP addresses and MAC addresses, and is useful for troubleshooting and other situations.

Find network devices with ARP

ARP, or Address resolution protocol, is a communication protocol used to explore the link layer address associated with a network layer address. Translation: If you need the IP or MAC address of a device on the same network as you, use ARP.

[9 Alternatives for the Apple’s Mac Terminal App]

First, we will need to open Terminal. You can do this by searching for Spotlight, using Siri, or going to your Applications folder. Then type this command:

arp -a

This will give you a list of devices, as shown below:

Devices include everything on your network, such as Macs, PCs, iPhones, iPads, and routers. It shows both the LAN IP address and MAC address (mine is blacked out in the screenshot to keep them safe and hidden). You can match the MAC address to the device.

For example, to find your Mac’s MAC, go to System Preferences> Network. Click it Advanced button, and at the bottom you will see Wi-Fi Address. On your iPhone, go to Settings> General> About. Look for the same thing, called a Wi-Fi address.

Source link