Get your IP address, router and MAC address from Terminal — via SS64
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
networksetup -getinfo Wi-Fishows the IP address, subnet mask, router and hardware (MAC) address for the Wi-Fi service. UseEthernetor another name fromnetworksetup -listallnetworkservicesfor other connections.ipconfig getifaddr en0prints just the IP address of interfaceen0. It prints nothing if that interface isn't connected.
Command
Run in Terminal (Applications › Utilities).
networksetup -getinfo Wi-FiSources
- networksetup — by SS64
- ipconfig — by SS64
- 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.