Skip to content

Get your IP address, router and MAC address from Terminal — via SS64

Commandlow riskmacOS 14 Sonoma and later

Quick read-only commands show your local IP address and other connection details without clicking through System Settings. Useful when setting up port forwarding, a printer, or remote access.

Takes effect right away

The easy way

  1. networksetup -getinfo Wi-Fi shows the IP address, subnet mask, router and hardware (MAC) address for the Wi-Fi service. Use Ethernet or another name from networksetup -listallnetworkservices for other connections.
  2. ipconfig getifaddr en0 prints just the IP address of interface en0. It prints nothing if that interface isn't connected.

Command

Run in Terminal (Applications › Utilities).

networksetup -getinfo Wi-Fi

Sources

Source reviewed
2026-11-02
Link checked
2026-11-02
Tested hands-on
Not by Oddbyte.Me

Oddbyte.Me hasn't tried this on every macOS version, so keep the undo handy.

ip addressmac addressrouterterminalnetworksetupipconfig

More in Networking

Flush the DNS cache — via Marc Abramowitz

Commandlow riskAdmin

If a website moved to a new server, or you changed DNS settings and some sites still won't load, your Mac may be holding on to old address lookups. Flushing the DNS cache makes it look them up fresh. It's a troubleshooting step, not a speed boost.

Run Apple's built-in internet speed test — via SS64

Commandlow risk

macOS has its own speed test in Terminal. Besides download and upload speed, it measures 'responsiveness' (round trips per minute while the line is busy), which explains why video calls stutter on a connection that looks fast.