How To Scan Your Local Network With Terminal On macOS (2026)

Scanning your local network from Terminal on a Mac takes two commands: arp -a for a quick list and nmap for a full sweep.

Both show the devices on your Wi-Fi or Ethernet network, with their IP addresses, and nmap can also show MAC addresses and open services.

Setup takes about five minutes, and the steps below were checked against the Nmap documentation, Homebrew and the macOS arp manual as of November 2026.

Which Terminal command should you use to scan your network on a Mac?

MethodInstall neededNeeds sudoBest forCommand
arpNo, built into macOSNoQuick list of devices your Mac has recently talked toarp -a
nmap ping scanYesRecommendedFinding every live device in a rangesudo nmap -sn 192.168.1.0/24
nmap port scanYesRecommendedChecking which ports a device exposesnmap 192.168.1.1
nmap aggressive scanYesYesOS, service versions, scripts and traceroute for one devicesudo nmap -A 192.168.1.1

Only scan networks you own or have permission to scan

Scan your own home or office network, or one where the owner has said yes, because probing other people’s networks can break their rules or the law.

The commands below send real probe packets, so a managed work or school network may log them or block them.

Step 1: find your network range

Nmap needs an address range, and you can read yours from Terminal.

  1. Open Terminal from /Applications/Utilities.
  2. Run ipconfig getifaddr en0 to print your Mac’s IP address on the Wi-Fi interface.
  3. If you are on Ethernet or the command prints nothing, run networksetup -listallhardwareports and use the Device name of your active connection instead of en0.
  4. Run ifconfig en0 to see the netmask, which macOS prints in hex.

A netmask of 0xffffff00 means /24, so an address of 192.168.1.23 gives the range 192.168.1.0/24, which covers .1 through .254.

Step 2: install nmap

You can install nmap with Homebrew or with the official installer.

  • Homebrew: run brew install nmap, and Homebrew lists prebuilt packages for Apple silicon Macs.
  • Official installer: download the .dmg from the Nmap download page, open the .mpkg inside, and enter your password when asked.

If macOS Gatekeeper blocks the installer, right-click the .mpkg, choose Open, then click Open again.

The Nmap download page lists its macOS build as x86-64, so Apple silicon owners usually find Homebrew simpler.

When it finishes, run nmap --version to confirm it is installed.

Step 3: list devices with arp

The arp command ships with macOS and reads the table of devices your Mac has already exchanged traffic with.

arp -a

Each line shows a hostname or a question mark, the IP address, the MAC address and the interface, for example ? (192.168.1.1) at aa:bb:cc:dd:ee:ff on en0 ifscope [ethernet].

  • arp -a -i en0 limits the list to one interface.
  • arp -an skips name lookups, which makes it faster.

Cache entries expire, so a quiet device may be missing, and that is why a real scan is more complete.

Step 4: find every live device with a ping scan

A ping scan lists which addresses answer without scanning their ports.

sudo nmap -sn 192.168.1.0/24

With sudo on a local Ethernet or Wi-Fi network, nmap sends ARP requests, which it describes as faster and more effective than other probes.

Without sudo, nmap falls back to TCP connection attempts on ports 80 and 443, so devices that ignore those ports can be missed.

Add -n to skip DNS lookups when you only want addresses.

Step 5: scan ports on one device

A plain scan of a single address checks its most common ports.

nmap 192.168.1.1

Pick the targets you care about, such as your router, a printer or a NAS, instead of scanning the whole range.

OptionWhat it does
-FFast mode, scans fewer ports than the default
-p 22,80,443Scans only the ports you list
--top-ports 100Scans the 100 most common ports
-sVProbes open ports for service and version info
-OTries to detect the operating system
-ATurns on OS detection, version detection, script scanning and traceroute

Step 6: save the results to a file

Nmap can write results to a file so you can compare scans later.

  • -oN scan.txt saves normal readable output.
  • -oX scan.xml saves XML for other programs.
  • -oA scan saves normal, XML and grepable formats at once.

Nmap marks the grepable -oG format as deprecated, so prefer XML if you plan to process the results with a script.

What the scan results tell you

You seeWhat it meansWhat to do
Host is upThe address answered the probeMatch its MAC address to a device you own
An unknown deviceSomething joined your network that you do not recognizeCheck your router’s client list and change the Wi-Fi password if needed
Port 22 openSSH is enabled on that deviceTurn it off if you do not use it
Port 80 or 443 openThe device runs a web page, such as a router admin screenMake sure it has a strong admin password

Our guide to scanning for devices on your Wi-Fi network covers the router and app route, and disabling WPS on your router closes a common weak spot.

If the scan shows no devices or fails

  • Nothing found: confirm the range matches your Mac’s address, because scanning 192.168.0.0/24 on a 192.168.1.x network finds nothing.
  • Some devices missing: rerun with sudo so nmap can use ARP, and note that a device with a firewall may still stay hidden.
  • Command not found: restart Terminal after installing, or run brew install nmap again.
  • Everything looks up: a router using proxy ARP can make every address appear alive, and nmap offers --disable-arp-ping for that case.

macOS also has a Local Network privacy setting under System Settings, Privacy & Security, Local Network, but commands run from Terminal are exempt, so it is rarely the cause.

Is there a graphical option?

Nmap’s official installer includes Zenmap, a graphical front end, though it needs the X11 application on macOS.

The arp command above needs no extra software, and nmap is the only install the other steps require.

Official references

Leave a Reply

Your email address will not be published. Required fields are marked *